Required role: | User |
GET | /app/config |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class AppUserInfo implements IConvertible
{
/**
* The user's first name
*/
// @ApiMember(Description="The user's first name")
String? firstName;
/**
* The user's last name
*/
// @ApiMember(Description="The user's last name")
String? lastName;
/**
* Shortcut to the user's full name
*/
// @ApiMember(Description="Shortcut to the user's full name")
String? name;
/**
* The URL to the user's avatar
*/
// @ApiMember(Description="The URL to the user's avatar")
String? avatarUrl;
AppUserInfo({this.firstName,this.lastName,this.name,this.avatarUrl});
AppUserInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
firstName = json['firstName'];
lastName = json['lastName'];
name = json['name'];
avatarUrl = json['avatarUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'firstName': firstName,
'lastName': lastName,
'name': name,
'avatarUrl': avatarUrl
};
getTypeName() => "AppUserInfo";
TypeContext? context = _ctx;
}
enum AgentStates
{
Unknown,
Ready,
NotReady,
LoggedOut,
WrapUp,
Outgoing,
Other,
}
enum AgentStateReasons
{
Unknown,
SetByUser,
MissedCall,
SetBySystem,
}
class AppSettings implements IConvertible
{
bool? enablePhoneNumberManagement;
bool? enableDeviceManagement;
bool? enableDialer;
bool? enableCallHistory;
bool? enableAssistants;
bool? showFileNameInMessageCenter;
String? chakraTheme;
String? customCss;
String? pageTitle;
String? stringMappings;
String? logoutUrl;
String? portMyNumberUrl;
AppSettings({this.enablePhoneNumberManagement,this.enableDeviceManagement,this.enableDialer,this.enableCallHistory,this.enableAssistants,this.showFileNameInMessageCenter,this.chakraTheme,this.customCss,this.pageTitle,this.stringMappings,this.logoutUrl,this.portMyNumberUrl});
AppSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
enablePhoneNumberManagement = json['enablePhoneNumberManagement'];
enableDeviceManagement = json['enableDeviceManagement'];
enableDialer = json['enableDialer'];
enableCallHistory = json['enableCallHistory'];
enableAssistants = json['enableAssistants'];
showFileNameInMessageCenter = json['showFileNameInMessageCenter'];
chakraTheme = json['chakraTheme'];
customCss = json['customCss'];
pageTitle = json['pageTitle'];
stringMappings = json['stringMappings'];
logoutUrl = json['logoutUrl'];
portMyNumberUrl = json['portMyNumberUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'enablePhoneNumberManagement': enablePhoneNumberManagement,
'enableDeviceManagement': enableDeviceManagement,
'enableDialer': enableDialer,
'enableCallHistory': enableCallHistory,
'enableAssistants': enableAssistants,
'showFileNameInMessageCenter': showFileNameInMessageCenter,
'chakraTheme': chakraTheme,
'customCss': customCss,
'pageTitle': pageTitle,
'stringMappings': stringMappings,
'logoutUrl': logoutUrl,
'portMyNumberUrl': portMyNumberUrl
};
getTypeName() => "AppSettings";
TypeContext? context = _ctx;
}
enum ThirdPartyPhoneSystemTypes
{
Demo,
Sip,
}
enum TransportTypes
{
UDP,
TLS,
TCP,
PERS,
}
enum AudioCodecTypes
{
PCMU,
GSM,
PCMA,
G722,
G729,
ILBC,
AMR,
AMRWB,
SPEEX,
DTMF,
SPEEXWB,
ISACWB,
ISACSWB,
OPUS,
G7221,
NONE,
}
enum DtmfMethods
{
RFC2833,
INFO,
}
class ThirdPartySipAccountSettings implements IConvertible
{
String? number;
String? agent;
String? authName;
String? userName;
String? displayName;
String? password;
String? userDomain;
int? registrationExpires;
TransportTypes? transportType;
String? localIP;
int? localPort;
String? sipServer;
int? sipServerPort;
String? outboundServer;
int? outboundServerPort;
String? stunServer;
int? stunPort;
String? audioPlaybackDeviceName;
String? audioRecordingDeviceName;
List<AudioCodecTypes>? audioCodecs;
DtmfMethods? dtmfMethod;
ThirdPartySipAccountSettings({this.number,this.agent,this.authName,this.userName,this.displayName,this.password,this.userDomain,this.registrationExpires,this.transportType,this.localIP,this.localPort,this.sipServer,this.sipServerPort,this.outboundServer,this.outboundServerPort,this.stunServer,this.stunPort,this.audioPlaybackDeviceName,this.audioRecordingDeviceName,this.audioCodecs,this.dtmfMethod});
ThirdPartySipAccountSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
number = json['number'];
agent = json['agent'];
authName = json['authName'];
userName = json['userName'];
displayName = json['displayName'];
password = json['password'];
userDomain = json['userDomain'];
registrationExpires = json['registrationExpires'];
transportType = JsonConverters.fromJson(json['transportType'],'TransportTypes',context!);
localIP = json['localIP'];
localPort = json['localPort'];
sipServer = json['sipServer'];
sipServerPort = json['sipServerPort'];
outboundServer = json['outboundServer'];
outboundServerPort = json['outboundServerPort'];
stunServer = json['stunServer'];
stunPort = json['stunPort'];
audioPlaybackDeviceName = json['audioPlaybackDeviceName'];
audioRecordingDeviceName = json['audioRecordingDeviceName'];
audioCodecs = JsonConverters.fromJson(json['audioCodecs'],'List<AudioCodecTypes>',context!);
dtmfMethod = JsonConverters.fromJson(json['dtmfMethod'],'DtmfMethods',context!);
return this;
}
Map<String, dynamic> toJson() => {
'number': number,
'agent': agent,
'authName': authName,
'userName': userName,
'displayName': displayName,
'password': password,
'userDomain': userDomain,
'registrationExpires': registrationExpires,
'transportType': JsonConverters.toJson(transportType,'TransportTypes',context!),
'localIP': localIP,
'localPort': localPort,
'sipServer': sipServer,
'sipServerPort': sipServerPort,
'outboundServer': outboundServer,
'outboundServerPort': outboundServerPort,
'stunServer': stunServer,
'stunPort': stunPort,
'audioPlaybackDeviceName': audioPlaybackDeviceName,
'audioRecordingDeviceName': audioRecordingDeviceName,
'audioCodecs': JsonConverters.toJson(audioCodecs,'List<AudioCodecTypes>',context!),
'dtmfMethod': JsonConverters.toJson(dtmfMethod,'DtmfMethods',context!)
};
getTypeName() => "ThirdPartySipAccountSettings";
TypeContext? context = _ctx;
}
class ThirdPartySipSettings implements IConvertible
{
List<ThirdPartySipAccountSettings>? accounts;
ThirdPartySipSettings({this.accounts});
ThirdPartySipSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
accounts = JsonConverters.fromJson(json['accounts'],'List<ThirdPartySipAccountSettings>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'accounts': JsonConverters.toJson(accounts,'List<ThirdPartySipAccountSettings>',context!)
};
getTypeName() => "ThirdPartySipSettings";
TypeContext? context = _ctx;
}
class ThirdPartyDemoSettings implements IConvertible
{
String? Extension;
ThirdPartyDemoSettings({this.Extension});
ThirdPartyDemoSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Extension = json['extension'];
return this;
}
Map<String, dynamic> toJson() => {
'extension': Extension
};
getTypeName() => "ThirdPartyDemoSettings";
TypeContext? context = _ctx;
}
class ThirdPartyPhoneSystemSettings implements IConvertible
{
ThirdPartyPhoneSystemTypes? type;
ThirdPartySipSettings? sipSettings;
ThirdPartyDemoSettings? demoSettings;
ThirdPartyPhoneSystemSettings({this.type,this.sipSettings,this.demoSettings});
ThirdPartyPhoneSystemSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
type = JsonConverters.fromJson(json['type'],'ThirdPartyPhoneSystemTypes',context!);
sipSettings = JsonConverters.fromJson(json['sipSettings'],'ThirdPartySipSettings',context!);
demoSettings = JsonConverters.fromJson(json['demoSettings'],'ThirdPartyDemoSettings',context!);
return this;
}
Map<String, dynamic> toJson() => {
'type': JsonConverters.toJson(type,'ThirdPartyPhoneSystemTypes',context!),
'sipSettings': JsonConverters.toJson(sipSettings,'ThirdPartySipSettings',context!),
'demoSettings': JsonConverters.toJson(demoSettings,'ThirdPartyDemoSettings',context!)
};
getTypeName() => "ThirdPartyPhoneSystemSettings";
TypeContext? context = _ctx;
}
class AppConfig implements IConvertible
{
/**
* The ID of this endpoint
*/
// @ApiMember(Description="The ID of this endpoint")
String? endpointId;
/**
* The ID of the account
*/
// @ApiMember(Description="The ID of the account")
String? accountId;
/**
* The customer ID associated with this user
*/
// @ApiMember(Description="The customer ID associated with this user")
String? customerId;
/**
* The access token for use with Twilio Voice
*/
// @ApiMember(Description="The access token for use with Twilio Voice")
String? accessToken;
/**
* The access token's identity
*/
// @ApiMember(Description="The access token's identity")
String? identity;
/**
* The email address of the user
*/
// @ApiMember(Description="The email address of the user")
String? emailAddress;
/**
* The user's information
*/
// @ApiMember(Description="The user's information")
AppUserInfo? userInfo;
/**
* The agent state (for call center users)
*/
// @ApiMember(Description="The agent state (for call center users)")
AgentStates? agentState;
/**
* The agent state reason
*/
// @ApiMember(Description="The agent state reason")
AgentStateReasons? agentStateReason;
/**
* The tabs for the app
*/
// @ApiMember(Description="The tabs for the app")
List<dynamic>? tabs;
/**
* The app settings
*/
// @ApiMember(Description="The app settings")
AppSettings? appSettings;
/**
* The phone settings for third party connectivity
*/
// @ApiMember(Description="The phone settings for third party connectivity")
ThirdPartyPhoneSystemSettings? thirdPartyPhoneSystemSettings;
AppConfig({this.endpointId,this.accountId,this.customerId,this.accessToken,this.identity,this.emailAddress,this.userInfo,this.agentState,this.agentStateReason,this.tabs,this.appSettings,this.thirdPartyPhoneSystemSettings});
AppConfig.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
endpointId = json['endpointId'];
accountId = json['accountId'];
customerId = json['customerId'];
accessToken = json['accessToken'];
identity = json['identity'];
emailAddress = json['emailAddress'];
userInfo = JsonConverters.fromJson(json['userInfo'],'AppUserInfo',context!);
agentState = JsonConverters.fromJson(json['agentState'],'AgentStates',context!);
agentStateReason = JsonConverters.fromJson(json['agentStateReason'],'AgentStateReasons',context!);
tabs = JsonConverters.fromJson(json['tabs'],'List<dynamic>',context!);
appSettings = JsonConverters.fromJson(json['appSettings'],'AppSettings',context!);
thirdPartyPhoneSystemSettings = JsonConverters.fromJson(json['thirdPartyPhoneSystemSettings'],'ThirdPartyPhoneSystemSettings',context!);
return this;
}
Map<String, dynamic> toJson() => {
'endpointId': endpointId,
'accountId': accountId,
'customerId': customerId,
'accessToken': accessToken,
'identity': identity,
'emailAddress': emailAddress,
'userInfo': JsonConverters.toJson(userInfo,'AppUserInfo',context!),
'agentState': JsonConverters.toJson(agentState,'AgentStates',context!),
'agentStateReason': JsonConverters.toJson(agentStateReason,'AgentStateReasons',context!),
'tabs': JsonConverters.toJson(tabs,'List<dynamic>',context!),
'appSettings': JsonConverters.toJson(appSettings,'AppSettings',context!),
'thirdPartyPhoneSystemSettings': JsonConverters.toJson(thirdPartyPhoneSystemSettings,'ThirdPartyPhoneSystemSettings',context!)
};
getTypeName() => "AppConfig";
TypeContext? context = _ctx;
}
enum DeviceTypes
{
Web,
iOS,
Android,
}
/**
* Gets the config for the app including webRTC token
*/
// @Api(Description="Gets the config for the app including webRTC token")
class GetAppConfig implements IGet, IConvertible
{
/**
* The type of device you are requesting config for
*/
// @ApiMember(Description="The type of device you are requesting config for")
DeviceTypes? deviceType;
/**
* Use a specific push credential SID
*/
// @ApiMember(Description="Use a specific push credential SID")
String? pushCredentialSid;
/**
* Use a specific application SID
*/
// @ApiMember(Description="Use a specific application SID")
String? applicationSid;
/**
* Is this device operating in a sandbox environment? IOS only.
*/
// @ApiMember(Description="Is this device operating in a sandbox environment? IOS only.")
bool? sandbox;
GetAppConfig({this.deviceType,this.pushCredentialSid,this.applicationSid,this.sandbox});
GetAppConfig.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
deviceType = JsonConverters.fromJson(json['deviceType'],'DeviceTypes',context!);
pushCredentialSid = json['pushCredentialSid'];
applicationSid = json['applicationSid'];
sandbox = json['sandbox'];
return this;
}
Map<String, dynamic> toJson() => {
'deviceType': JsonConverters.toJson(deviceType,'DeviceTypes',context!),
'pushCredentialSid': pushCredentialSid,
'applicationSid': applicationSid,
'sandbox': sandbox
};
getTypeName() => "GetAppConfig";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'team.evovoice.io', types: <String, TypeInfo> {
'AppUserInfo': TypeInfo(TypeOf.Class, create:() => AppUserInfo()),
'AgentStates': TypeInfo(TypeOf.Enum, enumValues:AgentStates.values),
'AgentStateReasons': TypeInfo(TypeOf.Enum, enumValues:AgentStateReasons.values),
'AppSettings': TypeInfo(TypeOf.Class, create:() => AppSettings()),
'ThirdPartyPhoneSystemTypes': TypeInfo(TypeOf.Enum, enumValues:ThirdPartyPhoneSystemTypes.values),
'TransportTypes': TypeInfo(TypeOf.Enum, enumValues:TransportTypes.values),
'AudioCodecTypes': TypeInfo(TypeOf.Enum, enumValues:AudioCodecTypes.values),
'DtmfMethods': TypeInfo(TypeOf.Enum, enumValues:DtmfMethods.values),
'ThirdPartySipAccountSettings': TypeInfo(TypeOf.Class, create:() => ThirdPartySipAccountSettings()),
'List<AudioCodecTypes>': TypeInfo(TypeOf.Class, create:() => <AudioCodecTypes>[]),
'ThirdPartySipSettings': TypeInfo(TypeOf.Class, create:() => ThirdPartySipSettings()),
'List<ThirdPartySipAccountSettings>': TypeInfo(TypeOf.Class, create:() => <ThirdPartySipAccountSettings>[]),
'ThirdPartyDemoSettings': TypeInfo(TypeOf.Class, create:() => ThirdPartyDemoSettings()),
'ThirdPartyPhoneSystemSettings': TypeInfo(TypeOf.Class, create:() => ThirdPartyPhoneSystemSettings()),
'AppConfig': TypeInfo(TypeOf.Class, create:() => AppConfig()),
'List<dynamic>': TypeInfo(TypeOf.Class, create:() => <dynamic>[]),
'DeviceTypes': TypeInfo(TypeOf.Enum, enumValues:DeviceTypes.values),
'GetAppConfig': TypeInfo(TypeOf.Class, create:() => GetAppConfig()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /app/config HTTP/1.1 Host: team.evovoice.io Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { endpointId: String, accountId: String, customerId: String, accessToken: String, identity: String, emailAddress: String, userInfo: { firstName: String, lastName: String, name: String, avatarUrl: String }, agentState: Unknown, agentStateReason: Unknown, tabs: [ { } ], appSettings: { enablePhoneNumberManagement: False, enableDeviceManagement: False, enableDialer: False, enableCallHistory: False, enableAssistants: False, showFileNameInMessageCenter: False, chakraTheme: String, customCss: String, pageTitle: String, stringMappings: String, logoutUrl: String, portMyNumberUrl: String }, thirdPartyPhoneSystemSettings: { type: Demo, sipSettings: { accounts: [ { number: String, agent: String, authName: String, userName: String, displayName: String, password: String, userDomain: String, registrationExpires: 0, transportType: UDP, localIP: String, localPort: 0, sipServer: String, sipServerPort: 0, outboundServer: String, outboundServerPort: 0, stunServer: String, stunPort: 0, audioPlaybackDeviceName: String, audioRecordingDeviceName: String, audioCodecs: [ PCMU ], dtmfMethod: RFC2833 } ] }, demoSettings: { extension: String } } }