Test

<back to all web services

HelloWithEnum

"use strict";
/** @typedef {'Value1'|'Value2'|'Value3'} */
export var EnumType;
(function (EnumType) {
    EnumType["Value1"] = "Value1"
    EnumType["Value2"] = "Value2"
    EnumType["Value3"] = "Value3"
})(EnumType || (EnumType = {}));
/** @typedef {number} */
export var EnumTypeFlags;
(function (EnumTypeFlags) {
    EnumTypeFlags[EnumTypeFlags["Value1"] = 0] = "Value1"
    EnumTypeFlags[EnumTypeFlags["Value2"] = 1] = "Value2"
    EnumTypeFlags[EnumTypeFlags["Value3"] = 2] = "Value3"
})(EnumTypeFlags || (EnumTypeFlags = {}));
/** @typedef {'None'|'Member 1'|'Value2'} */
export var EnumWithValues;
(function (EnumWithValues) {
    EnumWithValues["None"] = "None"
    EnumWithValues["Value1"] = "Member 1"
    EnumWithValues["Value2"] = "Value2"
})(EnumWithValues || (EnumWithValues = {}));
/** @typedef {number} */
export var EnumFlags;
(function (EnumFlags) {
    EnumFlags[EnumFlags["Value0"] = 0] = "Value0"
    EnumFlags[EnumFlags["Value1"] = 1] = "Value1"
    EnumFlags[EnumFlags["Value2"] = 2] = "Value2"
    EnumFlags[EnumFlags["Value3"] = 4] = "Value3"
    EnumFlags[EnumFlags["Value123"] = 7] = "Value123"
})(EnumFlags || (EnumFlags = {}));
/** @typedef {number} */
export var EnumAsInt;
(function (EnumAsInt) {
    EnumAsInt[EnumAsInt["Value1"] = 1000] = "Value1"
    EnumAsInt[EnumAsInt["Value2"] = 2000] = "Value2"
    EnumAsInt[EnumAsInt["Value3"] = 3000] = "Value3"
})(EnumAsInt || (EnumAsInt = {}));
/** @typedef {'lower'|'UPPER'|'PascalCase'|'camelCase'|'camelUPPER'|'PascalUPPER'} */
export var EnumStyle;
(function (EnumStyle) {
    EnumStyle["lower"] = "lower"
    EnumStyle["UPPER"] = "UPPER"
    EnumStyle["PascalCase"] = "PascalCase"
    EnumStyle["camelCase"] = "camelCase"
    EnumStyle["camelUPPER"] = "camelUPPER"
    EnumStyle["PascalUPPER"] = "PascalUPPER"
})(EnumStyle || (EnumStyle = {}));
/** @typedef {'lower'|'UPPER'|'PascalCase'|'camelCase'|'camelUPPER'|'PascalUPPER'} */
export var EnumStyleMembers;
(function (EnumStyleMembers) {
    EnumStyleMembers["Lower"] = "lower"
    EnumStyleMembers["Upper"] = "UPPER"
    EnumStyleMembers["PascalCase"] = "PascalCase"
    EnumStyleMembers["CamelCase"] = "camelCase"
    EnumStyleMembers["CamelUpper"] = "camelUPPER"
    EnumStyleMembers["PascalUpper"] = "PascalUPPER"
})(EnumStyleMembers || (EnumStyleMembers = {}));
export class HelloWithEnum {
    /** @param {{enumProp?:EnumType,enumTypeFlags?:EnumTypeFlags,enumWithValues?:EnumWithValues,nullableEnumProp?:EnumType,enumFlags?:EnumFlags,enumAsInt?:EnumAsInt,enumStyle?:EnumStyle,enumStyleMembers?:EnumStyleMembers}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {EnumType} */
    enumProp;
    /** @type {EnumTypeFlags} */
    enumTypeFlags;
    /** @type {EnumWithValues} */
    enumWithValues;
    /** @type {?EnumType} */
    nullableEnumProp;
    /** @type {EnumFlags} */
    enumFlags;
    /** @type {EnumAsInt} */
    enumAsInt;
    /** @type {EnumStyle} */
    enumStyle;
    /** @type {EnumStyleMembers} */
    enumStyleMembers;
}

JavaScript HelloWithEnum DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /csv/oneway/HelloWithEnum HTTP/1.1 
Host: test.servicestack.net 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"enumProp":"Value1","enumTypeFlags":0,"enumWithValues":"None","nullableEnumProp":"Value1","enumFlags":0,"enumAsInt":"Value1","enumStyle":"lower","enumStyleMembers":"lower"}