mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The lock sat at 574d1f1d while the product moved on. The team surface stopped at rooms — no messages path, no way to open one — so anything built on this client had to reach past it with its own HTTP calls, which is the duplication a generated client exists to prevent.
739 lines
51 KiB
Swift
739 lines
51 KiB
Swift
//
|
|
// FrameworkAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class FrameworkAPI {
|
|
|
|
/**
|
|
Removes one document, after its on_trash hooks agree.
|
|
|
|
- parameter doctype: (path) DocType is the document's DocType, by ADDRESS — \"module.name\", from the path.
|
|
- parameter name: (path) Name is the document's name — its key within the DocType — from the path. A name containing a space arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- 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 deleteFrameworkByDoctypeByName(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteFrameworkByDoctypeByNameWithRequestBuilder(doctype: doctype, name: name, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Removes one document, after its on_trash hooks agree.
|
|
- DELETE /v1/framework/{doctype}/{name}
|
|
- Removes one document, after its on_trash hooks agree. A SUBMITTED document cannot be deleted — cancel it first. Answers 204.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter doctype: (path) DocType is the document's DocType, by ADDRESS — \"module.name\", from the path.
|
|
- parameter name: (path) Name is the document's name — its key within the DocType — from the path. A name containing a space arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteFrameworkByDoctypeByNameWithRequestBuilder(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/framework/{doctype}/{name}"
|
|
let doctypePreEscape = "\(APIHelper.mapValueToPathItem(doctype))"
|
|
let doctypePostEscape = doctypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{doctype}", with: doctypePostEscape, options: .literal, range: nil)
|
|
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
|
|
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Removes a DocType and every document stored under it.
|
|
|
|
- parameter name: (path) Name is the DocType's ADDRESS — \"module.name\", e.g. \"kb.page\". A name containing a space (\"erp.Sales Invoice\") arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- 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 deleteFrameworkDoctypesByName(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await deleteFrameworkDoctypesByNameWithRequestBuilder(name: name, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Removes a DocType and every document stored under it.
|
|
- DELETE /v1/framework/doctypes/{name}
|
|
- Removes a DocType and every document stored under it. The definition and its data go together — a document with no schema can be neither validated nor read back — so there is no undo. Manager-only. Answers 204.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter name: (path) Name is the DocType's ADDRESS — \"module.name\", e.g. \"kb.page\". A name containing a space (\"erp.Sales Invoice\") arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func deleteFrameworkDoctypesByNameWithRequestBuilder(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/framework/doctypes/{name}"
|
|
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
|
|
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns the caller org's documents of one DocType, filtered, ordered and projected by the query.
|
|
|
|
- parameter doctype: (path) DocType is the DocType to list, by ADDRESS — \"module.name\", from the path.
|
|
- parameter filters: (query) Filters is a JSON object of equality matches, e.g. {\"priority\":\"High\"}. Every key must be a field the DocType declares (or the managed name / docstatus); an undeclared one is refused rather than silently ignored. (optional)
|
|
- parameter fields: (query) Fields projects the response to a subset — a JSON array [\"a\",\"b\"] or a comma list \"a,b\". The envelope keys are always returned. (optional)
|
|
- parameter orderBy: (query) OrderBy is \"<field> [asc|desc]\". Empty means most-recently-updated first. (optional)
|
|
- parameter limit: (query) Limit caps the rows returned. Anything that is not a positive integer leaves the engine's default in place. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: DocumentList
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFrameworkByDoctype(doctype: String, filters: String? = nil, fields: String? = nil, orderBy: String? = nil, limit: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> DocumentList {
|
|
return try await getFrameworkByDoctypeWithRequestBuilder(doctype: doctype, filters: filters, fields: fields, orderBy: orderBy, limit: limit, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns the caller org's documents of one DocType, filtered, ordered and projected by the query.
|
|
- GET /v1/framework/{doctype}
|
|
- Returns the caller org's documents of one DocType, filtered, ordered and projected by the query. The DocType is resolved FIRST — through the same permission gate the list itself uses — because the query is validated against its schema: a filter, sort or field name the DocType does not declare is refused rather than reaching the store.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter doctype: (path) DocType is the DocType to list, by ADDRESS — \"module.name\", from the path.
|
|
- parameter filters: (query) Filters is a JSON object of equality matches, e.g. {\"priority\":\"High\"}. Every key must be a field the DocType declares (or the managed name / docstatus); an undeclared one is refused rather than silently ignored. (optional)
|
|
- parameter fields: (query) Fields projects the response to a subset — a JSON array [\"a\",\"b\"] or a comma list \"a,b\". The envelope keys are always returned. (optional)
|
|
- parameter orderBy: (query) OrderBy is \"<field> [asc|desc]\". Empty means most-recently-updated first. (optional)
|
|
- parameter limit: (query) Limit caps the rows returned. Anything that is not a positive integer leaves the engine's default in place. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<DocumentList>
|
|
*/
|
|
open class func getFrameworkByDoctypeWithRequestBuilder(doctype: String, filters: String? = nil, fields: String? = nil, orderBy: String? = nil, limit: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<DocumentList> {
|
|
var localVariablePath = "/v1/framework/{doctype}"
|
|
let doctypePreEscape = "\(APIHelper.mapValueToPathItem(doctype))"
|
|
let doctypePostEscape = doctypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{doctype}", with: doctypePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"filters": (wrappedValue: filters?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"fields": (wrappedValue: fields?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"order_by": (wrappedValue: orderBy?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"limit": (wrappedValue: limit?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<DocumentList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns one document by name, with Password fields redacted.
|
|
|
|
- parameter doctype: (path) DocType is the document's DocType, by ADDRESS — \"module.name\", from the path.
|
|
- parameter name: (path) Name is the document's name — its key within the DocType — from the path. A name containing a space arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: [String: JSONValue]
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFrameworkByDoctypeByName(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> [String: JSONValue] {
|
|
return try await getFrameworkByDoctypeByNameWithRequestBuilder(doctype: doctype, name: name, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns one document by name, with Password fields redacted.
|
|
- GET /v1/framework/{doctype}/{name}
|
|
- Returns one document by name, with Password fields redacted.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter doctype: (path) DocType is the document's DocType, by ADDRESS — \"module.name\", from the path.
|
|
- parameter name: (path) Name is the document's name — its key within the DocType — from the path. A name containing a space arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<[String: JSONValue]>
|
|
*/
|
|
open class func getFrameworkByDoctypeByNameWithRequestBuilder(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<[String: JSONValue]> {
|
|
var localVariablePath = "/v1/framework/{doctype}/{name}"
|
|
let doctypePreEscape = "\(APIHelper.mapValueToPathItem(doctype))"
|
|
let doctypePostEscape = doctypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{doctype}", with: doctypePostEscape, options: .literal, range: nil)
|
|
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
|
|
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, 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<[String: JSONValue]>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns every DocType defined in the caller's org.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: DocTypeList
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFrameworkDoctypes(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> DocTypeList {
|
|
return try await getFrameworkDoctypesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns every DocType defined in the caller's org.
|
|
- GET /v1/framework/doctypes
|
|
- Returns every DocType defined in the caller's org. Another tenant's definitions are never included: the org is part of the store key.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<DocTypeList>
|
|
*/
|
|
open class func getFrameworkDoctypesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<DocTypeList> {
|
|
let localVariablePath = "/v1/framework/doctypes"
|
|
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<DocTypeList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns one DocType definition — its fields, naming rule, permissions and lifecycle flags.
|
|
|
|
- parameter name: (path) Name is the DocType's ADDRESS — \"module.name\", e.g. \"kb.page\". A name containing a space (\"erp.Sales Invoice\") arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: DocType
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFrameworkDoctypesByName(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> DocType {
|
|
return try await getFrameworkDoctypesByNameWithRequestBuilder(name: name, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns one DocType definition — its fields, naming rule, permissions and lifecycle flags.
|
|
- GET /v1/framework/doctypes/{name}
|
|
- Returns one DocType definition — its fields, naming rule, permissions and lifecycle flags. Scoped to the caller's org, so another tenant's DocType of the same name is simply not found.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter name: (path) Name is the DocType's ADDRESS — \"module.name\", e.g. \"kb.page\". A name containing a space (\"erp.Sales Invoice\") arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<DocType>
|
|
*/
|
|
open class func getFrameworkDoctypesByNameWithRequestBuilder(name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<DocType> {
|
|
var localVariablePath = "/v1/framework/doctypes/{name}"
|
|
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
|
|
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, 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<DocType>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns every app lane compiled into this deployment and the DocTypes each one installs.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: ModuleList
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFrameworkModules(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> ModuleList {
|
|
return try await getFrameworkModulesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns every app lane compiled into this deployment and the DocTypes each one installs.
|
|
- GET /v1/framework/modules
|
|
- Returns every app lane compiled into this deployment and the DocTypes each one installs. It describes the BINARY, not the org: what a given org has actually installed is the per-module state below.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<ModuleList>
|
|
*/
|
|
open class func getFrameworkModulesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<ModuleList> {
|
|
let localVariablePath = "/v1/framework/modules"
|
|
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<ModuleList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns one app lane's install state for the caller's org: the DocTypes the lane declares, and which of them already exist in the org.
|
|
|
|
- parameter module: (path) Module is the lane's registered name (\"cms\", \"erp\"), from the path.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: ModuleState
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFrameworkModulesByModule(module: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> ModuleState {
|
|
return try await getFrameworkModulesByModuleWithRequestBuilder(module: module, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns one app lane's install state for the caller's org: the DocTypes the lane declares, and which of them already exist in the org.
|
|
- GET /v1/framework/modules/{module}
|
|
- Returns one app lane's install state for the caller's org: the DocTypes the lane declares, and which of them already exist in the org. That is the honest \"set up\" versus \"installed\" answer a console renders.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter module: (path) Module is the lane's registered name (\"cms\", \"erp\"), from the path.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<ModuleState>
|
|
*/
|
|
open class func getFrameworkModulesByModuleWithRequestBuilder(module: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<ModuleState> {
|
|
var localVariablePath = "/v1/framework/modules/{module}"
|
|
let modulePreEscape = "\(APIHelper.mapValueToPathItem(module))"
|
|
let modulePostEscape = modulePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{module}", with: modulePostEscape, 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<ModuleState>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Reports how much of the DocType surface the caller's org uses: how many DocTypes it has defined, and how many documents exist across them.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: SummaryView
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFrameworkSummary(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> SummaryView {
|
|
return try await getFrameworkSummaryWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Reports how much of the DocType surface the caller's org uses: how many DocTypes it has defined, and how many documents exist across them.
|
|
- GET /v1/framework/summary
|
|
- Reports how much of the DocType surface the caller's org uses: how many DocTypes it has defined, and how many documents exist across them.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<SummaryView>
|
|
*/
|
|
open class func getFrameworkSummaryWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<SummaryView> {
|
|
let localVariablePath = "/v1/framework/summary"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<SummaryView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Create one document of a DocType, from that DocType's own fields.
|
|
|
|
- parameter doctype: (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 postFrameworkByDoctype(doctype: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postFrameworkByDoctypeWithRequestBuilder(doctype: doctype, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Create one document of a DocType, from that DocType's own fields.
|
|
- POST /v1/framework/{doctype}
|
|
- The body is the DOCUMENT'S field data: a flat JSON object whose properties are the fieldnames the DocType declares, not a fixed envelope. That is why this operation publishes no request schema — the shape is metadata the DocType defines at run time, and no Go struct both accepts it verbatim and describes it, so nothing is asserted rather than something false. The engine validates and coerces every field against the DocType, runs the before_insert and before_save hooks (either may reject the write), stores the document, then runs the after hooks. It answers 201 with the stored document: the field data plus the managed envelope — `name`, `doctype`, `docstatus`, `createdAt`, `updatedAt`. A Password field comes back as a fixed redaction marker and is dropped when empty; its stored value is never returned by this or any other read on this surface. `name` in the body is the REQUESTED DOCUMENT NAME, not a data field. A DocType with an autoname rule names the document itself and ignores it; a prompt-named DocType takes it. This collision is also why the two path segments cannot be folded into the body, and so why the route stays untyped. Scoped to the org of the validated principal, and the engine's own permission calculus decides the rest: the caller needs create rights on this DocType through a role it holds, or a platform admin bit. A caller with no validated principal reaches the engine as the zero Caller and is refused before any store is opened — a forged org header alone buys nothing. A DocType declared Single has exactly ONE document per org, so this writes that one instance instead of adding a row. The body is size-bounded by the engine, the same bound on every host.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter doctype: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postFrameworkByDoctypeWithRequestBuilder(doctype: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/framework/{doctype}"
|
|
let doctypePreEscape = "\(APIHelper.mapValueToPathItem(doctype))"
|
|
let doctypePostEscape = doctypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{doctype}", with: doctypePostEscape, 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: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Moves a submitted document to cancelled (docstatus 1 → 2) after its on_cancel hooks agree.
|
|
|
|
- parameter doctype: (path) DocType is the document's DocType, by ADDRESS — \"module.name\", from the path.
|
|
- parameter name: (path) Name is the document's name — its key within the DocType — from the path. A name containing a space arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: [String: JSONValue]
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postFrameworkByDoctypeByNameCancel(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> [String: JSONValue] {
|
|
return try await postFrameworkByDoctypeByNameCancelWithRequestBuilder(doctype: doctype, name: name, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Moves a submitted document to cancelled (docstatus 1 → 2) after its on_cancel hooks agree.
|
|
- POST /v1/framework/{doctype}/{name}/cancel
|
|
- Moves a submitted document to cancelled (docstatus 1 → 2) after its on_cancel hooks agree. Cancelling is terminal — a cancelled document cannot be re-submitted — but it CAN then be deleted.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter doctype: (path) DocType is the document's DocType, by ADDRESS — \"module.name\", from the path.
|
|
- parameter name: (path) Name is the document's name — its key within the DocType — from the path. A name containing a space arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<[String: JSONValue]>
|
|
*/
|
|
open class func postFrameworkByDoctypeByNameCancelWithRequestBuilder(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<[String: JSONValue]> {
|
|
var localVariablePath = "/v1/framework/{doctype}/{name}/cancel"
|
|
let doctypePreEscape = "\(APIHelper.mapValueToPathItem(doctype))"
|
|
let doctypePostEscape = doctypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{doctype}", with: doctypePostEscape, options: .literal, range: nil)
|
|
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
|
|
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, 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<[String: JSONValue]>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Moves a draft to submitted (docstatus 0 → 1) after its on_submit hooks agree.
|
|
|
|
- parameter doctype: (path) DocType is the document's DocType, by ADDRESS — \"module.name\", from the path.
|
|
- parameter name: (path) Name is the document's name — its key within the DocType — from the path. A name containing a space arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: [String: JSONValue]
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postFrameworkByDoctypeByNameSubmit(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> [String: JSONValue] {
|
|
return try await postFrameworkByDoctypeByNameSubmitWithRequestBuilder(doctype: doctype, name: name, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Moves a draft to submitted (docstatus 0 → 1) after its on_submit hooks agree.
|
|
- POST /v1/framework/{doctype}/{name}/submit
|
|
- Moves a draft to submitted (docstatus 0 → 1) after its on_submit hooks agree. A submitted document is IMMUTABLE: further writes and deletes are refused until it is cancelled. Only a submittable DocType has this lifecycle; any other docstatus is an illegal transition.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter doctype: (path) DocType is the document's DocType, by ADDRESS — \"module.name\", from the path.
|
|
- parameter name: (path) Name is the document's name — its key within the DocType — from the path. A name containing a space arrives percent-encoded and is decoded before it is matched against the stored one.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<[String: JSONValue]>
|
|
*/
|
|
open class func postFrameworkByDoctypeByNameSubmitWithRequestBuilder(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<[String: JSONValue]> {
|
|
var localVariablePath = "/v1/framework/{doctype}/{name}/submit"
|
|
let doctypePreEscape = "\(APIHelper.mapValueToPathItem(doctype))"
|
|
let doctypePostEscape = doctypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{doctype}", with: doctypePostEscape, options: .literal, range: nil)
|
|
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
|
|
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, 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<[String: JSONValue]>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Defines a DocType in the caller's org: the metadata that gives a document surface its fields, its naming rule, whether it has a submit/cancel lifecycle, and which role may do what to it.
|
|
|
|
- parameter docType: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: DocType
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postFrameworkDoctypes(docType: DocType, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> DocType {
|
|
return try await postFrameworkDoctypesWithRequestBuilder(docType: docType, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Defines a DocType in the caller's org: the metadata that gives a document surface its fields, its naming rule, whether it has a submit/cancel lifecycle, and which role may do what to it.
|
|
- POST /v1/framework/doctypes
|
|
- Defines a DocType in the caller's org: the metadata that gives a document surface its fields, its naming rule, whether it has a submit/cancel lifecycle, and which role may do what to it. Manager-only — on a fresh org the first caller to administer it is seeded as its System Manager, after which only a System Manager (or a platform admin) may define. Answers 201.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter docType: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<DocType>
|
|
*/
|
|
open class func postFrameworkDoctypesWithRequestBuilder(docType: DocType, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<DocType> {
|
|
let localVariablePath = "/v1/framework/doctypes"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: docType, 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<DocType>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Creates an app lane's DocTypes in the caller's org.
|
|
|
|
- parameter module: (path) Module is the lane's registered name (\"cms\", \"erp\"), from the path.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Install
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postFrameworkModulesByModuleInstall(module: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Install {
|
|
return try await postFrameworkModulesByModuleInstallWithRequestBuilder(module: module, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Creates an app lane's DocTypes in the caller's org.
|
|
- POST /v1/framework/modules/{module}/install
|
|
- Creates an app lane's DocTypes in the caller's org. Idempotent and create-if-absent: a DocType the org already has is reported as existing and never replaced, so re-installing cannot clobber a definition the org has since edited. Manager-only.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter module: (path) Module is the lane's registered name (\"cms\", \"erp\"), from the path.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Install>
|
|
*/
|
|
open class func postFrameworkModulesByModuleInstallWithRequestBuilder(module: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Install> {
|
|
var localVariablePath = "/v1/framework/modules/{module}/install"
|
|
let modulePreEscape = "\(APIHelper.mapValueToPathItem(module))"
|
|
let modulePostEscape = modulePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{module}", with: modulePostEscape, 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<Install>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Replace a draft document's field data wholesale.
|
|
|
|
- parameter doctype: (path)
|
|
- parameter name: (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 putFrameworkByDoctypeByName(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await putFrameworkByDoctypeByNameWithRequestBuilder(doctype: doctype, name: name, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replace a draft document's field data wholesale.
|
|
- PUT /v1/framework/{doctype}/{name}
|
|
- PUT semantics: the stored field data BECOMES the body, so a field the body omits is not left at its previous value. The body is the document's own field data — the same metadata-defined open object the create takes, and the same reason this operation publishes no request schema. Only a DRAFT can be edited. A document that has been submitted or cancelled is immutable and the write is refused as a conflict, so the submit lifecycle cannot be bypassed by a plain update — cancel it first, and note that a cancelled document can be deleted but never re-submitted or re-edited. The engine validates the new data against the DocType, runs before_save (which may reject), writes, then runs the after hooks, and answers 200 with the stored document plus its managed envelope, Password fields redacted. The document name in the path is percent-decoded before it is matched, so a name containing a space is addressed as it is stored. An unknown DocType or document is not found, and the same answer covers a document that exists in another tenant: the org comes from the validated principal and is part of the store key, so a caller cannot learn that another org's document exists. Write rights on the DocType are required, decided by the engine's permission calculus. For a Single DocType the path name is ignored — there is one instance per org and this writes it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter doctype: (path)
|
|
- parameter name: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func putFrameworkByDoctypeByNameWithRequestBuilder(doctype: String, name: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/framework/{doctype}/{name}"
|
|
let doctypePreEscape = "\(APIHelper.mapValueToPathItem(doctype))"
|
|
let doctypePostEscape = doctypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{doctype}", with: doctypePostEscape, options: .literal, range: nil)
|
|
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
|
|
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, 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)
|
|
}
|
|
|
|
/**
|
|
Replaces a DocType definition wholesale (PUT semantics): the stored definition becomes the body.
|
|
|
|
- parameter name: (path)
|
|
- parameter docType: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: DocType
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putFrameworkDoctypesByName(name: String, docType: DocType, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> DocType {
|
|
return try await putFrameworkDoctypesByNameWithRequestBuilder(name: name, docType: docType, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Replaces a DocType definition wholesale (PUT semantics): the stored definition becomes the body.
|
|
- PUT /v1/framework/doctypes/{name}
|
|
- Replaces a DocType definition wholesale (PUT semantics): the stored definition becomes the body. The name in the URL is authoritative over the body's, and documents already stored under the DocType are left intact. Manager-only.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter name: (path)
|
|
- parameter docType: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<DocType>
|
|
*/
|
|
open class func putFrameworkDoctypesByNameWithRequestBuilder(name: String, docType: DocType, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<DocType> {
|
|
var localVariablePath = "/v1/framework/doctypes/{name}"
|
|
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
|
|
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: docType, 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<DocType>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|