mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The forge tree held the package scaffolding and none of the generated sources — 2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply absent, so anything depending on this copy had a package that compiled to nothing usable. Generated from the current API document rather than reconciled with the other copy: a client is a function of the spec, so regenerating answers "which history wins" without anyone having to choose. .spec-lock records which document, so the next reader can tell.
70 lines
3.2 KiB
Swift
70 lines
3.2 KiB
Swift
//
|
|
// NotifySend.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct NotifySend: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Body is the message text, sent verbatim when present — the no-template path. */
|
|
public var body: String?
|
|
/** Channel selects the delivery channel, sms or email. The per-channel routes (/send/sms, /send/email) pin it, overriding whatever the body names; on the generic route it is required. */
|
|
public var channel: String?
|
|
/** Event is the event name, which doubles as the template id when TemplateID is empty — the IAM OTP path sends event=iam.otp_sent and nothing else. */
|
|
public var event: String?
|
|
/** Provider pins a provider service name (twilio, plivo, twilio_email, mail). Empty picks the one whose org credentials are actually configured in KMS. */
|
|
public var provider: String?
|
|
/** Subject is the message subject, carried on the email channel only. */
|
|
public var subject: String?
|
|
/** Sync must be exactly \"true\": delivery here is synchronous, and anything else answers 503 because the queue plane that would run an async dispatch is owned elsewhere. Over REST it rides as ?sync=true (the URL binds over the body); a by-name call states it in its arguments. */
|
|
public var sync: String?
|
|
/** TemplateID selects a built-in template when Body is empty. */
|
|
public var templateId: String?
|
|
public var templateVars: JSONValue?
|
|
/** To is the destination address per recipient — a phone number for sms, an email address for email. Several recipients fan out into one provider call each, and the response shape follows the count (see the items field). */
|
|
public var to: [String]?
|
|
|
|
public init(body: String? = nil, channel: String? = nil, event: String? = nil, provider: String? = nil, subject: String? = nil, sync: String? = nil, templateId: String? = nil, templateVars: JSONValue? = nil, to: [String]? = nil) {
|
|
self.body = body
|
|
self.channel = channel
|
|
self.event = event
|
|
self.provider = provider
|
|
self.subject = subject
|
|
self.sync = sync
|
|
self.templateId = templateId
|
|
self.templateVars = templateVars
|
|
self.to = to
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case body
|
|
case channel
|
|
case event
|
|
case provider
|
|
case subject
|
|
case sync
|
|
case templateId = "template_id"
|
|
case templateVars = "template_vars"
|
|
case to
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(body, forKey: .body)
|
|
try container.encodeIfPresent(channel, forKey: .channel)
|
|
try container.encodeIfPresent(event, forKey: .event)
|
|
try container.encodeIfPresent(provider, forKey: .provider)
|
|
try container.encodeIfPresent(subject, forKey: .subject)
|
|
try container.encodeIfPresent(sync, forKey: .sync)
|
|
try container.encodeIfPresent(templateId, forKey: .templateId)
|
|
try container.encodeIfPresent(templateVars, forKey: .templateVars)
|
|
try container.encodeIfPresent(to, forKey: .to)
|
|
}
|
|
}
|
|
|