GET | /integrations/{integrationId} |
---|
import Foundation
import ServiceStack
/**
* Get a specific integration
*/
// @Api(Description="Get a specific integration")
public class GetIntegration : IGet, Codable
{
/**
* The ID of the integration you want to get
*/
// @ApiMember(Description="The ID of the integration you want to get")
public var integrationId:String
required public init(){}
}
public class IntegrationInfo : EntityInfo
{
/**
* The ID of the account associated with this integration
*/
// @ApiMember(Description="The ID of the account associated with this integration")
public var accountId:String
/**
* The ID of the customer this integration is associated with
*/
// @ApiMember(Description="The ID of the customer this integration is associated with")
public var customerId:String
/**
* The name of the customer this integration is associated with
*/
// @ApiMember(Description="The name of the customer this integration is associated with")
public var customerName:String
/**
* The date the integration was sync'd last
*/
// @ApiMember(Description="The date the integration was sync'd last")
public var dateLastSync:String
/**
* The breadcrumb to the customer for this integration
*/
// @ApiMember(Description="The breadcrumb to the customer for this integration")
public var customerBreadcrumb:[CustomerBreadcrumb]
/**
* The name of the integration (e.g. HostedSuite Dallas)
*/
// @ApiMember(Description="The name of the integration (e.g. HostedSuite Dallas)")
public var name:String
/**
* Automatically create new customers / users when sync'ing with CRM?
*/
// @ApiMember(Description="Automatically create new customers / users when sync'ing with CRM?")
public var automaticallyCreateCustomers:Bool
/**
* The type of integration
*/
// @ApiMember(Description="The type of integration")
public var type:IntegrationTypes
/**
* The status of the integration
*/
// @ApiMember(Description="The status of the integration")
public var status:IntegrationStatuses
/**
* The status of the integration
*/
// @ApiMember(Description="The status of the integration")
public var statusMessage:String
/**
* The settings type for this integration
*/
// @ApiMember(Description="The settings type for this integration")
public var settingsDataType:DataType
/**
* The settings for this integration
*/
// @ApiMember(Description="The settings for this integration")
public var settings:Struct
/**
* The features supported by this integration
*/
// @ApiMember(Description="The features supported by this integration")
public var features:[IntegrationFeatures]
/**
* Is this integration authorized (OAuth)?
*/
// @ApiMember(Description="Is this integration authorized (OAuth)?")
public var isAuthorized:Bool
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case accountId
case customerId
case customerName
case dateLastSync
case customerBreadcrumb
case name
case automaticallyCreateCustomers
case type
case status
case statusMessage
case settingsDataType
case settings
case features
case isAuthorized
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
accountId = try container.decodeIfPresent(String.self, forKey: .accountId)
customerId = try container.decodeIfPresent(String.self, forKey: .customerId)
customerName = try container.decodeIfPresent(String.self, forKey: .customerName)
dateLastSync = try container.decodeIfPresent(String.self, forKey: .dateLastSync)
customerBreadcrumb = try container.decodeIfPresent([CustomerBreadcrumb].self, forKey: .customerBreadcrumb) ?? []
name = try container.decodeIfPresent(String.self, forKey: .name)
automaticallyCreateCustomers = try container.decodeIfPresent(Bool.self, forKey: .automaticallyCreateCustomers)
type = try container.decodeIfPresent(IntegrationTypes.self, forKey: .type)
status = try container.decodeIfPresent(IntegrationStatuses.self, forKey: .status)
statusMessage = try container.decodeIfPresent(String.self, forKey: .statusMessage)
settingsDataType = try container.decodeIfPresent(DataType.self, forKey: .settingsDataType)
settings = try container.decodeIfPresent(Struct.self, forKey: .settings)
features = try container.decodeIfPresent([IntegrationFeatures].self, forKey: .features) ?? []
isAuthorized = try container.decodeIfPresent(Bool.self, forKey: .isAuthorized)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if accountId != nil { try container.encode(accountId, forKey: .accountId) }
if customerId != nil { try container.encode(customerId, forKey: .customerId) }
if customerName != nil { try container.encode(customerName, forKey: .customerName) }
if dateLastSync != nil { try container.encode(dateLastSync, forKey: .dateLastSync) }
if customerBreadcrumb != nil { try container.encode(customerBreadcrumb, forKey: .customerBreadcrumb) }
if name != nil { try container.encode(name, forKey: .name) }
if automaticallyCreateCustomers != nil { try container.encode(automaticallyCreateCustomers, forKey: .automaticallyCreateCustomers) }
if type != nil { try container.encode(type, forKey: .type) }
if status != nil { try container.encode(status, forKey: .status) }
if statusMessage != nil { try container.encode(statusMessage, forKey: .statusMessage) }
if settingsDataType != nil { try container.encode(settingsDataType, forKey: .settingsDataType) }
if settings != nil { try container.encode(settings, forKey: .settings) }
if features != nil { try container.encode(features, forKey: .features) }
if isAuthorized != nil { try container.encode(isAuthorized, forKey: .isAuthorized) }
}
}
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(){}
}
public class CustomerBreadcrumb : Codable
{
public var id:String
public var name:String
required public init(){}
}
public enum IntegrationTypes : String, Codable
{
case HostedSuite
case OfficeRnd
case Zoho
}
public enum IntegrationStatuses : String, Codable
{
case NotConfigured
case Error
case OK
}
public class DataType : Codable
{
public var typeName:String
public var fields:[DataField]
required public init(){}
}
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 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 enum IntegrationFeatures : String, Codable
{
case CrmSync
case OAuth2
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /integrations/{integrationId} HTTP/1.1 Host: team.evovoice.io Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"accountId":"String","customerId":"String","customerName":"String","dateLastSync":"String","customerBreadcrumb":[{"id":"String","name":"String"}],"name":"String","automaticallyCreateCustomers":false,"type":"HostedSuite","status":"NotConfigured","statusMessage":"String","features":["CrmSync"],"isAuthorized":false,"id":"String","dateCreated":"String","dateLastModified":"String","createdBy":"String","lastModifiedBy":"String"}