Test

<back to all web services

HelloWithEnumMap

"use strict";
/** @typedef {'Value1'|'Value2'|'Value3'} */
export var EnumType;
(function (EnumType) {
    EnumType["Value1"] = "Value1"
    EnumType["Value2"] = "Value2"
    EnumType["Value3"] = "Value3"
})(EnumType || (EnumType = {}));
/** @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 {'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 = {}));
export class HelloWithEnumMap {
    /** @param {{enumProp?:{ [index: string]: EnumType; },enumWithValues?:{ [index: string]: EnumWithValues; },nullableEnumProp?:{ [index: string]: EnumType; },enumFlags?:{ [index: string]: EnumFlags; },enumStyle?:{ [index: string]: EnumStyle; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {{ [index: string]: EnumType; }} */
    enumProp;
    /** @type {{ [index: string]: EnumWithValues; }} */
    enumWithValues;
    /** @type {{ [index: string]: EnumType; }} */
    nullableEnumProp;
    /** @type {{ [index: string]: EnumFlags; }} */
    enumFlags;
    /** @type {{ [index: string]: EnumStyle; }} */
    enumStyle;
}

JavaScript HelloWithEnumMap DTOs

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

HTTP + JSV

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

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

{
	enumProp: 
	{
		Value1: Value1
	},
	enumWithValues: 
	{
		None: None
	},
	nullableEnumProp: 
	{
		Value1: Value1
	},
	enumFlags: 
	{
		0: 0
	},
	enumStyle: 
	{
		lower: lower
	}
}