Test

<back to all web services

DummyTypes

"use strict";
export class HelloResponse {
    /** @param {{result?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    result;
}
export class ListResult {
    /** @param {{result?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    result;
}
export class CancelRequest {
    /** @param {{tag?:string,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    tag;
    /** @type {{ [index: string]: string; }} */
    meta;
}
export class CancelRequestResponse {
    /** @param {{tag?:string,elapsed?:string,meta?:{ [index: string]: string; },responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    tag;
    /** @type {string} */
    elapsed;
    /** @type {{ [index: string]: string; }} */
    meta;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class UpdateEventSubscriber {
    /** @param {{id?:string,subscribeChannels?:string[],unsubscribeChannels?:string[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string[]} */
    subscribeChannels;
    /** @type {string[]} */
    unsubscribeChannels;
}
export class UpdateEventSubscriberResponse {
    /** @param {{responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {ResponseStatus} */
    responseStatus;
}
export class GetApiKeys {
    /** @param {{environment?:string,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    environment;
    /** @type {{ [index: string]: string; }} */
    meta;
}
export class UserApiKey {
    /** @param {{key?:string,keyType?:string,expiryDate?:string,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    key;
    /** @type {string} */
    keyType;
    /** @type {?string} */
    expiryDate;
    /** @type {{ [index: string]: string; }} */
    meta;
}
export class GetApiKeysResponse {
    /** @param {{results?:UserApiKey[],meta?:{ [index: string]: string; },responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {UserApiKey[]} */
    results;
    /** @type {{ [index: string]: string; }} */
    meta;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class RegenerateApiKeys {
    /** @param {{environment?:string,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    environment;
    /** @type {{ [index: string]: string; }} */
    meta;
}
export class RegenerateApiKeysResponse {
    /** @param {{results?:UserApiKey[],meta?:{ [index: string]: string; },responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {UserApiKey[]} */
    results;
    /** @type {{ [index: string]: string; }} */
    meta;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class ConvertSessionToToken {
    /** @param {{preserveSession?:boolean,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {boolean} */
    preserveSession;
    /** @type {{ [index: string]: string; }} */
    meta;
}
export class ConvertSessionToTokenResponse {
    /** @param {{meta?:{ [index: string]: string; },accessToken?:string,refreshToken?:string,responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {{ [index: string]: string; }} */
    meta;
    /** @type {string} */
    accessToken;
    /** @type {string} */
    refreshToken;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class GetAccessToken {
    /** @param {{refreshToken?:string,meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    refreshToken;
    /** @type {{ [index: string]: string; }} */
    meta;
}
export class GetAccessTokenResponse {
    /** @param {{accessToken?:string,meta?:{ [index: string]: string; },responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    accessToken;
    /** @type {{ [index: string]: string; }} */
    meta;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class NavItem {
    /** @param {{label?:string,href?:string,exact?:boolean,id?:string,className?:string,iconClass?:string,iconSrc?:string,show?:string,hide?:string,children?:NavItem[],meta?:{ [index: string]: string; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    label;
    /** @type {string} */
    href;
    /** @type {?boolean} */
    exact;
    /** @type {string} */
    id;
    /** @type {string} */
    className;
    /** @type {string} */
    iconClass;
    /** @type {string} */
    iconSrc;
    /** @type {string} */
    show;
    /** @type {string} */
    hide;
    /** @type {NavItem[]} */
    children;
    /** @type {{ [index: string]: string; }} */
    meta;
}
export class GetNavItems {
    /** @param {{name?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    name;
}
export class GetNavItemsResponse {
    /** @param {{baseUrl?:string,results?:NavItem[],navItemsMap?:{ [index: string]: NavItem[]; },meta?:{ [index: string]: string; },responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    baseUrl;
    /** @type {NavItem[]} */
    results;
    /** @type {{ [index: string]: NavItem[]; }} */
    navItemsMap;
    /** @type {{ [index: string]: string; }} */
    meta;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class EmptyResponse {
    /** @param {{responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {ResponseStatus} */
    responseStatus;
}
export class IdResponse {
    /** @param {{id?:string,responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class StringResponse {
    /** @param {{result?:string,meta?:{ [index: string]: string; },responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    result;
    /** @type {{ [index: string]: string; }} */
    meta;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class StringsResponse {
    /** @param {{results?:string[],meta?:{ [index: string]: string; },responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string[]} */
    results;
    /** @type {{ [index: string]: string; }} */
    meta;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class AuditBase {
    /** @param {{createdDate?:string,createdBy?:string,modifiedDate?:string,modifiedBy?:string,deletedDate?:string,deletedBy?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    createdDate;
    /** @type {string} */
    createdBy;
    /** @type {string} */
    modifiedDate;
    /** @type {string} */
    modifiedBy;
    /** @type {?string} */
    deletedDate;
    /** @type {string} */
    deletedBy;
}
export class DummyTypes {
    /** @param {{helloResponses?:HelloResponse[],listResult?:ListResult[],arrayResult?:ArrayResult[],cancelRequest?:CancelRequest,cancelRequestResponse?:CancelRequestResponse,updateEventSubscriber?:UpdateEventSubscriber,updateEventSubscriberResponse?:UpdateEventSubscriberResponse,getApiKeys?:GetApiKeys,getApiKeysResponse?:GetApiKeysResponse,regenerateApiKeys?:RegenerateApiKeys,regenerateApiKeysResponse?:RegenerateApiKeysResponse,userApiKey?:UserApiKey,convertSessionToToken?:ConvertSessionToToken,convertSessionToTokenResponse?:ConvertSessionToTokenResponse,getAccessToken?:GetAccessToken,getAccessTokenResponse?:GetAccessTokenResponse,navItem?:NavItem,getNavItems?:GetNavItems,getNavItemsResponse?:GetNavItemsResponse,emptyResponse?:EmptyResponse,idResponse?:IdResponse,stringResponse?:StringResponse,stringsResponse?:StringsResponse,auditBase?:AuditBase}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {HelloResponse[]} */
    helloResponses;
    /** @type {ListResult[]} */
    listResult;
    /** @type {ArrayResult[]} */
    arrayResult;
    /** @type {CancelRequest} */
    cancelRequest;
    /** @type {CancelRequestResponse} */
    cancelRequestResponse;
    /** @type {UpdateEventSubscriber} */
    updateEventSubscriber;
    /** @type {UpdateEventSubscriberResponse} */
    updateEventSubscriberResponse;
    /** @type {GetApiKeys} */
    getApiKeys;
    /** @type {GetApiKeysResponse} */
    getApiKeysResponse;
    /** @type {RegenerateApiKeys} */
    regenerateApiKeys;
    /** @type {RegenerateApiKeysResponse} */
    regenerateApiKeysResponse;
    /** @type {UserApiKey} */
    userApiKey;
    /** @type {ConvertSessionToToken} */
    convertSessionToToken;
    /** @type {ConvertSessionToTokenResponse} */
    convertSessionToTokenResponse;
    /** @type {GetAccessToken} */
    getAccessToken;
    /** @type {GetAccessTokenResponse} */
    getAccessTokenResponse;
    /** @type {NavItem} */
    navItem;
    /** @type {GetNavItems} */
    getNavItems;
    /** @type {GetNavItemsResponse} */
    getNavItemsResponse;
    /** @type {EmptyResponse} */
    emptyResponse;
    /** @type {IdResponse} */
    idResponse;
    /** @type {StringResponse} */
    stringResponse;
    /** @type {StringsResponse} */
    stringsResponse;
    /** @type {AuditBase} */
    auditBase;
}
export class ArrayResult {
    /** @param {{result?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    result;
}

JavaScript DummyTypes 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/DummyTypes HTTP/1.1 
Host: test.servicestack.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	helloResponses: 
	[
		{
			result: String
		}
	],
	listResult: 
	[
		{
			result: String
		}
	],
	arrayResult: 
	[
		{
			result: String
		}
	],
	cancelRequest: 
	{
		tag: String,
		meta: 
		{
			String: String
		}
	},
	cancelRequestResponse: 
	{
		tag: String,
		elapsed: PT0S,
		meta: 
		{
			String: String
		},
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	updateEventSubscriber: 
	{
		id: String,
		subscribeChannels: 
		[
			String
		],
		unsubscribeChannels: 
		[
			String
		]
	},
	updateEventSubscriberResponse: 
	{
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	getApiKeys: 
	{
		environment: String,
		meta: 
		{
			String: String
		}
	},
	getApiKeysResponse: 
	{
		results: 
		[
			{
				key: String,
				keyType: String,
				expiryDate: 0001-01-01,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		},
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	regenerateApiKeys: 
	{
		environment: String,
		meta: 
		{
			String: String
		}
	},
	regenerateApiKeysResponse: 
	{
		results: 
		[
			{
				key: String,
				keyType: String,
				expiryDate: 0001-01-01,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		},
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	userApiKey: 
	{
		key: String,
		keyType: String,
		expiryDate: 0001-01-01,
		meta: 
		{
			String: String
		}
	},
	convertSessionToToken: 
	{
		preserveSession: False,
		meta: 
		{
			String: String
		}
	},
	convertSessionToTokenResponse: 
	{
		meta: 
		{
			String: String
		},
		accessToken: String,
		refreshToken: String,
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	getAccessToken: 
	{
		refreshToken: String,
		meta: 
		{
			String: String
		}
	},
	getAccessTokenResponse: 
	{
		accessToken: String,
		meta: 
		{
			String: String
		},
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	navItem: 
	{
		label: String,
		href: String,
		exact: False,
		id: String,
		className: String,
		iconClass: String,
		iconSrc: String,
		show: String,
		hide: String,
		children: 
		[
			{
				label: String,
				href: String,
				exact: False,
				id: String,
				className: String,
				iconClass: String,
				iconSrc: String,
				show: String,
				hide: String,
				children: 
				[
					{
						label: String,
						href: String,
						exact: False,
						id: String,
						className: String,
						iconClass: String,
						iconSrc: String,
						show: String,
						hide: String,
						children: 
						[
							{
								
							}
						],
						meta: 
						{
							String: String
						}
					}
				],
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	},
	getNavItems: 
	{
		name: String
	},
	getNavItemsResponse: 
	{
		baseUrl: String,
		results: 
		[
			{
				label: String,
				href: String,
				exact: False,
				id: String,
				className: String,
				iconClass: String,
				iconSrc: String,
				show: String,
				hide: String,
				children: 
				[
					{
						label: String,
						href: String,
						exact: False,
						id: String,
						className: String,
						iconClass: String,
						iconSrc: String,
						show: String,
						hide: String,
						children: 
						[
							{
								label: String,
								href: String,
								exact: False,
								id: String,
								className: String,
								iconClass: String,
								iconSrc: String,
								show: String,
								hide: String,
								meta: 
								{
									String: String
								}
							}
						],
						meta: 
						{
							String: String
						}
					}
				],
				meta: 
				{
					String: String
				}
			}
		],
		navItemsMap: 
		{
			String: 
			[
				{
					label: String,
					href: String,
					exact: False,
					id: String,
					className: String,
					iconClass: String,
					iconSrc: String,
					show: String,
					hide: String,
					children: 
					[
						{
							label: String,
							href: String,
							exact: False,
							id: String,
							className: String,
							iconClass: String,
							iconSrc: String,
							show: String,
							hide: String,
							children: 
							[
								{
									label: String,
									href: String,
									exact: False,
									id: String,
									className: String,
									iconClass: String,
									iconSrc: String,
									show: String,
									hide: String,
									meta: 
									{
										String: String
									}
								}
							],
							meta: 
							{
								String: String
							}
						}
					],
					meta: 
					{
						String: String
					}
				}
			]
		},
		meta: 
		{
			String: String
		},
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	emptyResponse: 
	{
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	idResponse: 
	{
		id: String,
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	stringResponse: 
	{
		result: String,
		meta: 
		{
			String: String
		},
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	},
	stringsResponse: 
	{
		results: 
		[
			String
		],
		meta: 
		{
			String: String
		},
		responseStatus: 
		{
			errorCode: String,
			message: String,
			stackTrace: String,
			errors: 
			[
				{
					errorCode: String,
					fieldName: String,
					message: String,
					meta: 
					{
						String: String
					}
				}
			],
			meta: 
			{
				String: String
			}
		}
	}
}