mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
432 lines
23 KiB
Swift
432 lines
23 KiB
Swift
//
|
|
// TelAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class TelAPI {
|
|
|
|
/**
|
|
Ends a call this org placed.
|
|
|
|
- parameter id: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteTelCallsById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteTelCallsByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Ends a call this org placed.
|
|
- DELETE /v1/tel/calls/{id}
|
|
- Ends a call this org placed. The holding is read for THIS org before the carrier is asked, for the reason releaseNumber gives one surface up: an id belonging to another tenant would otherwise be hung up by whoever guessed it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteTelCallsByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/tel/calls/{id}"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Checks the holding is THIS org's before it reaches the carrier.
|
|
|
|
- parameter id: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteTelNumbersById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteTelNumbersByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Checks the holding is THIS org's before it reaches the carrier.
|
|
- DELETE /v1/tel/numbers/{id}
|
|
- Checks the holding is THIS org's before it reaches the carrier. Without that read, an id belonging to another tenant would be released by whoever guessed it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteTelNumbersByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/tel/numbers/{id}"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the calls this org has placed or received, newest first.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: CallList
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getTelCalls(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> CallList {
|
|
return try await getTelCallsWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the calls this org has placed or received, newest first.
|
|
- GET /v1/tel/calls
|
|
- Lists the calls this org has placed or received, newest first. Like the message list beside it, these are our own records rather than the carrier's.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<CallList>
|
|
*/
|
|
open class func getTelCallsWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<CallList> {
|
|
let localVariablePath = "/v1/tel/calls"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<CallList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the messages this org has sent or received, newest first.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: MessageList
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getTelMessages(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> MessageList {
|
|
return try await getTelMessagesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the messages this org has sent or received, newest first.
|
|
- GET /v1/tel/messages
|
|
- Lists the messages this org has sent or received, newest first. Records from our own store, not the carrier's — so it is what this platform did on the org's behalf, which is the set an audit or a bill has to agree with.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<MessageList>
|
|
*/
|
|
open class func getTelMessagesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<MessageList> {
|
|
let localVariablePath = "/v1/tel/messages"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<MessageList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the phone numbers this org HOLDS — the ones it has bought and not released.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: NumberList
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getTelNumbers(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> NumberList {
|
|
return try await getTelNumbersWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the phone numbers this org HOLDS — the ones it has bought and not released.
|
|
- GET /v1/tel/numbers
|
|
- Lists the phone numbers this org HOLDS — the ones it has bought and not released. Distinct from the availability search one path down (`/numbers/available`), which asks the carrier what could be bought: this answers only from our own store, so it is what an org owns rather than what it could own.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<NumberList>
|
|
*/
|
|
open class func getTelNumbersWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<NumberList> {
|
|
let localVariablePath = "/v1/tel/numbers"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<NumberList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Asks the carrier what is available to buy.
|
|
|
|
- parameter country: (query) (optional)
|
|
- parameter area: (query) (optional)
|
|
- parameter type: (query) (optional)
|
|
- parameter limit: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: NumberList
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getTelNumbersAvailable(country: String? = nil, area: String? = nil, type: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> NumberList {
|
|
return try await getTelNumbersAvailableWithRequestBuilder(country: country, area: area, type: type, limit: limit, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Asks the carrier what is available to buy.
|
|
- GET /v1/tel/numbers/available
|
|
- Asks the carrier what is available to buy. Nothing is recorded — a search is not a holding, and treating it as one is how inventory leaks.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter country: (query) (optional)
|
|
- parameter area: (query) (optional)
|
|
- parameter type: (query) (optional)
|
|
- parameter limit: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<NumberList>
|
|
*/
|
|
open class func getTelNumbersAvailableWithRequestBuilder(country: String? = nil, area: String? = nil, type: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<NumberList> {
|
|
let localVariablePath = "/v1/tel/numbers/available"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"Country": (wrappedValue: country?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"Area": (wrappedValue: area?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"Type": (wrappedValue: type?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"Limit": (wrappedValue: limit?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<NumberList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Counts what this org holds on the telephony plane: its numbers, its calls and its messages.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Summary
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getTelSummary(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Summary {
|
|
return try await getTelSummaryWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Counts what this org holds on the telephony plane: its numbers, its calls and its messages.
|
|
- GET /v1/tel/summary
|
|
- Counts what this org holds on the telephony plane: its numbers, its calls and its messages. The one read a dashboard makes before it asks for any list, so it answers three totals and no rows.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Summary>
|
|
*/
|
|
open class func getTelSummaryWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Summary> {
|
|
let localVariablePath = "/v1/tel/summary"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Summary>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Dials.
|
|
|
|
- parameter callInput: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Call
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postTelCalls(callInput: CallInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Call {
|
|
return try await postTelCallsWithRequestBuilder(callInput: callInput, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Dials.
|
|
- POST /v1/tel/calls
|
|
- Dials. An `agent` names a Hanzo assistant to answer it; the call is refused up front when no assistant plane is configured, because a call that connects to silence has already cost the person who answered it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter callInput: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Call>
|
|
*/
|
|
open class func postTelCallsWithRequestBuilder(callInput: CallInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Call> {
|
|
let localVariablePath = "/v1/tel/calls"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: callInput, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Call>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Sends a message from one of this org's own numbers.
|
|
|
|
- parameter messageInput: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: SMS
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postTelMessages(messageInput: MessageInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> SMS {
|
|
return try await postTelMessagesWithRequestBuilder(messageInput: messageInput, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Sends a message from one of this org's own numbers.
|
|
- POST /v1/tel/messages
|
|
- Sends a message from one of this org's own numbers. `from` must be a number the org HOLDS, checked against the store rather than taken on trust — a caller that could send from any number could impersonate one, and the carrier would deliver it. `to` is required, and the body needs text or media, because a message with neither is delivered as nothing and billed as something.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter messageInput: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<SMS>
|
|
*/
|
|
open class func postTelMessagesWithRequestBuilder(messageInput: MessageInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<SMS> {
|
|
let localVariablePath = "/v1/tel/messages"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: messageInput, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<SMS>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Provisions with the carrier FIRST and records second.
|
|
|
|
- parameter buyInput: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Number
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postTelNumbers(buyInput: BuyInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Number {
|
|
return try await postTelNumbersWithRequestBuilder(buyInput: buyInput, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Provisions with the carrier FIRST and records second.
|
|
- POST /v1/tel/numbers
|
|
- Provisions with the carrier FIRST and records second. The other order records a holding that may not exist, and a number the platform believes it owns but cannot use is worse than one it failed to buy.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter buyInput: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Number>
|
|
*/
|
|
open class func postTelNumbersWithRequestBuilder(buyInput: BuyInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Number> {
|
|
let localVariablePath = "/v1/tel/numbers"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: buyInput, codableHelper: apiConfiguration.codableHelper)
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
"Content-Type": "application/json",
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Number>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|