mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection was 113 commits behind the document it claims to describe, and `generate.py --all --check` reported every one of the thirteen clients DRIFTED — the same +19 models in each, because they all fell behind the same emission. Regenerated in place from hanzo-inc/cloud openapi.yaml at 939b09d4 (sha256 087024f6…), which is the only description of this API that cannot name a route the binary does not serve. `--check` is clean across all thirteen after. .spec-lock moved with the code. The generator READS that file and never writes it — hanzoai/ci`s lane does — so a hand run leaves every lock naming the previous document. A lock that disagrees with the tree beside it is worse than no lock: the next `--check` without `--spec` fetches what production serves, compares it to a digest that was already wrong, and reports drift that is really staleness.
1485 lines
94 KiB
Swift
1485 lines
94 KiB
Swift
//
|
|
// CloudflareAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class CloudflareAPI {
|
|
|
|
/**
|
|
Deletes a D1 database and everything stored in it.
|
|
|
|
- parameter database: (path) Database is the Cloudflare D1 database id or name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCloudflareD1DatabasesByDatabase(database: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await deleteCloudflareD1DatabasesByDatabaseWithRequestBuilder(database: database, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Deletes a D1 database and everything stored in it.
|
|
- DELETE /v1/cloudflare/d1/databases/{database}
|
|
- Deletes a D1 database and everything stored in it. Requires org admin.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter database: (path) Database is the Cloudflare D1 database id or name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func deleteCloudflareD1DatabasesByDatabaseWithRequestBuilder(database: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/d1/databases/{database}"
|
|
let databasePreEscape = "\(APIHelper.mapValueToPathItem(database))"
|
|
let databasePostEscape = databasePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{database}", with: databasePostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
KVNamespaceDelete deletes a Workers KV namespace and every key in it.
|
|
|
|
- parameter namespace: (path) Namespace is the Cloudflare KV namespace id.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCloudflareKvNamespacesByNamespace(namespace: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await deleteCloudflareKvNamespacesByNamespaceWithRequestBuilder(namespace: namespace, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
KVNamespaceDelete deletes a Workers KV namespace and every key in it.
|
|
- DELETE /v1/cloudflare/kv/namespaces/{namespace}
|
|
- KVNamespaceDelete deletes a Workers KV namespace and every key in it. Requires org admin.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter namespace: (path) Namespace is the Cloudflare KV namespace id.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func deleteCloudflareKvNamespacesByNamespaceWithRequestBuilder(namespace: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/kv/namespaces/{namespace}"
|
|
let namespacePreEscape = "\(APIHelper.mapValueToPathItem(namespace))"
|
|
let namespacePostEscape = namespacePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{namespace}", with: namespacePostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
KVValueDelete removes one key from a Workers KV namespace.
|
|
|
|
- parameter namespace: (path) Namespace is the Cloudflare KV namespace id.
|
|
- parameter key: (path) Key is the key within that namespace. KV keys are broad (up to 512 bytes), so this one is escaped rather than charset-restricted.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCloudflareKvNamespacesByNamespaceValuesByKey(namespace: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await deleteCloudflareKvNamespacesByNamespaceValuesByKeyWithRequestBuilder(namespace: namespace, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
KVValueDelete removes one key from a Workers KV namespace.
|
|
- DELETE /v1/cloudflare/kv/namespaces/{namespace}/values/{key}
|
|
- KVValueDelete removes one key from a Workers KV namespace. Requires org admin.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter namespace: (path) Namespace is the Cloudflare KV namespace id.
|
|
- parameter key: (path) Key is the key within that namespace. KV keys are broad (up to 512 bytes), so this one is escaped rather than charset-restricted.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func deleteCloudflareKvNamespacesByNamespaceValuesByKeyWithRequestBuilder(namespace: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/kv/namespaces/{namespace}/values/{key}"
|
|
let namespacePreEscape = "\(APIHelper.mapValueToPathItem(namespace))"
|
|
let namespacePostEscape = namespacePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{namespace}", with: namespacePostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Deletes a Cloudflare Pages project, and with it every deployment it has ever made.
|
|
|
|
- parameter project: (path) Project is the Pages project name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCloudflarePagesProjectsByProject(project: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await deleteCloudflarePagesProjectsByProjectWithRequestBuilder(project: project, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Deletes a Cloudflare Pages project, and with it every deployment it has ever made.
|
|
- DELETE /v1/cloudflare/pages/projects/{project}
|
|
- Deletes a Cloudflare Pages project, and with it every deployment it has ever made. Requires org admin.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter project: (path) Project is the Pages project name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func deleteCloudflarePagesProjectsByProjectWithRequestBuilder(project: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/pages/projects/{project}"
|
|
let projectPreEscape = "\(APIHelper.mapValueToPathItem(project))"
|
|
let projectPostEscape = projectPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{project}", with: projectPostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Detaches a custom domain from a Cloudflare Pages project.
|
|
|
|
- parameter project: (path) Project is the Pages project name.
|
|
- parameter domain: (path) Domain is the attached custom domain to detach.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCloudflarePagesProjectsByProjectDomainsByDomain(project: String, domain: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await deleteCloudflarePagesProjectsByProjectDomainsByDomainWithRequestBuilder(project: project, domain: domain, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Detaches a custom domain from a Cloudflare Pages project.
|
|
- DELETE /v1/cloudflare/pages/projects/{project}/domains/{domain}
|
|
- Detaches a custom domain from a Cloudflare Pages project. Requires org admin.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter project: (path) Project is the Pages project name.
|
|
- parameter domain: (path) Domain is the attached custom domain to detach.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func deleteCloudflarePagesProjectsByProjectDomainsByDomainWithRequestBuilder(project: String, domain: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/pages/projects/{project}/domains/{domain}"
|
|
let projectPreEscape = "\(APIHelper.mapValueToPathItem(project))"
|
|
let projectPostEscape = projectPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{project}", with: projectPostEscape, options: .literal, range: nil)
|
|
let domainPreEscape = "\(APIHelper.mapValueToPathItem(domain))"
|
|
let domainPostEscape = domainPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{domain}", with: domainPostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Deletes an R2 bucket.
|
|
|
|
- parameter bucket: (path) Bucket is the R2 bucket name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCloudflareR2BucketsByBucket(bucket: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await deleteCloudflareR2BucketsByBucketWithRequestBuilder(bucket: bucket, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Deletes an R2 bucket.
|
|
- DELETE /v1/cloudflare/r2/buckets/{bucket}
|
|
- Deletes an R2 bucket. Requires org admin. Cloudflare refuses a bucket that still holds objects, and that refusal is relayed.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter bucket: (path) Bucket is the R2 bucket name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func deleteCloudflareR2BucketsByBucketWithRequestBuilder(bucket: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/r2/buckets/{bucket}"
|
|
let bucketPreEscape = "\(APIHelper.mapValueToPathItem(bucket))"
|
|
let bucketPostEscape = bucketPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{bucket}", with: bucketPostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Removes a Worker script from the org's Cloudflare account.
|
|
|
|
- parameter script: (path) Script is the Worker script name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCloudflareWorkersScriptsByScript(script: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await deleteCloudflareWorkersScriptsByScriptWithRequestBuilder(script: script, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Removes a Worker script from the org's Cloudflare account.
|
|
- DELETE /v1/cloudflare/workers/scripts/{script}
|
|
- Removes a Worker script from the org's Cloudflare account. Requires org admin. Routes bound to the script stop serving it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter script: (path) Script is the Worker script name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func deleteCloudflareWorkersScriptsByScriptWithRequestBuilder(script: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/workers/scripts/{script}"
|
|
let scriptPreEscape = "\(APIHelper.mapValueToPathItem(script))"
|
|
let scriptPostEscape = scriptPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{script}", with: scriptPostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Unbinds a Worker route, so its pattern stops dispatching to a script.
|
|
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id.
|
|
- parameter route: (path) Route is the 32-hex Cloudflare route id.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteCloudflareWorkersZonesByZoneRoutesByRoute(zone: String, route: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await deleteCloudflareWorkersZonesByZoneRoutesByRouteWithRequestBuilder(zone: zone, route: route, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Unbinds a Worker route, so its pattern stops dispatching to a script.
|
|
- DELETE /v1/cloudflare/workers/zones/{zone}/routes/{route}
|
|
- Unbinds a Worker route, so its pattern stops dispatching to a script. Requires org admin.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id.
|
|
- parameter route: (path) Route is the 32-hex Cloudflare route id.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func deleteCloudflareWorkersZonesByZoneRoutesByRouteWithRequestBuilder(zone: String, route: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/workers/zones/{zone}/routes/{route}"
|
|
let zonePreEscape = "\(APIHelper.mapValueToPathItem(zone))"
|
|
let zonePostEscape = zonePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{zone}", with: zonePostEscape, options: .literal, range: nil)
|
|
let routePreEscape = "\(APIHelper.mapValueToPathItem(route))"
|
|
let routePostEscape = routePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{route}", with: routePostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the D1 databases on the org's Cloudflare account.
|
|
|
|
- parameter page: (query) Page is the 1-based page of databases to return. (optional)
|
|
- parameter perPage: (query) PerPage is how many databases one page holds. (optional)
|
|
- parameter name: (query) Name filters to the database with this name. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflareD1Databases(page: String? = nil, perPage: String? = nil, name: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflareD1DatabasesWithRequestBuilder(page: page, perPage: perPage, name: name, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the D1 databases on the org's Cloudflare account.
|
|
- GET /v1/cloudflare/d1/databases
|
|
- Lists the D1 databases on the org's Cloudflare account. Any org member may read.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter page: (query) Page is the 1-based page of databases to return. (optional)
|
|
- parameter perPage: (query) PerPage is how many databases one page holds. (optional)
|
|
- parameter name: (query) Name filters to the database with this name. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflareD1DatabasesWithRequestBuilder(page: String? = nil, perPage: String? = nil, name: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/d1/databases"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"page": (wrappedValue: page?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"per_page": (wrappedValue: perPage?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"name": (wrappedValue: name?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
KVNamespaceList lists the Workers KV namespaces on the org's Cloudflare account.
|
|
|
|
- parameter page: (query) Page is the 1-based page of namespaces to return. (optional)
|
|
- parameter perPage: (query) PerPage is how many namespaces one page holds. (optional)
|
|
- parameter order: (query) Order names the field to sort by, and Direction sorts asc or desc. (optional)
|
|
- parameter direction: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflareKvNamespaces(page: String? = nil, perPage: String? = nil, order: String? = nil, direction: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflareKvNamespacesWithRequestBuilder(page: page, perPage: perPage, order: order, direction: direction, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
KVNamespaceList lists the Workers KV namespaces on the org's Cloudflare account.
|
|
- GET /v1/cloudflare/kv/namespaces
|
|
- KVNamespaceList lists the Workers KV namespaces on the org's Cloudflare account. Any org member may read.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter page: (query) Page is the 1-based page of namespaces to return. (optional)
|
|
- parameter perPage: (query) PerPage is how many namespaces one page holds. (optional)
|
|
- parameter order: (query) Order names the field to sort by, and Direction sorts asc or desc. (optional)
|
|
- parameter direction: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflareKvNamespacesWithRequestBuilder(page: String? = nil, perPage: String? = nil, order: String? = nil, direction: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/kv/namespaces"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"page": (wrappedValue: page?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"per_page": (wrappedValue: perPage?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"order": (wrappedValue: order?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"direction": (wrappedValue: direction?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Read a Workers KV value as its stored bytes
|
|
|
|
- parameter namespace: (path)
|
|
- parameter key: (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 getCloudflareKvNamespacesByNamespaceValuesByKey(namespace: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await getCloudflareKvNamespacesByNamespaceValuesByKeyWithRequestBuilder(namespace: namespace, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Read a Workers KV value as its stored bytes
|
|
- GET /v1/cloudflare/kv/namespaces/{namespace}/values/{key}
|
|
- Answers one KV key's value from the org's OWN Cloudflare account as RAW BYTES under the content type it was written with — not wrapped in a JSON envelope, which is why this is not a typed op. Any org member may read. A key that does not exist is Cloudflare's own 404; an invalid namespace, or a key that is empty, over 512 bytes, not valid UTF-8, or carries a control character, is 400; 503 if the org has never connected a Cloudflare token.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter namespace: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func getCloudflareKvNamespacesByNamespaceValuesByKeyWithRequestBuilder(namespace: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/cloudflare/kv/namespaces/{namespace}/values/{key}"
|
|
let namespacePreEscape = "\(APIHelper.mapValueToPathItem(namespace))"
|
|
let namespacePostEscape = namespacePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{namespace}", with: namespacePostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, 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: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the org's Cloudflare Pages projects.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflarePagesProjects(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflarePagesProjectsWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the org's Cloudflare Pages projects.
|
|
- GET /v1/cloudflare/pages/projects
|
|
- Lists the org's Cloudflare Pages projects. Any org member may read.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflarePagesProjectsWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/pages/projects"
|
|
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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Reads one Cloudflare Pages project — its build config, deployment configs and latest deployment.
|
|
|
|
- parameter project: (path) Project is the Pages project name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflarePagesProjectsByProject(project: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflarePagesProjectsByProjectWithRequestBuilder(project: project, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Reads one Cloudflare Pages project — its build config, deployment configs and latest deployment.
|
|
- GET /v1/cloudflare/pages/projects/{project}
|
|
- Reads one Cloudflare Pages project — its build config, deployment configs and latest deployment. Any org member may read.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter project: (path) Project is the Pages project name.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflarePagesProjectsByProjectWithRequestBuilder(project: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/pages/projects/{project}"
|
|
let projectPreEscape = "\(APIHelper.mapValueToPathItem(project))"
|
|
let projectPostEscape = projectPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{project}", with: projectPostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the R2 buckets on the org's Cloudflare account.
|
|
|
|
- parameter perPage: (query) PerPage is how many buckets one page holds. (optional)
|
|
- parameter cursor: (query) Cursor continues from the position a previous page returned. (optional)
|
|
- parameter nameContains: (query) NameContains filters to buckets whose name contains this substring. (optional)
|
|
- parameter order: (query) Order names the field to sort by, and Direction sorts asc or desc. (optional)
|
|
- parameter direction: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflareR2Buckets(perPage: String? = nil, cursor: String? = nil, nameContains: String? = nil, order: String? = nil, direction: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflareR2BucketsWithRequestBuilder(perPage: perPage, cursor: cursor, nameContains: nameContains, order: order, direction: direction, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the R2 buckets on the org's Cloudflare account.
|
|
- GET /v1/cloudflare/r2/buckets
|
|
- Lists the R2 buckets on the org's Cloudflare account. Any org member may read.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter perPage: (query) PerPage is how many buckets one page holds. (optional)
|
|
- parameter cursor: (query) Cursor continues from the position a previous page returned. (optional)
|
|
- parameter nameContains: (query) NameContains filters to buckets whose name contains this substring. (optional)
|
|
- parameter order: (query) Order names the field to sort by, and Direction sorts asc or desc. (optional)
|
|
- parameter direction: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflareR2BucketsWithRequestBuilder(perPage: String? = nil, cursor: String? = nil, nameContains: String? = nil, order: String? = nil, direction: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/r2/buckets"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"per_page": (wrappedValue: perPage?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"cursor": (wrappedValue: cursor?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"name_contains": (wrappedValue: nameContains?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"order": (wrappedValue: order?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"direction": (wrappedValue: direction?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the Worker scripts on the org's Cloudflare account.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflareWorkersScripts(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflareWorkersScriptsWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the Worker scripts on the org's Cloudflare account.
|
|
- GET /v1/cloudflare/workers/scripts
|
|
- Lists the Worker scripts on the org's Cloudflare account. Any org member may read.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflareWorkersScriptsWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/workers/scripts"
|
|
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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Reads the org account's workers.dev subdomain — the name under which every subdomain-enabled script is served.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflareWorkersSubdomain(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflareWorkersSubdomainWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Reads the org account's workers.dev subdomain — the name under which every subdomain-enabled script is served.
|
|
- GET /v1/cloudflare/workers/subdomain
|
|
- Reads the org account's workers.dev subdomain — the name under which every subdomain-enabled script is served. Any org member may read.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflareWorkersSubdomainWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/workers/subdomain"
|
|
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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the Worker routes bound within one zone — the URL patterns that dispatch to a script.
|
|
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflareWorkersZonesByZoneRoutes(zone: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflareWorkersZonesByZoneRoutesWithRequestBuilder(zone: zone, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the Worker routes bound within one zone — the URL patterns that dispatch to a script.
|
|
- GET /v1/cloudflare/workers/zones/{zone}/routes
|
|
- Lists the Worker routes bound within one zone — the URL patterns that dispatch to a script. Any org member may read. Routes are zone-scoped, so no account is resolved.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflareWorkersZonesByZoneRoutesWithRequestBuilder(zone: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/workers/zones/{zone}/routes"
|
|
let zonePreEscape = "\(APIHelper.mapValueToPathItem(zone))"
|
|
let zonePostEscape = zonePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{zone}", with: zonePostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Lists the Cloudflare zones the org's connected API token can see, paged and filtered by the query parameters Cloudflare itself accepts.
|
|
|
|
- parameter page: (query) Page is the 1-based page of zones to return. (optional)
|
|
- parameter perPage: (query) PerPage is how many zones one page holds. (optional)
|
|
- parameter name: (query) Name filters to the zone with this domain name. (optional)
|
|
- parameter status: (query) Status filters by zone status (active, pending, initializing, …). (optional)
|
|
- parameter order: (query) Order names the field to sort by, and Direction sorts asc or desc. (optional)
|
|
- parameter direction: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflareZones(page: String? = nil, perPage: String? = nil, name: String? = nil, status: String? = nil, order: String? = nil, direction: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflareZonesWithRequestBuilder(page: page, perPage: perPage, name: name, status: status, order: order, direction: direction, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Lists the Cloudflare zones the org's connected API token can see, paged and filtered by the query parameters Cloudflare itself accepts.
|
|
- GET /v1/cloudflare/zones
|
|
- Lists the Cloudflare zones the org's connected API token can see, paged and filtered by the query parameters Cloudflare itself accepts. Zones are token-scoped by Cloudflare, so no account is resolved. Any org member may read. Zone and DNS-record MANAGEMENT is not here: it stays on the Hanzo DNS plane (/v1/dns). This only surfaces the Cloudflare zone objects the asset plane needs — a zone id is what addresses a Worker route or an analytics read.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter page: (query) Page is the 1-based page of zones to return. (optional)
|
|
- parameter perPage: (query) PerPage is how many zones one page holds. (optional)
|
|
- parameter name: (query) Name filters to the zone with this domain name. (optional)
|
|
- parameter status: (query) Status filters by zone status (active, pending, initializing, …). (optional)
|
|
- parameter order: (query) Order names the field to sort by, and Direction sorts asc or desc. (optional)
|
|
- parameter direction: (query) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflareZonesWithRequestBuilder(page: String? = nil, perPage: String? = nil, name: String? = nil, status: String? = nil, order: String? = nil, direction: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/zones"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"page": (wrappedValue: page?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"per_page": (wrappedValue: perPage?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"name": (wrappedValue: name?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"status": (wrappedValue: status?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"order": (wrappedValue: order?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"direction": (wrappedValue: direction?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Reads one Cloudflare zone the org's token can see.
|
|
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflareZonesByZone(zone: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflareZonesByZoneWithRequestBuilder(zone: zone, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Reads one Cloudflare zone the org's token can see.
|
|
- GET /v1/cloudflare/zones/{zone}
|
|
- Reads one Cloudflare zone the org's token can see. Any org member may read. A zone id the token cannot see is Cloudflare's own not-found, relayed.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflareZonesByZoneWithRequestBuilder(zone: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/zones/{zone}"
|
|
let zonePreEscape = "\(APIHelper.mapValueToPathItem(zone))"
|
|
let zonePostEscape = zonePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{zone}", with: zonePostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Reads a zone's Cloudflare traffic dashboard — requests, bandwidth, threats and pageviews over the since/until window.
|
|
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id.
|
|
- parameter since: (query) Since and Until bound the window, in the form Cloudflare accepts — an RFC 3339 time or a negative number of minutes from now (\"-1440\" is the last day). (optional)
|
|
- parameter until: (query) (optional)
|
|
- parameter continuous: (query) Continuous asks Cloudflare for only fully-aggregated buckets. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getCloudflareZonesByZoneAnalytics(zone: String, since: String? = nil, until: String? = nil, continuous: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getCloudflareZonesByZoneAnalyticsWithRequestBuilder(zone: zone, since: since, until: until, continuous: continuous, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Reads a zone's Cloudflare traffic dashboard — requests, bandwidth, threats and pageviews over the since/until window.
|
|
- GET /v1/cloudflare/zones/{zone}/analytics
|
|
- Reads a zone's Cloudflare traffic dashboard — requests, bandwidth, threats and pageviews over the since/until window. Any org member may read. A zone whose Cloudflare plan does not serve this endpoint yields Cloudflare's OWN error, never a fabricated success.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id.
|
|
- parameter since: (query) Since and Until bound the window, in the form Cloudflare accepts — an RFC 3339 time or a negative number of minutes from now (\"-1440\" is the last day). (optional)
|
|
- parameter until: (query) (optional)
|
|
- parameter continuous: (query) Continuous asks Cloudflare for only fully-aggregated buckets. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getCloudflareZonesByZoneAnalyticsWithRequestBuilder(zone: String, since: String? = nil, until: String? = nil, continuous: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/zones/{zone}/analytics"
|
|
let zonePreEscape = "\(APIHelper.mapValueToPathItem(zone))"
|
|
let zonePostEscape = zonePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{zone}", with: zonePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"since": (wrappedValue: since?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"until": (wrappedValue: until?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"continuous": (wrappedValue: continuous?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Creates a D1 database on the org's Cloudflare account.
|
|
|
|
- parameter databaseCreateIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflareD1Databases(databaseCreateIn: DatabaseCreateIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflareD1DatabasesWithRequestBuilder(databaseCreateIn: databaseCreateIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Creates a D1 database on the org's Cloudflare account.
|
|
- POST /v1/cloudflare/d1/databases
|
|
- Creates a D1 database on the org's Cloudflare account. Requires org admin.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter databaseCreateIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflareD1DatabasesWithRequestBuilder(databaseCreateIn: DatabaseCreateIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/d1/databases"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: databaseCreateIn, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Runs one SQL statement against a D1 database.
|
|
|
|
- parameter database: (path)
|
|
- parameter d1Query: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflareD1DatabasesByDatabaseQuery(database: String, d1Query: D1Query, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflareD1DatabasesByDatabaseQueryWithRequestBuilder(database: database, d1Query: d1Query, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Runs one SQL statement against a D1 database.
|
|
- POST /v1/cloudflare/d1/databases/{database}/query
|
|
- Runs one SQL statement against a D1 database. It executes on the org's OWN Cloudflare account and relays D1's result set. The body is checked for a non-empty `sql` and then forwarded VERBATIM, so every field D1 accepts reaches D1 even though only two are named here. Requires ORG ADMIN — a statement may INSERT, UPDATE or DROP, so a query takes the write gate rather than the read one — and a caller who is only an org member is refused 403. A missing `sql` is 400; 503 if the org has never connected a Cloudflare token.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter database: (path)
|
|
- parameter d1Query: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflareD1DatabasesByDatabaseQueryWithRequestBuilder(database: String, d1Query: D1Query, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/d1/databases/{database}/query"
|
|
let databasePreEscape = "\(APIHelper.mapValueToPathItem(database))"
|
|
let databasePostEscape = databasePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{database}", with: databasePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: d1Query, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
KVNamespaceCreate creates a Workers KV namespace on the org's Cloudflare account.
|
|
|
|
- parameter namespaceCreateIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflareKvNamespaces(namespaceCreateIn: NamespaceCreateIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflareKvNamespacesWithRequestBuilder(namespaceCreateIn: namespaceCreateIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
KVNamespaceCreate creates a Workers KV namespace on the org's Cloudflare account.
|
|
- POST /v1/cloudflare/kv/namespaces
|
|
- KVNamespaceCreate creates a Workers KV namespace on the org's Cloudflare account. Requires org admin. Cloudflare mints the namespace id the value routes address.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter namespaceCreateIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflareKvNamespacesWithRequestBuilder(namespaceCreateIn: NamespaceCreateIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/kv/namespaces"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: namespaceCreateIn, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Creates a Cloudflare Pages project on the org's account.
|
|
|
|
- parameter pagesProjectCreate: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflarePagesProjects(pagesProjectCreate: PagesProjectCreate, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflarePagesProjectsWithRequestBuilder(pagesProjectCreate: pagesProjectCreate, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Creates a Cloudflare Pages project on the org's account.
|
|
- POST /v1/cloudflare/pages/projects
|
|
- Creates a Cloudflare Pages project on the org's account. Requires org admin. Only the modeled fields reach Cloudflare, so an unmodeled key in the request is dropped rather than forwarded.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter pagesProjectCreate: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflarePagesProjectsWithRequestBuilder(pagesProjectCreate: PagesProjectCreate, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/pages/projects"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pagesProjectCreate, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Trigger a new Pages deployment for a project
|
|
|
|
- parameter project: (path)
|
|
- parameter pagesDeploy: (body) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflarePagesProjectsByProjectDeployments(project: String, pagesDeploy: PagesDeploy? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflarePagesProjectsByProjectDeploymentsWithRequestBuilder(project: project, pagesDeploy: pagesDeploy, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Trigger a new Pages deployment for a project
|
|
- POST /v1/cloudflare/pages/projects/{project}/deployments
|
|
- Starts a build and deployment of one Cloudflare Pages project on the org's OWN Cloudflare account, and relays Cloudflare's deployment record back. `branch` picks what to build; OMITTING it builds the project's production branch. A body it cannot parse is IGNORED rather than refused — the deployment falls back to the production branch — which is the one rule to get right here and the reason this is not a typed op: a typed request would answer 400 where this deploys. Requires ORG ADMIN (403 otherwise), and 503 if the org has never connected a Cloudflare token.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter project: (path)
|
|
- parameter pagesDeploy: (body) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflarePagesProjectsByProjectDeploymentsWithRequestBuilder(project: String, pagesDeploy: PagesDeploy? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/pages/projects/{project}/deployments"
|
|
let projectPreEscape = "\(APIHelper.mapValueToPathItem(project))"
|
|
let projectPostEscape = projectPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{project}", with: projectPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pagesDeploy, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Attaches a custom domain to a Cloudflare Pages project.
|
|
|
|
- parameter project: (path) Project is the Pages project name, from the path.
|
|
- parameter domainAddIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflarePagesProjectsByProjectDomains(project: String, domainAddIn: DomainAddIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflarePagesProjectsByProjectDomainsWithRequestBuilder(project: project, domainAddIn: domainAddIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Attaches a custom domain to a Cloudflare Pages project.
|
|
- POST /v1/cloudflare/pages/projects/{project}/domains
|
|
- Attaches a custom domain to a Cloudflare Pages project. Requires org admin. Cloudflare owns validation and certificate issuance from here on.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter project: (path) Project is the Pages project name, from the path.
|
|
- parameter domainAddIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflarePagesProjectsByProjectDomainsWithRequestBuilder(project: String, domainAddIn: DomainAddIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/pages/projects/{project}/domains"
|
|
let projectPreEscape = "\(APIHelper.mapValueToPathItem(project))"
|
|
let projectPostEscape = projectPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{project}", with: projectPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: domainAddIn, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Creates an R2 bucket on the org's Cloudflare account.
|
|
|
|
- parameter bucketCreateIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflareR2Buckets(bucketCreateIn: BucketCreateIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflareR2BucketsWithRequestBuilder(bucketCreateIn: bucketCreateIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Creates an R2 bucket on the org's Cloudflare account.
|
|
- POST /v1/cloudflare/r2/buckets
|
|
- Creates an R2 bucket on the org's Cloudflare account. Requires org admin.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter bucketCreateIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflareR2BucketsWithRequestBuilder(bucketCreateIn: BucketCreateIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/cloudflare/r2/buckets"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: bucketCreateIn, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Publishes or withdraws one Worker script on the account's workers.dev subdomain.
|
|
|
|
- parameter script: (path) Script is the Worker script name, from the path.
|
|
- parameter subdomainSetIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflareWorkersScriptsByScriptSubdomain(script: String, subdomainSetIn: SubdomainSetIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflareWorkersScriptsByScriptSubdomainWithRequestBuilder(script: script, subdomainSetIn: subdomainSetIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Publishes or withdraws one Worker script on the account's workers.dev subdomain.
|
|
- POST /v1/cloudflare/workers/scripts/{script}/subdomain
|
|
- Publishes or withdraws one Worker script on the account's workers.dev subdomain. Requires org admin.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter script: (path) Script is the Worker script name, from the path.
|
|
- parameter subdomainSetIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflareWorkersScriptsByScriptSubdomainWithRequestBuilder(script: String, subdomainSetIn: SubdomainSetIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/workers/scripts/{script}/subdomain"
|
|
let scriptPreEscape = "\(APIHelper.mapValueToPathItem(script))"
|
|
let scriptPostEscape = scriptPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{script}", with: scriptPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: subdomainSetIn, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Binds a URL pattern in a zone to a Worker script.
|
|
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id, from the path.
|
|
- parameter routeCreateIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflareWorkersZonesByZoneRoutes(zone: String, routeCreateIn: RouteCreateIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflareWorkersZonesByZoneRoutesWithRequestBuilder(zone: zone, routeCreateIn: routeCreateIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Binds a URL pattern in a zone to a Worker script.
|
|
- POST /v1/cloudflare/workers/zones/{zone}/routes
|
|
- Binds a URL pattern in a zone to a Worker script. Requires org admin — a route is what puts a script in front of live traffic.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id, from the path.
|
|
- parameter routeCreateIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflareWorkersZonesByZoneRoutesWithRequestBuilder(zone: String, routeCreateIn: RouteCreateIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/workers/zones/{zone}/routes"
|
|
let zonePreEscape = "\(APIHelper.mapValueToPathItem(zone))"
|
|
let zonePostEscape = zonePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{zone}", with: zonePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: routeCreateIn, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Drops a zone's Cloudflare edge cache — either the whole zone (purge_everything) or exactly the listed file URLs.
|
|
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id, from the path.
|
|
- parameter purgeIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postCloudflareZonesByZonePurge(zone: String, purgeIn: PurgeIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postCloudflareZonesByZonePurgeWithRequestBuilder(zone: zone, purgeIn: purgeIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Drops a zone's Cloudflare edge cache — either the whole zone (purge_everything) or exactly the listed file URLs.
|
|
- POST /v1/cloudflare/zones/{zone}/purge
|
|
- Drops a zone's Cloudflare edge cache — either the whole zone (purge_everything) or exactly the listed file URLs. Requires org admin. Purging is the one zone-scoped WRITE this plane owns. It is not DNS — no record changes — so it does not belong on /v1/dns, and it is not a connection, so it does not belong on the integrations plane. It is a cache operation on a zone, which is what this asset plane is for. It takes the admin gate because dropping a zone's cache sends every subsequent request to the origin: on a site fronting a small origin that is a self-inflicted load spike, so it is a change, not a look. Exactly one selector is required. Cloudflare treats a body with neither as a no-op and answers 200, which reads as \"purged\" to a caller that never purged anything — the failure we refuse to pass through.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter zone: (path) Zone is the 32-hex Cloudflare zone id, from the path.
|
|
- parameter purgeIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postCloudflareZonesByZonePurgeWithRequestBuilder(zone: String, purgeIn: PurgeIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/zones/{zone}/purge"
|
|
let zonePreEscape = "\(APIHelper.mapValueToPathItem(zone))"
|
|
let zonePostEscape = zonePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{zone}", with: zonePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: purgeIn, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Write a Workers KV value from the request body
|
|
|
|
- parameter namespace: (path)
|
|
- parameter key: (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 putCloudflareKvNamespacesByNamespaceValuesByKey(namespace: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putCloudflareKvNamespacesByNamespaceValuesByKeyWithRequestBuilder(namespace: namespace, key: key, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Write a Workers KV value from the request body
|
|
- PUT /v1/cloudflare/kv/namespaces/{namespace}/values/{key}
|
|
- Stores one KV key on the org's OWN Cloudflare account. The REQUEST BODY IS THE VALUE, forwarded verbatim under the caller's own Content-Type (`text/plain` when none is sent), so a value is never re-encoded on the way in — which is why this is not a typed op. `expiration` and `expiration_ttl` may ride the query string and are passed through to Cloudflare. Requires ORG ADMIN (403 otherwise); the same namespace and key validation as the read answers 400; 503 if the org has never connected a Cloudflare token.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter namespace: (path)
|
|
- parameter key: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putCloudflareKvNamespacesByNamespaceValuesByKeyWithRequestBuilder(namespace: String, key: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/cloudflare/kv/namespaces/{namespace}/values/{key}"
|
|
let namespacePreEscape = "\(APIHelper.mapValueToPathItem(namespace))"
|
|
let namespacePostEscape = namespacePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{namespace}", with: namespacePostEscape, options: .literal, range: nil)
|
|
let keyPreEscape = "\(APIHelper.mapValueToPathItem(key))"
|
|
let keyPostEscape = keyPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{key}", with: keyPostEscape, 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: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Uploads or replaces a module Worker script.
|
|
|
|
- parameter script: (path) Script means two things on this route, and the document says so in both places it appears: the PATH segment names the Worker to publish, and the BODY field carries that Worker's ES-module source — the code itself, never a name or a URL. A blank or absent source is refused; there is no empty Worker.
|
|
- parameter workerScriptPut: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putCloudflareWorkersScriptsByScript(script: String, workerScriptPut: WorkerScriptPut, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await putCloudflareWorkersScriptsByScriptWithRequestBuilder(script: script, workerScriptPut: workerScriptPut, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Uploads or replaces a module Worker script.
|
|
- PUT /v1/cloudflare/workers/scripts/{script}
|
|
- Uploads or replaces a module Worker script. It publishes to the org's OWN Cloudflare account under the name in the path, replacing whatever was there, and relays Cloudflare's result. The compatibility date, compatibility flags and bindings are packed into the multipart upload Cloudflare expects, beside the module source. Requires ORG ADMIN — a Worker is arbitrary code on the org's own account and domains — so a caller who is only an org member is refused 403. An empty source is 400, as is a `mainModule` that is not a plain file name; 503 if the org has never connected a Cloudflare token.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter script: (path) Script means two things on this route, and the document says so in both places it appears: the PATH segment names the Worker to publish, and the BODY field carries that Worker's ES-module source — the code itself, never a name or a URL. A blank or absent source is refused; there is no empty Worker.
|
|
- parameter workerScriptPut: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func putCloudflareWorkersScriptsByScriptWithRequestBuilder(script: String, workerScriptPut: WorkerScriptPut, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/cloudflare/workers/scripts/{script}"
|
|
let scriptPreEscape = "\(APIHelper.mapValueToPathItem(script))"
|
|
let scriptPostEscape = scriptPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{script}", with: scriptPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: workerScriptPut, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|