mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
484 lines
32 KiB
Swift
484 lines
32 KiB
Swift
//
|
|
// LegalAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class LegalAPI {
|
|
|
|
/**
|
|
Returns the org's generated documents, newest first, WITHOUT their rendered content — fetch one document to read its body.
|
|
|
|
- parameter limit: (query) Limit bounds the page. Absent or unparseable means the store's own default. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: DocumentPage
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLegalDocuments(limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> DocumentPage {
|
|
return try await getLegalDocumentsWithRequestBuilder(limit: limit, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns the org's generated documents, newest first, WITHOUT their rendered content — fetch one document to read its body.
|
|
- GET /v1/legal/documents
|
|
- Returns the org's generated documents, newest first, WITHOUT their rendered content — fetch one document to read its body. The response is marked no-store: these records name the counterparties an org is contracting with, and must not sit in a shared cache.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter limit: (query) Limit bounds the page. Absent or unparseable means the store's own default. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<DocumentPage>
|
|
*/
|
|
open class func getLegalDocumentsWithRequestBuilder(limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<DocumentPage> {
|
|
let localVariablePath = "/v1/legal/documents"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"limit": (wrappedValue: limit?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<DocumentPage>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns one of the org's documents WITH its rendered body.
|
|
|
|
- parameter id: (path) ID is the document's server-minted handle, \"doc_\"-prefixed.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: DocumentReply
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLegalDocumentsById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> DocumentReply {
|
|
return try await getLegalDocumentsByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns one of the org's documents WITH its rendered body.
|
|
- GET /v1/legal/documents/{id}
|
|
- Returns one of the org's documents WITH its rendered body. 404 when the org has no document with that id — a document is never readable across orgs. The response is marked no-store: the body is contract text, sealed at rest and returned only to the owning org, and must not sit in a shared cache.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path) ID is the document's server-minted handle, \"doc_\"-prefixed.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<DocumentReply>
|
|
*/
|
|
open class func getLegalDocumentsByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<DocumentReply> {
|
|
var localVariablePath = "/v1/legal/documents/{id}"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<DocumentReply>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns the org's filing records, newest first — which documents were filed where, through which provider, and what the filing's honest status is.
|
|
|
|
- parameter limit: (query) Limit bounds the page. Absent or unparseable means the store's own default. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: FilingPage
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLegalFilings(limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> FilingPage {
|
|
return try await getLegalFilingsWithRequestBuilder(limit: limit, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns the org's filing records, newest first — which documents were filed where, through which provider, and what the filing's honest status is.
|
|
- GET /v1/legal/filings
|
|
- Returns the org's filing records, newest first — which documents were filed where, through which provider, and what the filing's honest status is.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter limit: (query) Limit bounds the page. Absent or unparseable means the store's own default. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<FilingPage>
|
|
*/
|
|
open class func getLegalFilingsWithRequestBuilder(limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<FilingPage> {
|
|
let localVariablePath = "/v1/legal/filings"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"limit": (wrappedValue: limit?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<FilingPage>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Reports that the legal subsystem is serving and how many built-in templates its catalog carries.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: LegalHealth
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLegalHealth(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> LegalHealth {
|
|
return try await getLegalHealthWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Reports that the legal subsystem is serving and how many built-in templates its catalog carries.
|
|
- GET /v1/legal/health
|
|
- Reports that the legal subsystem is serving and how many built-in templates its catalog carries. It reads no tenant, so a liveness prober that sends no principal is answered rather than refused.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<LegalHealth>
|
|
*/
|
|
open class func getLegalHealthWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<LegalHealth> {
|
|
let localVariablePath = "/v1/legal/health"
|
|
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<LegalHealth>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns the org's effective template catalog: every built-in template, with any the org has overridden replaced by its own latest version.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: TemplateCatalog
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLegalTemplates(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> TemplateCatalog {
|
|
return try await getLegalTemplatesWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns the org's effective template catalog: every built-in template, with any the org has overridden replaced by its own latest version.
|
|
- GET /v1/legal/templates
|
|
- Returns the org's effective template catalog: every built-in template, with any the org has overridden replaced by its own latest version. The listing carries each template's metadata and its declared MERGE FIELDS — the keys a document generation must supply — but never the template bodies; fetch one template to get its body. Templates in the formation and equity categories are marked counselReview: every document rendered from them carries a counsel notice, and that posture cannot be dropped by an override.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<TemplateCatalog>
|
|
*/
|
|
open class func getLegalTemplatesWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<TemplateCatalog> {
|
|
let localVariablePath = "/v1/legal/templates"
|
|
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<TemplateCatalog>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Returns one template resolved for the caller's org — the org's own override if it has saved one, else the built-in — with its full text/template body and its declared merge fields.
|
|
|
|
- parameter id: (path) ID is the template's stable id, e.g. \"nda\" or \"safe\".
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: TemplateReply
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getLegalTemplatesById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> TemplateReply {
|
|
return try await getLegalTemplatesByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Returns one template resolved for the caller's org — the org's own override if it has saved one, else the built-in — with its full text/template body and its declared merge fields.
|
|
- GET /v1/legal/templates/{id}
|
|
- Returns one template resolved for the caller's org — the org's own override if it has saved one, else the built-in — with its full text/template body and its declared merge fields. 404 when neither exists.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path) ID is the template's stable id, e.g. \"nda\" or \"safe\".
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<TemplateReply>
|
|
*/
|
|
open class func getLegalTemplatesByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<TemplateReply> {
|
|
var localVariablePath = "/v1/legal/templates/{id}"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<TemplateReply>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Renders a document from a template and the caller's own merge data, seals it in the org's store, and returns it with its rendered body.
|
|
|
|
- parameter generateRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: DocumentReply
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postLegalDocuments(generateRequest: GenerateRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> DocumentReply {
|
|
return try await postLegalDocumentsWithRequestBuilder(generateRequest: generateRequest, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Renders a document from a template and the caller's own merge data, seals it in the org's store, and returns it with its rendered body.
|
|
- POST /v1/legal/documents
|
|
- Renders a document from a template and the caller's own merge data, seals it in the org's store, and returns it with its rendered body. The render is PURE and deterministic — no clock, no I/O — so the same template version and the same data always produce identical bytes, which is what makes a generated contract reproducible. It fails CLOSED on a missing merge field: there is no blank-filled contract, only a 400 naming the fields that were absent. When the template is counsel-review the rendered body opens with the counsel notice, which no caller can suppress. The document is a DRAFT. Hanzo Legal manages documents; it does not give legal advice and does not determine that a document is valid or sufficient.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter generateRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<DocumentReply>
|
|
*/
|
|
open class func postLegalDocumentsWithRequestBuilder(generateRequest: GenerateRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<DocumentReply> {
|
|
let localVariablePath = "/v1/legal/documents"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: generateRequest, 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<DocumentReply>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Opens an e-signature request over one document and moves it to out_for_signature, returning the provider's reference for the request.
|
|
|
|
- parameter id: (path) ID is the document to send for signature, from the path.
|
|
- parameter signRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: SignReply
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postLegalDocumentsByIdSign(id: String, signRequest: SignRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> SignReply {
|
|
return try await postLegalDocumentsByIdSignWithRequestBuilder(id: id, signRequest: signRequest, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Opens an e-signature request over one document and moves it to out_for_signature, returning the provider's reference for the request.
|
|
- POST /v1/legal/documents/{id}/sign
|
|
- Opens an e-signature request over one document and moves it to out_for_signature, returning the provider's reference for the request. The provider is whatever this deployment has wired. The honest default is \"manual\": the request is recorded and the org fulfils it out of band — nothing here fabricates a signature, and the stub never reports itself complete.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path) ID is the document to send for signature, from the path.
|
|
- parameter signRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<SignReply>
|
|
*/
|
|
open class func postLegalDocumentsByIdSignWithRequestBuilder(id: String, signRequest: SignRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<SignReply> {
|
|
var localVariablePath = "/v1/legal/documents/{id}/sign"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: signRequest, 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<SignReply>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Record that a generated document's signature request completed
|
|
|
|
- parameter id: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: Void
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postLegalDocumentsByIdSignComplete(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
|
|
return try await postLegalDocumentsByIdSignCompleteWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Record that a generated document's signature request completed
|
|
- POST /v1/legal/documents/{id}/sign/complete
|
|
- Records completion of the signature request opened over a generated document and answers the document with a `signed` flag. The e-sign provider's own status is consulted FIRST and is the default answer; an explicit `signed` field in the body overrides it. That override is the whole point: the default `manual` provider never self-completes, so a reviewer (or a real provider's webhook) is what moves the document. A completion flips the document to `signed`, stamps `signedAt`, and writes a `legal.document.signed` audit event; a provider still reporting incomplete answers 200 with the document unchanged, so the call is safe to repeat and never fabricates a signature. Org-scoped and fails closed: a validated principal is required (403 without one), the document is read under the caller's OWN org so another tenant's id is a 404, a document with no open signature request is a 400, and a provider whose status call errors is a 502.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<Void>
|
|
*/
|
|
open class func postLegalDocumentsByIdSignCompleteWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
|
|
var localVariablePath = "/v1/legal/documents/{id}/sign/complete"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Records a filing of one or more of the org's documents with a state or agency, and returns the tracking record.
|
|
|
|
- parameter filingRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: FilingReply
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postLegalFilings(filingRequest: FilingRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> FilingReply {
|
|
return try await postLegalFilingsWithRequestBuilder(filingRequest: filingRequest, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Records a filing of one or more of the org's documents with a state or agency, and returns the tracking record.
|
|
- POST /v1/legal/filings
|
|
- Records a filing of one or more of the org's documents with a state or agency, and returns the tracking record. It is a TRACKING record, not an autonomous filing. With no filing partner wired the honest status is \"manual\" and the note says so: the documents were generated for signature, and the org files them through its registered agent. Nothing here invents a filing id it does not have. Every document id must belong to the caller's org; one that does not is a 404 naming it, so a filing can never reach across tenants.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter filingRequest: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<FilingReply>
|
|
*/
|
|
open class func postLegalFilingsWithRequestBuilder(filingRequest: FilingRequest, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<FilingReply> {
|
|
let localVariablePath = "/v1/legal/filings"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: filingRequest, 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<FilingReply>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Saves the org's own version of a template — a custom NDA, a house MSA — and returns it with its new version number.
|
|
|
|
- parameter id: (path) ID is the template to override, from the path. Overriding a built-in id inherits that built-in's category, title and counsel-review posture.
|
|
- parameter templateOverride: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: TemplateReply
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putLegalTemplatesById(id: String, templateOverride: TemplateOverride, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> TemplateReply {
|
|
return try await putLegalTemplatesByIdWithRequestBuilder(id: id, templateOverride: templateOverride, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Saves the org's own version of a template — a custom NDA, a house MSA — and returns it with its new version number.
|
|
- PUT /v1/legal/templates/{id}
|
|
- Saves the org's own version of a template — a custom NDA, a house MSA — and returns it with its new version number. It takes effect for that org only; other orgs keep the built-in. Two boundaries cannot be crossed here. Overriding a built-in INHERITS its category and its counsel-review posture, which can be raised but never dropped; and a formation or equity template is counsel-review whatever the caller sends, so no org can generate a securities-class document without the notice. The body is validated on save, not at generation: a template that references an UNDECLARED merge field is refused with 400 rather than stored and rendered blank into a contract months later.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter id: (path) ID is the template to override, from the path. Overriding a built-in id inherits that built-in's category, title and counsel-review posture.
|
|
- parameter templateOverride: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<TemplateReply>
|
|
*/
|
|
open class func putLegalTemplatesByIdWithRequestBuilder(id: String, templateOverride: TemplateOverride, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<TemplateReply> {
|
|
var localVariablePath = "/v1/legal/templates/{id}"
|
|
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
|
|
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: templateOverride, 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<TemplateReply>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|