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.
41 lines
1.7 KiB
Swift
41 lines
1.7 KiB
Swift
//
|
|
// ConnectIn.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct ConnectIn: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** AccountID is the provider account the credential should be scoped to, for the providers whose Verify needs one (Cloudflare). Ignored by the OAuth path. */
|
|
public var accountId: String?
|
|
/** Provider is the connector's registry id, from the :provider path segment. */
|
|
public var provider: String?
|
|
/** Token is the customer's provider credential. Its PRESENCE — not its value — is what selects the apikey seal over the OAuth flow for a provider that offers both: {\"token\":\"…\"}, even empty, is an apikey attempt (→ verify, which answers the \"token required\" 400 on an empty value), while a body with no token key (the console Connect button, `hanzo connector add` with no --token) starts OAuth. Read on STDIN by the CLI, never argv; never logged or echoed. */
|
|
public var token: String?
|
|
|
|
public init(accountId: String? = nil, provider: String? = nil, token: String? = nil) {
|
|
self.accountId = accountId
|
|
self.provider = provider
|
|
self.token = token
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case accountId
|
|
case provider
|
|
case token
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(accountId, forKey: .accountId)
|
|
try container.encodeIfPresent(provider, forKey: .provider)
|
|
try container.encodeIfPresent(token, forKey: .token)
|
|
}
|
|
}
|
|
|