Requires any of the roles: | SystemAdministrator, Manager, Customer |
PATCHY | /system/settings |
---|
import Foundation
import ServiceStack
/**
* Updates the system settings
*/
// @Api(Description="Updates the system settings")
public class PatchSystemSettings : IPatch, Codable
{
/**
* Use to override the system time for testing
*/
// @ApiMember(Description="Use to override the system time for testing")
public var overrideSystemTime:Bool?
/**
* The system override time zone
*/
// @ApiMember(Description="The system override time zone")
public var overrideSystemTimeZoneId:String
/**
* The system override date/time
*/
// @ApiMember(Description="The system override date/time")
public var overrideSystemDateTime:String
/**
* The account ID of the system settings
*/
// @ApiMember(Description="The account ID of the system settings")
public var accountId:String
/**
* The list of system settings fields
*/
// @ApiMember(Description="The list of system settings fields")
public var systemFields:[SystemSettingsField]
/**
* The list of customer fields
*/
// @ApiMember(Description="The list of customer fields")
public var customerFields:[CustomerDataField]
/**
* The list of endpoint fields
*/
// @ApiMember(Description="The list of endpoint fields")
public var endpointFields:[EndpointDataField]
/**
* The list of email accounts
*/
// @ApiMember(Description="The list of email accounts")
public var emailAccounts:[EmailAccount]
/**
* The list of tags
*/
// @ApiMember(Description="The list of tags")
public var tags:[Tag]
/**
* Documentation for the account
*/
// @ApiMember(Description="Documentation for the account")
public var documentation:String
/**
* The number of days recordings are retained
*/
// @ApiMember(Description="The number of days recordings are retained")
public var recordingRetentionDays:Int?
/**
* Enable the SIP refer beta
*/
// @ApiMember(Description="Enable the SIP refer beta")
public var enableSipRefer:Bool?
/**
* The number of seconds after which we automatically logoff a not ready agent
*/
// @ApiMember(Description="The number of seconds after which we automatically logoff a not ready agent")
public var autoAgentLogoffSeconds:Int?
/**
* The default SIP region for new devices
*/
// @ApiMember(Description="The default SIP region for new devices")
public var defaultSipRegion:TwilioSipRegions?
required public init(){}
}
public class SystemSettingsField : DataField
{
public var value:Value
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case value
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
value = try container.decodeIfPresent(Value.self, forKey: .value)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if value != nil { try container.encode(value, forKey: .value) }
}
}
public class DataField : Codable
{
public var id:String
public var name:String
public var type:ValueTypes
public var uiHint:UIHints
public var uiTab:String
public var isAsync:Bool
public var disableBinding:Bool
public var structType:DataType
public var listType:DataType
public var Description:String
public var possibleValues:[String]
public var isOutput:Bool
public var customFieldValuesUrl:String
public var defaultValue:Value
public var transitionNameFormat:String
public var uniqueness:DataFieldUniqueness
public var voiceOnly:Bool
public var conditionalVisibilityField:String
public var conditionalVisibilityValue:String
public var noEvalTemplate:Bool
public var userMode:UserDataFieldModes
public var anyValueType:Bool
required public init(){}
}
public enum ValueTypes : String, Codable
{
case NotSpecified
case String
case Boolean
case Number
case List
case Struct
case Transition
case Custom
case Date
case AudioFile
case TimeZoneId
case PhoneNumber
case User
case Endpoint
case Time
case File
case FaxNumber
case EmailAccount
case Customer
case Flow
case Team
case FlowReference
case Integration
case Assistant
}
public enum UIHints : String, Codable
{
case None
case LargeText
case InlineForm
case Password
case InlineStruct
}
public class DataType : Codable
{
public var typeName:String
public var fields:[DataField]
required public init(){}
}
public class Value : Codable
{
public var boolValue:Bool?
public var stringValue:String
public var numberValue:Double?
public var listValue:[Struct]
public var structValue:Struct
required public init(){}
}
public class Struct : List<String:Value>
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public enum DataFieldUniqueness : String, Codable
{
case NotUnique
case Unique
case UniqueToCustomer
}
public enum UserDataFieldModes : String, Codable
{
case Hidden
case ReadOnly
case ReadWrite
}
public class CustomerDataField : DataField
{
public var showInSearch:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case showInSearch
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
showInSearch = try container.decodeIfPresent(Bool.self, forKey: .showInSearch)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if showInSearch != nil { try container.encode(showInSearch, forKey: .showInSearch) }
}
}
public class EndpointDataField : DataField
{
public var showInSearch:Bool
public var showInLists:Bool
public var endpointType:EndpointTypes?
public var isCallerId:Bool
public var isKnob:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case showInSearch
case showInLists
case endpointType
case isCallerId
case isKnob
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
showInSearch = try container.decodeIfPresent(Bool.self, forKey: .showInSearch)
showInLists = try container.decodeIfPresent(Bool.self, forKey: .showInLists)
endpointType = try container.decodeIfPresent(EndpointTypes.self, forKey: .endpointType)
isCallerId = try container.decodeIfPresent(Bool.self, forKey: .isCallerId)
isKnob = try container.decodeIfPresent(Bool.self, forKey: .isKnob)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if showInSearch != nil { try container.encode(showInSearch, forKey: .showInSearch) }
if showInLists != nil { try container.encode(showInLists, forKey: .showInLists) }
if endpointType != nil { try container.encode(endpointType, forKey: .endpointType) }
if isCallerId != nil { try container.encode(isCallerId, forKey: .isCallerId) }
if isKnob != nil { try container.encode(isKnob, forKey: .isKnob) }
}
}
public enum EndpointTypes : String, Codable
{
case PhoneNumber
case User
case FaxNumber
case EmailAddress
case Unused_1
case Unused_2
case Unused_3
case Unused_4
case Unused_5
case Team
case Assistant
}
public class EmailAccount : Codable
{
public var id:String
public var server:String
public var userName:String
public var port:Int
public var emailAddress:String
public var displayName:String
public var password:String
required public init(){}
}
public class Tag : Codable
{
public var id:String
public var name:String
public var color:TagColors
required public init(){}
}
public enum TagColors : String, Codable
{
case Magenta
case Red
case Volcano
case Orange
case Gold
case Lime
case Green
case Cyan
case Blue
case GeekBlue
case Purple
}
public enum TwilioSipRegions : String, Codable
{
case NorthAmericaVirginia
case NorthAmericaOregon
case EuropeIreland
case EuropeFrankfurt
case AsiaPacificSingapore
case AsiaPacificTokyo
case AsiaPacificSydney
case SouthAmericaSanPaolo
}
public class SystemSettingsInfo : EntityInfo
{
/**
* Use to override the system time for testing
*/
// @ApiMember(Description="Use to override the system time for testing")
public var overrideSystemTime:Bool
/**
* The system override time zone
*/
// @ApiMember(Description="The system override time zone")
public var overrideSystemTimeZoneId:String
/**
* The system override date/time
*/
// @ApiMember(Description="The system override date/time")
public var overrideSystemDateTime:String
/**
* The list of system settings fields
*/
// @ApiMember(Description="The list of system settings fields")
public var systemFields:[SystemSettingsField]
/**
* The list of customer metadata fields
*/
// @ApiMember(Description="The list of customer metadata fields")
public var customerFields:[CustomerDataField]
/**
* The list of endpoint metadata fields
*/
// @ApiMember(Description="The list of endpoint metadata fields")
public var endpointFields:[EndpointDataField]
/**
* The list of email accounts
*/
// @ApiMember(Description="The list of email accounts")
public var emailAccounts:[EmailAccount]
/**
* The list of tags in the system
*/
// @ApiMember(Description="The list of tags in the system")
public var tags:[Tag]
/**
* Documentation for the account
*/
// @ApiMember(Description="Documentation for the account")
public var documentation:String
/**
* The number of days recordings are retained
*/
// @ApiMember(Description="The number of days recordings are retained")
public var recordingRetentionDays:Int
/**
* Enable the SIP refer beta
*/
// @ApiMember(Description="Enable the SIP refer beta")
public var enableSipRefer:Bool
/**
* The number of seconds after which we automatically logoff a not ready agent
*/
// @ApiMember(Description="The number of seconds after which we automatically logoff a not ready agent")
public var autoAgentLogoffSeconds:Int
/**
* The default SIP region for new devices
*/
// @ApiMember(Description="The default SIP region for new devices")
public var defaultSipRegion:TwilioSipRegions?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case overrideSystemTime
case overrideSystemTimeZoneId
case overrideSystemDateTime
case systemFields
case customerFields
case endpointFields
case emailAccounts
case tags
case documentation
case recordingRetentionDays
case enableSipRefer
case autoAgentLogoffSeconds
case defaultSipRegion
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
overrideSystemTime = try container.decodeIfPresent(Bool.self, forKey: .overrideSystemTime)
overrideSystemTimeZoneId = try container.decodeIfPresent(String.self, forKey: .overrideSystemTimeZoneId)
overrideSystemDateTime = try container.decodeIfPresent(String.self, forKey: .overrideSystemDateTime)
systemFields = try container.decodeIfPresent([SystemSettingsField].self, forKey: .systemFields) ?? []
customerFields = try container.decodeIfPresent([CustomerDataField].self, forKey: .customerFields) ?? []
endpointFields = try container.decodeIfPresent([EndpointDataField].self, forKey: .endpointFields) ?? []
emailAccounts = try container.decodeIfPresent([EmailAccount].self, forKey: .emailAccounts) ?? []
tags = try container.decodeIfPresent([Tag].self, forKey: .tags) ?? []
documentation = try container.decodeIfPresent(String.self, forKey: .documentation)
recordingRetentionDays = try container.decodeIfPresent(Int.self, forKey: .recordingRetentionDays)
enableSipRefer = try container.decodeIfPresent(Bool.self, forKey: .enableSipRefer)
autoAgentLogoffSeconds = try container.decodeIfPresent(Int.self, forKey: .autoAgentLogoffSeconds)
defaultSipRegion = try container.decodeIfPresent(TwilioSipRegions.self, forKey: .defaultSipRegion)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if overrideSystemTime != nil { try container.encode(overrideSystemTime, forKey: .overrideSystemTime) }
if overrideSystemTimeZoneId != nil { try container.encode(overrideSystemTimeZoneId, forKey: .overrideSystemTimeZoneId) }
if overrideSystemDateTime != nil { try container.encode(overrideSystemDateTime, forKey: .overrideSystemDateTime) }
if systemFields != nil { try container.encode(systemFields, forKey: .systemFields) }
if customerFields != nil { try container.encode(customerFields, forKey: .customerFields) }
if endpointFields != nil { try container.encode(endpointFields, forKey: .endpointFields) }
if emailAccounts != nil { try container.encode(emailAccounts, forKey: .emailAccounts) }
if tags != nil { try container.encode(tags, forKey: .tags) }
if documentation != nil { try container.encode(documentation, forKey: .documentation) }
if recordingRetentionDays != nil { try container.encode(recordingRetentionDays, forKey: .recordingRetentionDays) }
if enableSipRefer != nil { try container.encode(enableSipRefer, forKey: .enableSipRefer) }
if autoAgentLogoffSeconds != nil { try container.encode(autoAgentLogoffSeconds, forKey: .autoAgentLogoffSeconds) }
if defaultSipRegion != nil { try container.encode(defaultSipRegion, forKey: .defaultSipRegion) }
}
}
public class EntityInfo : Codable
{
/**
* The ID of the object
*/
// @ApiMember(Description="The ID of the object")
public var id:String
/**
* The date the object was created
*/
// @ApiMember(Description="The date the object was created")
public var dateCreated:String
/**
* The date the object was last modified
*/
// @ApiMember(Description="The date the object was last modified")
public var dateLastModified:String
/**
* The user that created this object
*/
// @ApiMember(Description="The user that created this object")
public var createdBy:String
/**
* The user that last modified this object
*/
// @ApiMember(Description="The user that last modified this object")
public var lastModifiedBy:String
required public init(){}
}
Swift PatchSystemSettings DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /system/settings HTTP/1.1
Host: team.evovoice.io
Accept: application/json
Content-Type: application/json
Content-Length: length
{"overrideSystemTime":false,"overrideSystemTimeZoneId":"String","overrideSystemDateTime":"String","accountId":"String","systemFields":[{"value":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"id":"String","name":"String","type":"NotSpecified","uiHint":"None","uiTab":"String","isAsync":false,"disableBinding":false,"description":"String","possibleValues":["String"],"isOutput":false,"customFieldValuesUrl":"String","defaultValue":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"transitionNameFormat":"String","uniqueness":"NotUnique","voiceOnly":false,"conditionalVisibilityField":"String","conditionalVisibilityValue":"String","noEvalTemplate":false,"userMode":"Hidden","anyValueType":false}],"customerFields":[{"showInSearch":false,"id":"String","name":"String","type":"NotSpecified","uiHint":"None","uiTab":"String","isAsync":false,"disableBinding":false,"description":"String","possibleValues":["String"],"isOutput":false,"customFieldValuesUrl":"String","defaultValue":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"transitionNameFormat":"String","uniqueness":"NotUnique","voiceOnly":false,"conditionalVisibilityField":"String","conditionalVisibilityValue":"String","noEvalTemplate":false,"userMode":"Hidden","anyValueType":false}],"endpointFields":[{"showInSearch":false,"showInLists":false,"endpointType":"PhoneNumber","isCallerId":false,"isKnob":false,"id":"String","name":"String","type":"NotSpecified","uiHint":"None","uiTab":"String","isAsync":false,"disableBinding":false,"description":"String","possibleValues":["String"],"isOutput":false,"customFieldValuesUrl":"String","defaultValue":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"transitionNameFormat":"String","uniqueness":"NotUnique","voiceOnly":false,"conditionalVisibilityField":"String","conditionalVisibilityValue":"String","noEvalTemplate":false,"userMode":"Hidden","anyValueType":false}],"emailAccounts":[{"id":"String","server":"String","userName":"String","port":0,"emailAddress":"String","displayName":"String","password":"String"}],"tags":[{"id":"String","name":"String","color":"Magenta"}],"documentation":"String","recordingRetentionDays":0,"enableSipRefer":false,"autoAgentLogoffSeconds":0,"defaultSipRegion":"NorthAmericaVirginia"}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"overrideSystemTime":false,"overrideSystemTimeZoneId":"String","overrideSystemDateTime":"String","systemFields":[{"value":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"id":"String","name":"String","type":"NotSpecified","uiHint":"None","uiTab":"String","isAsync":false,"disableBinding":false,"description":"String","possibleValues":["String"],"isOutput":false,"customFieldValuesUrl":"String","defaultValue":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"transitionNameFormat":"String","uniqueness":"NotUnique","voiceOnly":false,"conditionalVisibilityField":"String","conditionalVisibilityValue":"String","noEvalTemplate":false,"userMode":"Hidden","anyValueType":false}],"customerFields":[{"showInSearch":false,"id":"String","name":"String","type":"NotSpecified","uiHint":"None","uiTab":"String","isAsync":false,"disableBinding":false,"description":"String","possibleValues":["String"],"isOutput":false,"customFieldValuesUrl":"String","defaultValue":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"transitionNameFormat":"String","uniqueness":"NotUnique","voiceOnly":false,"conditionalVisibilityField":"String","conditionalVisibilityValue":"String","noEvalTemplate":false,"userMode":"Hidden","anyValueType":false}],"endpointFields":[{"showInSearch":false,"showInLists":false,"endpointType":"PhoneNumber","isCallerId":false,"isKnob":false,"id":"String","name":"String","type":"NotSpecified","uiHint":"None","uiTab":"String","isAsync":false,"disableBinding":false,"description":"String","possibleValues":["String"],"isOutput":false,"customFieldValuesUrl":"String","defaultValue":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"transitionNameFormat":"String","uniqueness":"NotUnique","voiceOnly":false,"conditionalVisibilityField":"String","conditionalVisibilityValue":"String","noEvalTemplate":false,"userMode":"Hidden","anyValueType":false}],"emailAccounts":[{"id":"String","server":"String","userName":"String","port":0,"emailAddress":"String","displayName":"String","password":"String"}],"tags":[{"id":"String","name":"String","color":"Magenta"}],"documentation":"String","recordingRetentionDays":0,"enableSipRefer":false,"autoAgentLogoffSeconds":0,"defaultSipRegion":"NorthAmericaVirginia","id":"String","dateCreated":"String","dateLastModified":"String","createdBy":"String","lastModifiedBy":"String"}