mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
59 lines
2.0 KiB
Swift
59 lines
2.0 KiB
Swift
//
|
|
// Call.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Call: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Agent names the Hanzo assistant handling the call. Set means the call was answered by that assistant rather than connected to a person. */
|
|
public var agent: String?
|
|
/** From is the calling number in E.164. It must be one this org holds: a carrier refuses an origination from a number nobody proved they own. */
|
|
public var from: String?
|
|
/** ID is the carrier's handle for the call — what a hangup or a lookup names. */
|
|
public var id: String?
|
|
/** Org is the tenant the call was placed for or received by. */
|
|
public var org: String?
|
|
/** Status is where the call is: \"queued\", \"ringing\", \"answered\", \"completed\" or \"failed\". Only the last two are terminal. */
|
|
public var status: String?
|
|
/** To is the called number in E.164. */
|
|
public var to: String?
|
|
|
|
public init(agent: String? = nil, from: String? = nil, id: String? = nil, org: String? = nil, status: String? = nil, to: String? = nil) {
|
|
self.agent = agent
|
|
self.from = from
|
|
self.id = id
|
|
self.org = org
|
|
self.status = status
|
|
self.to = to
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case agent
|
|
case from
|
|
case id
|
|
case org
|
|
case status
|
|
case to
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(agent, forKey: .agent)
|
|
try container.encodeIfPresent(from, forKey: .from)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(org, forKey: .org)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(to, forKey: .to)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension Call: Identifiable {}
|