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.
319 lines
20 KiB
Swift
319 lines
20 KiB
Swift
//
|
|
// GraphAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class GraphAPI {
|
|
|
|
/**
|
|
Assert what is true of an entity
|
|
|
|
- parameter graphAssertIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: GraphAssertOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func graphAssert(graphAssertIn: GraphAssertIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> GraphAssertOut {
|
|
return try await graphAssertWithRequestBuilder(graphAssertIn: graphAssertIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Assert what is true of an entity
|
|
- POST /v1/graph
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter graphAssertIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<GraphAssertOut>
|
|
*/
|
|
open class func graphAssertWithRequestBuilder(graphAssertIn: GraphAssertIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<GraphAssertOut> {
|
|
let localVariablePath = "/v1/graph"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: graphAssertIn, 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<GraphAssertOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Walk the edges from a seed set, bounded
|
|
|
|
- parameter graphNeighborsIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: GraphNeighborsOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func graphNeighbors(graphNeighborsIn: GraphNeighborsIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> GraphNeighborsOut {
|
|
return try await graphNeighborsWithRequestBuilder(graphNeighborsIn: graphNeighborsIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Walk the edges from a seed set, bounded
|
|
- POST /v1/graph/neighbors
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter graphNeighborsIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<GraphNeighborsOut>
|
|
*/
|
|
open class func graphNeighborsWithRequestBuilder(graphNeighborsIn: GraphNeighborsIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<GraphNeighborsOut> {
|
|
let localVariablePath = "/v1/graph/neighbors"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: graphNeighborsIn, 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<GraphNeighborsOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Read the assertions this organization has recorded
|
|
|
|
- parameter entity: (query) Entity narrows to what was asserted ABOUT one entity. Absent matches every entity. (optional)
|
|
- parameter relation: (query) Relation narrows to one relation. Absent matches every relation. (optional)
|
|
- parameter value: (query) Value narrows to assertions pointing AT one value, which is how the edges into an entity are read. (optional)
|
|
- parameter asOf: (query) AsOf bounds the read to what was knowable at an instant, RFC 3339. Absent reads everything this plane holds. (optional)
|
|
- parameter limit: (query) Limit caps how many assertions come back. Absent, zero, or anything above the walk ceiling is the ceiling. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: GraphReadOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func graphRead(entity: String? = nil, relation: String? = nil, value: String? = nil, asOf: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> GraphReadOut {
|
|
return try await graphReadWithRequestBuilder(entity: entity, relation: relation, value: value, asOf: asOf, limit: limit, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Read the assertions this organization has recorded
|
|
- GET /v1/graph
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter entity: (query) Entity narrows to what was asserted ABOUT one entity. Absent matches every entity. (optional)
|
|
- parameter relation: (query) Relation narrows to one relation. Absent matches every relation. (optional)
|
|
- parameter value: (query) Value narrows to assertions pointing AT one value, which is how the edges into an entity are read. (optional)
|
|
- parameter asOf: (query) AsOf bounds the read to what was knowable at an instant, RFC 3339. Absent reads everything this plane holds. (optional)
|
|
- parameter limit: (query) Limit caps how many assertions come back. Absent, zero, or anything above the walk ceiling is the ceiling. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<GraphReadOut>
|
|
*/
|
|
open class func graphReadWithRequestBuilder(entity: String? = nil, relation: String? = nil, value: String? = nil, asOf: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<GraphReadOut> {
|
|
let localVariablePath = "/v1/graph"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"entity": (wrappedValue: entity?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"relation": (wrappedValue: relation?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"value": (wrappedValue: value?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"as_of": (wrappedValue: asOf?.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<GraphReadOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
What is in force about an entity as of an instant, and what disagreed
|
|
|
|
- parameter graphResolveIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: GraphResolveOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func graphResolve(graphResolveIn: GraphResolveIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> GraphResolveOut {
|
|
return try await graphResolveWithRequestBuilder(graphResolveIn: graphResolveIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
What is in force about an entity as of an instant, and what disagreed
|
|
- POST /v1/graph/resolve
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter graphResolveIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<GraphResolveOut>
|
|
*/
|
|
open class func graphResolveWithRequestBuilder(graphResolveIn: GraphResolveIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<GraphResolveOut> {
|
|
let localVariablePath = "/v1/graph/resolve"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: graphResolveIn, 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<GraphResolveOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Find assertions by their text rather than by an entity key
|
|
|
|
- parameter q: (query) Q is what to look for: words, matched as prefixes, all of them required. Punctuation is text here rather than syntax, so an entity key searches as itself. (optional)
|
|
- parameter relation: (query) Relation narrows to one relation. Absent matches every relation. (optional)
|
|
- parameter asOf: (query) AsOf bounds the search to what was knowable at an instant, RFC 3339. Absent searches everything this plane holds. (optional)
|
|
- parameter limit: (query) Limit caps how many assertions come back. Absent, zero, or anything above the walk ceiling is the ceiling. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: GraphReadOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func graphSearch(q: String? = nil, relation: String? = nil, asOf: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> GraphReadOut {
|
|
return try await graphSearchWithRequestBuilder(q: q, relation: relation, asOf: asOf, limit: limit, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Find assertions by their text rather than by an entity key
|
|
- GET /v1/graph/search
|
|
- Finds assertions by their text where read finds them by their keys. It is the READ with one more term, not a second way to leave the store: same order, same ceiling, same tenancy, and searching composes with narrowing by relation and by instant because all of them are terms of one filter. It resolves nothing. What matches is what was asserted, including claims that were later corrected — which is the honest answer to \"where is this mentioned\" and the reason the caller then asks resolve about what it found.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter q: (query) Q is what to look for: words, matched as prefixes, all of them required. Punctuation is text here rather than syntax, so an entity key searches as itself. (optional)
|
|
- parameter relation: (query) Relation narrows to one relation. Absent matches every relation. (optional)
|
|
- parameter asOf: (query) AsOf bounds the search to what was knowable at an instant, RFC 3339. Absent searches everything this plane holds. (optional)
|
|
- parameter limit: (query) Limit caps how many assertions come back. Absent, zero, or anything above the walk ceiling is the ceiling. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<GraphReadOut>
|
|
*/
|
|
open class func graphSearchWithRequestBuilder(q: String? = nil, relation: String? = nil, asOf: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<GraphReadOut> {
|
|
let localVariablePath = "/v1/graph/search"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"q": (wrappedValue: q?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"relation": (wrappedValue: relation?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"as_of": (wrappedValue: asOf?.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<GraphReadOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
The relations in use, and the rule that resolves a conflict
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: GraphVocabularyOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func graphVocabulary(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> GraphVocabularyOut {
|
|
return try await graphVocabularyWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
The relations in use, and the rule that resolves a conflict
|
|
- GET /v1/graph/vocabulary
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<GraphVocabularyOut>
|
|
*/
|
|
open class func graphVocabularyWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<GraphVocabularyOut> {
|
|
let localVariablePath = "/v1/graph/vocabulary"
|
|
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<GraphVocabularyOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Ask the graph in one request, traversing.
|
|
|
|
- parameter graphQLIn: (body) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: GraphQLOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postGraphGraphql(graphQLIn: GraphQLIn? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> GraphQLOut {
|
|
return try await postGraphGraphqlWithRequestBuilder(graphQLIn: graphQLIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Ask the graph in one request, traversing.
|
|
- POST /v1/graph/graphql
|
|
- Runs a GraphQL query against this organization's assertions. It is the one endpoint here a caller can TRAVERSE: the REST ops each answer a single question, so composing them — the entities this one points at, and what each of those resolves to — costs a request per hop with the intermediate keys held by the caller. Here that is one query and the nesting is the answer's shape. It adds no way to ask anything new. Every field runs the SAME operation the matching REST route runs, so the tenancy, the as-of bound, the traversal bounds and the conflict rule are the ones already in force; the schema is served by introspection. A query that cannot run answers 200 with an `errors` list, which is the wire every GraphQL client parses.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter graphQLIn: (body) (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<GraphQLOut>
|
|
*/
|
|
open class func postGraphGraphqlWithRequestBuilder(graphQLIn: GraphQLIn? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<GraphQLOut> {
|
|
let localVariablePath = "/v1/graph/graphql"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: graphQLIn, 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<GraphQLOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|