Files
sdk/api_graph.go

2629 lines
90 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"os"
)
// GraphAPIService GraphAPI service
type GraphAPIService service
type GraphAPIGetGraphGraphqlRequest struct {
ctx context.Context
ApiService *GraphAPIService
}
func (r GraphAPIGetGraphGraphqlRequest) Execute() (*os.File, *http.Response, error) {
return r.ApiService.GetGraphGraphqlExecute(r)
}
/*
GetGraphGraphql Read the graph's GraphQL schema.
Returns the schema POST at this address runs queries against, as GraphQL SDL: the five types the store models and the fields askable of each. It is what a code generator or an editor reads, and it is the same for every organization; what a query answers is scoped to the caller's.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGetGraphGraphqlRequest
*/
func (a *GraphAPIService) GetGraphGraphql(ctx context.Context) GraphAPIGetGraphGraphqlRequest {
return GraphAPIGetGraphGraphqlRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return *os.File
func (a *GraphAPIService) GetGraphGraphqlExecute(r GraphAPIGetGraphGraphqlRequest) (*os.File, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *os.File
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GetGraphGraphql")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/graphql"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"text/plain; charset=utf-8"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphAnswerRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphAnswerIn *GraphGraphAnswerIn
}
func (r GraphAPIGraphAnswerRequest) GraphGraphAnswerIn(graphGraphAnswerIn GraphGraphAnswerIn) GraphAPIGraphAnswerRequest {
r.graphGraphAnswerIn = &graphGraphAnswerIn
return r
}
func (r GraphAPIGraphAnswerRequest) Execute() (*GraphGraphAnswerOut, *http.Response, error) {
return r.ApiService.GraphAnswerExecute(r)
}
/*
GraphAnswer Answers a question from the whole graph and cites the assertions it rests on.
Answers a question from the whole graph and cites the assertions it
rests on.
It asks a model what each community's in-force facts say about the question,
then asks once more for one answer from those findings. Every cited ID is
checked to be a row of this graph, a failed model call fails the answer, and
the calls are billed to the calling organization.
Time: as_of and as_known place the graph that is read; either absent is now.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphAnswerRequest
*/
func (a *GraphAPIService) GraphAnswer(ctx context.Context) GraphAPIGraphAnswerRequest {
return GraphAPIGraphAnswerRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphAnswerOut
func (a *GraphAPIService) GraphAnswerExecute(r GraphAPIGraphAnswerRequest) (*GraphGraphAnswerOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphAnswerOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphAnswer")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/answer"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphAnswerIn == nil {
return localVarReturnValue, nil, reportError("graphGraphAnswerIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphAnswerIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphAppleRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphAppleIn *GraphGraphAppleIn
}
func (r GraphAPIGraphAppleRequest) GraphGraphAppleIn(graphGraphAppleIn GraphGraphAppleIn) GraphAPIGraphAppleRequest {
r.graphGraphAppleIn = &graphGraphAppleIn
return r
}
func (r GraphAPIGraphAppleRequest) Execute() (*GraphGraphAssertOut, *http.Response, error) {
return r.ApiService.GraphAppleExecute(r)
}
/*
GraphApple Ingests an Apple Personal Knowledge Graph snapshot — live stable_graph triples, withdrawn expired_stable_graph rows and entityTagging kinship scorecards — into the organization's assertion plane.
Ingests an Apple Personal Knowledge Graph snapshot — live stable_graph
triples, withdrawn expired_stable_graph rows and entityTagging kinship
scorecards — into the organization's assertion plane.
Two-row reified edges sharing a relationship_id (one naming a CS* / nm_*
relationship type under PS1, the other pointing at the target entity) are
collapsed into edges under their canonical relation names while preserving
the raw Apple predicate and relationship class in evidence. Withdrawn rows in
expired are recorded with until stamped so they remain inspectable in history
without holding as live facts.
Time: at is the snapshot's valid instant, which an as_of read is bounded by;
the server stamps knowable at the write, which an as_known read is bounded by.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphAppleRequest
*/
func (a *GraphAPIService) GraphApple(ctx context.Context) GraphAPIGraphAppleRequest {
return GraphAPIGraphAppleRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphAssertOut
func (a *GraphAPIService) GraphAppleExecute(r GraphAPIGraphAppleRequest) (*GraphGraphAssertOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphAssertOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphApple")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/apple"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphAppleIn == nil {
return localVarReturnValue, nil, reportError("graphGraphAppleIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphAppleIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphAssertRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphAssertIn *GraphGraphAssertIn
}
func (r GraphAPIGraphAssertRequest) GraphGraphAssertIn(graphGraphAssertIn GraphGraphAssertIn) GraphAPIGraphAssertRequest {
r.graphGraphAssertIn = &graphGraphAssertIn
return r
}
func (r GraphAPIGraphAssertRequest) Execute() (*GraphGraphAssertOut, *http.Response, error) {
return r.ApiService.GraphAssertExecute(r)
}
/*
GraphAssert Records a batch of assertions and counts what became of each.
Records a batch of assertions and counts what became of each.
Each member is judged alone: one refusal does not discard the rest, and a
member this plane already holds is a duplicate, not a refusal. A batch with
nothing admitted answers 400.
Time: at and until are when the statement was so, which an as_of read is
bounded by; the server stamps knowable, the later of seen and its own clock,
which an as_known read is bounded by. Nothing is overwritten: a correction is
the statement filed again, and the version known latest speaks for it.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphAssertRequest
*/
func (a *GraphAPIService) GraphAssert(ctx context.Context) GraphAPIGraphAssertRequest {
return GraphAPIGraphAssertRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphAssertOut
func (a *GraphAPIService) GraphAssertExecute(r GraphAPIGraphAssertRequest) (*GraphGraphAssertOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphAssertOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphAssert")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphAssertIn == nil {
return localVarReturnValue, nil, reportError("graphGraphAssertIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphAssertIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphCommunitiesRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphCommunitiesIn *GraphGraphCommunitiesIn
}
func (r GraphAPIGraphCommunitiesRequest) GraphGraphCommunitiesIn(graphGraphCommunitiesIn GraphGraphCommunitiesIn) GraphAPIGraphCommunitiesRequest {
r.graphGraphCommunitiesIn = &graphGraphCommunitiesIn
return r
}
func (r GraphAPIGraphCommunitiesRequest) Execute() (*GraphGraphCommunitiesOut, *http.Response, error) {
return r.ApiService.GraphCommunitiesExecute(r)
}
/*
GraphCommunities Partitions the edge graph into sets of entities more densely connected to each other than to the rest.
Partitions the edge graph into sets of entities more densely
connected to each other than to the rest.
The graph is the one a walk reads, direction dropped, and the partition is
deterministic: the same graph at the same point numbers the same communities.
Time: as_of and as_known place the graph that is partitioned; either absent is
now.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphCommunitiesRequest
*/
func (a *GraphAPIService) GraphCommunities(ctx context.Context) GraphAPIGraphCommunitiesRequest {
return GraphAPIGraphCommunitiesRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphCommunitiesOut
func (a *GraphAPIService) GraphCommunitiesExecute(r GraphAPIGraphCommunitiesRequest) (*GraphGraphCommunitiesOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphCommunitiesOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphCommunities")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/communities"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphCommunitiesIn == nil {
return localVarReturnValue, nil, reportError("graphGraphCommunitiesIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphCommunitiesIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphConvoRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphConvoIn *GraphGraphConvoIn
}
func (r GraphAPIGraphConvoRequest) GraphGraphConvoIn(graphGraphConvoIn GraphGraphConvoIn) GraphAPIGraphConvoRequest {
r.graphGraphConvoIn = &graphGraphConvoIn
return r
}
func (r GraphAPIGraphConvoRequest) Execute() (*GraphGraphConvoOut, *http.Response, error) {
return r.ApiService.GraphConvoExecute(r)
}
/*
GraphConvo Extracts entity state and relationship assertions from conversation turns and updates the graph.
Extracts entity state and relationship assertions from conversation
turns and updates the graph.
First-person statements bind to the turn's speaker, second-person statements
to its partner, and named subjects to their entity keys. Questions are
skipped. Single-valued state updates (such as moving cities or changing
roles) supersede prior values at the turn's timestamp, and explicit
departures (such as leaving an employer) file a retraction ending the prior
claim. Set dry_run to inspect what the turns state without writing.
Time: each turn's at (or the batch's at when omitted) is the valid instant of
the assertions extracted from it, which an as_of read is bounded by; each
becomes knowable at the write, which an as_known read is bounded by.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphConvoRequest
*/
func (a *GraphAPIService) GraphConvo(ctx context.Context) GraphAPIGraphConvoRequest {
return GraphAPIGraphConvoRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphConvoOut
func (a *GraphAPIService) GraphConvoExecute(r GraphAPIGraphConvoRequest) (*GraphGraphConvoOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphConvoOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphConvo")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/convo"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphConvoIn == nil {
return localVarReturnValue, nil, reportError("graphGraphConvoIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphConvoIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphDeriveRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphDeriveIn *GraphGraphDeriveIn
}
func (r GraphAPIGraphDeriveRequest) GraphGraphDeriveIn(graphGraphDeriveIn GraphGraphDeriveIn) GraphAPIGraphDeriveRequest {
r.graphGraphDeriveIn = &graphGraphDeriveIn
return r
}
func (r GraphAPIGraphDeriveRequest) Execute() (*GraphGraphDeriveOut, *http.Response, error) {
return r.ApiService.GraphDeriveExecute(r)
}
/*
GraphDerive Concludes what the organization's rules derive from the graph, with a proof for every conclusion: the rule, and each support as the assertion in force it rests on or as the derived atom it is.
Concludes what the organization's rules derive from the graph, with a
proof for every conclusion: the rule, and each support as the assertion in
force it rests on or as the derived atom it is.
The rules are assertions — (`rule:<name>`, `rule`, `<text>`), Datalog over
the organization's relations, with recursion, stratified negation and the
builtins = and != — and the graph is read the way resolve reads it, so a
retraction, an until and a declared cardinality all apply. Nothing derived is
stored unless an admin asks to file it. Without names assertions to derive
without, and the answer then says what would be lost, and what gained, if
they had never been filed.
Time: as_of and as_known place the graph and the rules it is read with, as
they place a resolve; either absent is now. Filing takes neither: a filed
conclusion holds from the instant it was derived.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphDeriveRequest
*/
func (a *GraphAPIService) GraphDerive(ctx context.Context) GraphAPIGraphDeriveRequest {
return GraphAPIGraphDeriveRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphDeriveOut
func (a *GraphAPIService) GraphDeriveExecute(r GraphAPIGraphDeriveRequest) (*GraphGraphDeriveOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphDeriveOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphDerive")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/derive"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphDeriveIn == nil {
return localVarReturnValue, nil, reportError("graphGraphDeriveIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphDeriveIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphDiffRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphDiffIn *GraphGraphDiffIn
}
func (r GraphAPIGraphDiffRequest) GraphGraphDiffIn(graphGraphDiffIn GraphGraphDiffIn) GraphAPIGraphDiffRequest {
r.graphGraphDiffIn = &graphGraphDiffIn
return r
}
func (r GraphAPIGraphDiffRequest) Execute() (*GraphGraphDiffOut, *http.Response, error) {
return r.ApiService.GraphDiffExecute(r)
}
/*
GraphDiff Reports what came into force, was superseded and was retracted between two points.
Reports what came into force, was superseded and was retracted between
two points.
Each point is resolved as resolve would, never read off the rows in between.
A version that loses the order is invisible here as it is there, and one that
repeats what held is agreement, not change.
Time: a point is an as_of and an as_known instant, from and from_known against
to and to_known. Hold the known instants equal for what happened in the world;
hold the valid instants equal for what the record learned. to and to_known
default to now, from to to and from_known to to_known, and the two points must
differ.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphDiffRequest
*/
func (a *GraphAPIService) GraphDiff(ctx context.Context) GraphAPIGraphDiffRequest {
return GraphAPIGraphDiffRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphDiffOut
func (a *GraphAPIService) GraphDiffExecute(r GraphAPIGraphDiffRequest) (*GraphGraphDiffOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphDiffOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphDiff")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/diff"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphDiffIn == nil {
return localVarReturnValue, nil, reportError("graphGraphDiffIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphDiffIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphEntityRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphEntityIn *GraphGraphEntityIn
}
func (r GraphAPIGraphEntityRequest) GraphGraphEntityIn(graphGraphEntityIn GraphGraphEntityIn) GraphAPIGraphEntityRequest {
r.graphGraphEntityIn = &graphGraphEntityIn
return r
}
func (r GraphAPIGraphEntityRequest) Execute() (*GraphGraphEntityOut, *http.Response, error) {
return r.ApiService.GraphEntityExecute(r)
}
/*
GraphEntity Resolves the complete state of one entity at a point: its type, its holding properties and edges in both directions, its kinship scorecard and the expired statements it no longer holds.
Resolves the complete state of one entity at a point: its type, its
holding properties and edges in both directions, its kinship scorecard and
the expired statements it no longer holds.
Each (entity, relation) pair is settled by the same Resolve rule as
graphResolve. Statements begun by the point that lost to a retraction, an
until or a newer value are returned in expired rather than discarded.
Time: as_of is the instant of the world asked about and as_known how much this
plane had heard by then; either absent is now.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphEntityRequest
*/
func (a *GraphAPIService) GraphEntity(ctx context.Context) GraphAPIGraphEntityRequest {
return GraphAPIGraphEntityRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphEntityOut
func (a *GraphAPIService) GraphEntityExecute(r GraphAPIGraphEntityRequest) (*GraphGraphEntityOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphEntityOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphEntity")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/entity"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphEntityIn == nil {
return localVarReturnValue, nil, reportError("graphGraphEntityIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphEntityIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphEraseRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphEraseIn *GraphGraphEraseIn
}
func (r GraphAPIGraphEraseRequest) GraphGraphEraseIn(graphGraphEraseIn GraphGraphEraseIn) GraphAPIGraphEraseRequest {
r.graphGraphEraseIn = &graphGraphEraseIn
return r
}
func (r GraphAPIGraphEraseRequest) Execute() (*GraphGraphEraseOut, *http.Response, error) {
return r.ApiService.GraphEraseExecute(r)
}
/*
GraphErase Removes every assertion that names an entity and returns a receipt.
Removes every assertion that names an entity and returns a receipt.
It requires an admin of the organization it acts in; platform sudo is not
enough, so erasure is never cross-tenant. Nothing is removed while a matching
assertion is under litigation hold (409) or where the erasure cannot be
recorded (503). The audit trail keeps who, when, why, how many and the
receipt's digest, never the entity, and holds it before the erasure commits.
Time: erasure is the one act outside the two times. The rows go at every
as_of and as_known, so no past read recovers them.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphEraseRequest
*/
func (a *GraphAPIService) GraphErase(ctx context.Context) GraphAPIGraphEraseRequest {
return GraphAPIGraphEraseRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphEraseOut
func (a *GraphAPIService) GraphEraseExecute(r GraphAPIGraphEraseRequest) (*GraphGraphEraseOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphEraseOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphErase")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/erase"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphEraseIn == nil {
return localVarReturnValue, nil, reportError("graphGraphEraseIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphEraseIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphExtractRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphSourceIn *GraphGraphSourceIn
}
func (r GraphAPIGraphExtractRequest) GraphGraphSourceIn(graphGraphSourceIn GraphGraphSourceIn) GraphAPIGraphExtractRequest {
r.graphGraphSourceIn = &graphGraphSourceIn
return r
}
func (r GraphAPIGraphExtractRequest) Execute() (*GraphGraphExtractOut, *http.Response, error) {
return r.ApiService.GraphExtractExecute(r)
}
/*
GraphExtract Reads the relations a source states and returns them, recording nothing.
Reads the relations a source states and returns them, recording
nothing.
A line `relation:: value` states one; a value written `[[key]]` names an
entity and makes the relation an edge. The subject is the nearest heading
above the line, or the request's subject until a heading names one.
What filing would refuse is returned apart, in refused: a declaration from a
caller who is not an admin of the organization, and what the declared schema
refuses, checked against the store and against the types and declarations the
document itself states that the caller may file.
Time: it records nothing and takes no as_of or as_known; the schema is checked
as of now.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphExtractRequest
*/
func (a *GraphAPIService) GraphExtract(ctx context.Context) GraphAPIGraphExtractRequest {
return GraphAPIGraphExtractRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphExtractOut
func (a *GraphAPIService) GraphExtractExecute(r GraphAPIGraphExtractRequest) (*GraphGraphExtractOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphExtractOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphExtract")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/extract"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphSourceIn == nil {
return localVarReturnValue, nil, reportError("graphGraphSourceIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphSourceIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphIngestRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphSourceIn *GraphGraphSourceIn
}
func (r GraphAPIGraphIngestRequest) GraphGraphSourceIn(graphGraphSourceIn GraphGraphSourceIn) GraphAPIGraphIngestRequest {
r.graphGraphSourceIn = &graphGraphSourceIn
return r
}
func (r GraphAPIGraphIngestRequest) Execute() (*GraphGraphAssertOut, *http.Response, error) {
return r.ApiService.GraphIngestExecute(r)
}
/*
GraphIngest Reads a source and records what it states, through the same admission as assert.
Reads a source and records what it states, through the same
admission as assert.
Each assertion's evidence is the section that stated it, `<source>#<section>`,
so the same source at the same at records one set of rows however often it is
delivered. What extract reports refused is not recorded; it is counted as
refused, with its reason, in the order the document states it. A source
stating no relation is refused whole.
Time: at is the valid time of every assertion recorded, which an as_of read is
bounded by; each becomes knowable at the write, so a read with an earlier
as_known does not see it.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphIngestRequest
*/
func (a *GraphAPIService) GraphIngest(ctx context.Context) GraphAPIGraphIngestRequest {
return GraphAPIGraphIngestRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphAssertOut
func (a *GraphAPIService) GraphIngestExecute(r GraphAPIGraphIngestRequest) (*GraphGraphAssertOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphAssertOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphIngest")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/ingest"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphSourceIn == nil {
return localVarReturnValue, nil, reportError("graphGraphSourceIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphSourceIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphNeighborsRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphNeighborsIn *GraphGraphNeighborsIn
}
func (r GraphAPIGraphNeighborsRequest) GraphGraphNeighborsIn(graphGraphNeighborsIn GraphGraphNeighborsIn) GraphAPIGraphNeighborsRequest {
r.graphGraphNeighborsIn = &graphGraphNeighborsIn
return r
}
func (r GraphAPIGraphNeighborsRequest) Execute() (*GraphGraphNeighborsOut, *http.Response, error) {
return r.ApiService.GraphNeighborsExecute(r)
}
/*
GraphNeighbors Walks the in-force edges from a set of seeds and lists every entity reached, bounded.
Walks the in-force edges from a set of seeds and lists every
entity reached, bounded.
Only the edge that holds at the point is a hop: a superseded or retracted
edge is not, and neither is a property.
Time: as_of walks the graph as it stood at that instant and as_known as this
plane knew it then; either absent is now.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphNeighborsRequest
*/
func (a *GraphAPIService) GraphNeighbors(ctx context.Context) GraphAPIGraphNeighborsRequest {
return GraphAPIGraphNeighborsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphNeighborsOut
func (a *GraphAPIService) GraphNeighborsExecute(r GraphAPIGraphNeighborsRequest) (*GraphGraphNeighborsOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphNeighborsOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphNeighbors")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/neighbors"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphNeighborsIn == nil {
return localVarReturnValue, nil, reportError("graphGraphNeighborsIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphNeighborsIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphOntologyRequest struct {
ctx context.Context
ApiService *GraphAPIService
group *string
q *string
}
// Group narrows classes or features to one group, such as core, person, activity, edge, identity, communication or photos. Absent returns every group.
func (r GraphAPIGraphOntologyRequest) Group(group string) GraphAPIGraphOntologyRequest {
r.group = &group
return r
}
// Q narrows classes, predicates and features to entries whose code, label, canonical relation or source contains this substring, case-insensitively. Absent returns the whole catalog.
func (r GraphAPIGraphOntologyRequest) Q(q string) GraphAPIGraphOntologyRequest {
r.q = &q
return r
}
func (r GraphAPIGraphOntologyRequest) Execute() (*GraphGraphOntologyOut, *http.Response, error) {
return r.ApiService.GraphOntologyExecute(r)
}
/*
GraphOntology Lists the entity classes, predicates, classifier features and kinship scorecard columns of the personal knowledge graph ontology.
Lists the entity classes, predicates, classifier features and
kinship scorecard columns of the personal knowledge graph ontology.
Every code graph.db and entityTagging.db write on macOS and iOS is here with
its plain-language reading and the canonical relation key graphApple maps it
to. Filter by group or by substring q.
Time: it takes no as_of or as_known; the shipped catalog is static.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphOntologyRequest
*/
func (a *GraphAPIService) GraphOntology(ctx context.Context) GraphAPIGraphOntologyRequest {
return GraphAPIGraphOntologyRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphOntologyOut
func (a *GraphAPIService) GraphOntologyExecute(r GraphAPIGraphOntologyRequest) (*GraphGraphOntologyOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphOntologyOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphOntology")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/ontology"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.group != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "group", r.group, "form", "")
}
if r.q != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphPathRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphPathIn *GraphGraphPathIn
}
func (r GraphAPIGraphPathRequest) GraphGraphPathIn(graphGraphPathIn GraphGraphPathIn) GraphAPIGraphPathRequest {
r.graphGraphPathIn = &graphGraphPathIn
return r
}
func (r GraphAPIGraphPathRequest) Execute() (*GraphGraphPathOut, *http.Response, error) {
return r.ApiService.GraphPathExecute(r)
}
/*
GraphPath Finds the shortest chain of in-force edges from one entity to another.
Finds the shortest chain of in-force edges from one entity to another.
It is the walk behind neighbors stopped at a goal: the same bound and the same
rule for which edge is in force. A causal chain is this op with relations
naming the relations that mean cause, such as caused_by and influenced.
Time: as_of and as_known place the graph the path is found in; either absent
is now.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphPathRequest
*/
func (a *GraphAPIService) GraphPath(ctx context.Context) GraphAPIGraphPathRequest {
return GraphAPIGraphPathRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphPathOut
func (a *GraphAPIService) GraphPathExecute(r GraphAPIGraphPathRequest) (*GraphGraphPathOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphPathOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphPath")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/path"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphPathIn == nil {
return localVarReturnValue, nil, reportError("graphGraphPathIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphPathIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphReadRequest struct {
ctx context.Context
ApiService *GraphAPIService
entity *string
relation *string
value *string
asOf *string
asKnown *string
limit *int64
}
// Entity narrows to what was asserted ABOUT one entity. Absent matches every entity.
func (r GraphAPIGraphReadRequest) Entity(entity string) GraphAPIGraphReadRequest {
r.entity = &entity
return r
}
// Relation narrows to one relation. Absent matches every relation.
func (r GraphAPIGraphReadRequest) Relation(relation string) GraphAPIGraphReadRequest {
r.relation = &relation
return r
}
// Value narrows to assertions pointing AT one value, which is how the edges into an entity are read. A property&#39;s scalar is matched byte for byte and an edge&#39;s value by its key, folded as every key is.
func (r GraphAPIGraphReadRequest) Value(value string) GraphAPIGraphReadRequest {
r.value = &value
return r
}
// AsOf bounds the read to statements begun by an instant of the world, RFC 3339. Absent reads every instant.
func (r GraphAPIGraphReadRequest) AsOf(asOf string) GraphAPIGraphReadRequest {
r.asOf = &asOf
return r
}
// AsKnown bounds the read to what this plane had heard by an instant, RFC 3339. Absent reads everything it holds.
func (r GraphAPIGraphReadRequest) AsKnown(asKnown string) GraphAPIGraphReadRequest {
r.asKnown = &asKnown
return r
}
// Limit caps how many assertions come back. Absent, zero, or anything above the walk ceiling is the ceiling.
func (r GraphAPIGraphReadRequest) Limit(limit int64) GraphAPIGraphReadRequest {
r.limit = &limit
return r
}
func (r GraphAPIGraphReadRequest) Execute() (*GraphGraphReadOut, *http.Response, error) {
return r.ApiService.GraphReadExecute(r)
}
/*
GraphRead Lists the assertions recorded, every version, oldest first.
Lists the assertions recorded, every version, oldest first.
It resolves nothing: a superseded claim and the one that superseded it both
appear.
Time: as_of keeps statements begun by that instant of the world and as_known
keeps what this plane had heard by then; either absent is no bound.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphReadRequest
*/
func (a *GraphAPIService) GraphRead(ctx context.Context) GraphAPIGraphReadRequest {
return GraphAPIGraphReadRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphReadOut
func (a *GraphAPIService) GraphReadExecute(r GraphAPIGraphReadRequest) (*GraphGraphReadOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphReadOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphRead")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.entity != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "entity", r.entity, "form", "")
}
if r.relation != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "relation", r.relation, "form", "")
}
if r.value != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "value", r.value, "form", "")
}
if r.asOf != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "as_of", r.asOf, "form", "")
}
if r.asKnown != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "as_known", r.asKnown, "form", "")
}
if r.limit != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphResolveRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphGraphResolveIn *GraphGraphResolveIn
}
func (r GraphAPIGraphResolveRequest) GraphGraphResolveIn(graphGraphResolveIn GraphGraphResolveIn) GraphAPIGraphResolveRequest {
r.graphGraphResolveIn = &graphGraphResolveIn
return r
}
func (r GraphAPIGraphResolveRequest) Execute() (*GraphGraphResolveOut, *http.Response, error) {
return r.ApiService.GraphResolveExecute(r)
}
/*
GraphResolve Answers what holds for one entity and relation at a point, winner first, with every weaker account that disagreed.
Answers what holds for one entity and relation at a point, winner
first, with every weaker account that disagreed.
The winner is the holding statement begun most recently, then the strongest
under the rule vocabulary names. A relation that holds many values answers
each; a disagreement is reported as contested, never resolved into silence.
Time: as_of is the instant of the world asked about and as_known how much this
plane had heard; either absent is now.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphResolveRequest
*/
func (a *GraphAPIService) GraphResolve(ctx context.Context) GraphAPIGraphResolveRequest {
return GraphAPIGraphResolveRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphResolveOut
func (a *GraphAPIService) GraphResolveExecute(r GraphAPIGraphResolveRequest) (*GraphGraphResolveOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphResolveOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphResolve")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/resolve"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.graphGraphResolveIn == nil {
return localVarReturnValue, nil, reportError("graphGraphResolveIn is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphGraphResolveIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphSearchRequest struct {
ctx context.Context
ApiService *GraphAPIService
q *string
relation *string
asOf *string
asKnown *string
limit *int64
}
// 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.
func (r GraphAPIGraphSearchRequest) Q(q string) GraphAPIGraphSearchRequest {
r.q = &q
return r
}
// Relation narrows to one relation. Absent matches every relation.
func (r GraphAPIGraphSearchRequest) Relation(relation string) GraphAPIGraphSearchRequest {
r.relation = &relation
return r
}
// AsOf bounds the search to statements begun by an instant of the world, RFC 3339. Absent searches every instant.
func (r GraphAPIGraphSearchRequest) AsOf(asOf string) GraphAPIGraphSearchRequest {
r.asOf = &asOf
return r
}
// AsKnown bounds the search to what this plane had heard by an instant, RFC 3339. Absent searches everything it holds.
func (r GraphAPIGraphSearchRequest) AsKnown(asKnown string) GraphAPIGraphSearchRequest {
r.asKnown = &asKnown
return r
}
// Limit caps how many assertions come back. Absent, zero, or anything above the walk ceiling is the ceiling.
func (r GraphAPIGraphSearchRequest) Limit(limit int64) GraphAPIGraphSearchRequest {
r.limit = &limit
return r
}
func (r GraphAPIGraphSearchRequest) Execute() (*GraphGraphReadOut, *http.Response, error) {
return r.ApiService.GraphSearchExecute(r)
}
/*
GraphSearch Finds assertions by their words, where read finds them by their keys, best match first.
Finds assertions by their words, where read finds them by their keys,
best match first.
Every word must match, as a prefix. The answer is ordered by bm25, which
weighs a word by how rare it is and a row by how much of it the words are, so
a limit keeps the best matches rather than the oldest. It resolves nothing, so
a match may be a claim later corrected; ask resolve about what it finds.
Time: as_of and as_known bound it exactly as they bound read; either absent is
no bound.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphSearchRequest
*/
func (a *GraphAPIService) GraphSearch(ctx context.Context) GraphAPIGraphSearchRequest {
return GraphAPIGraphSearchRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphReadOut
func (a *GraphAPIService) GraphSearchExecute(r GraphAPIGraphSearchRequest) (*GraphGraphReadOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphReadOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphSearch")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/search"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.q == nil {
return localVarReturnValue, nil, reportError("q is required and must be specified")
}
parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "form", "")
if r.relation != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "relation", r.relation, "form", "")
}
if r.asOf != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "as_of", r.asOf, "form", "")
}
if r.asKnown != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "as_known", r.asKnown, "form", "")
}
if r.limit != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIGraphVocabularyRequest struct {
ctx context.Context
ApiService *GraphAPIService
}
func (r GraphAPIGraphVocabularyRequest) Execute() (*GraphGraphVocabularyOut, *http.Response, error) {
return r.ApiService.GraphVocabularyExecute(r)
}
/*
GraphVocabulary Lists the relations in use, the schema declared for them and the rule that settles a conflict.
Lists the relations in use, the schema declared for them and the
rule that settles a conflict.
Time: it takes no as_of or as_known; the schema is the one in force now.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIGraphVocabularyRequest
*/
func (a *GraphAPIService) GraphVocabulary(ctx context.Context) GraphAPIGraphVocabularyRequest {
return GraphAPIGraphVocabularyRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphGraphVocabularyOut
func (a *GraphAPIService) GraphVocabularyExecute(r GraphAPIGraphVocabularyRequest) (*GraphGraphVocabularyOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphGraphVocabularyOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.GraphVocabulary")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/vocabulary"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type GraphAPIPostGraphGraphqlRequest struct {
ctx context.Context
ApiService *GraphAPIService
graphQLIn *GraphQLIn
}
func (r GraphAPIPostGraphGraphqlRequest) GraphQLIn(graphQLIn GraphQLIn) GraphAPIPostGraphGraphqlRequest {
r.graphQLIn = &graphQLIn
return r
}
func (r GraphAPIPostGraphGraphqlRequest) Execute() (*GraphQLOut, *http.Response, error) {
return r.ApiService.PostGraphGraphqlExecute(r)
}
/*
PostGraphGraphql Ask the graph in one request, traversing.
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 GET at this same address, and introspection is not.
A query that ran answers 200 with each failure in an `errors` list beside the data, which is the wire every GraphQL client parses; one that could not begin — it does not parse, or names a fragment it does not define — answers 400 with the reason and no data. `edges` nest at most three deep, refused before any operation runs, and one root field's edges answer at most 1000 entities.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return GraphAPIPostGraphGraphqlRequest
*/
func (a *GraphAPIService) PostGraphGraphql(ctx context.Context) GraphAPIPostGraphGraphqlRequest {
return GraphAPIPostGraphGraphqlRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return GraphQLOut
func (a *GraphAPIService) PostGraphGraphqlExecute(r GraphAPIPostGraphGraphqlRequest) (*GraphQLOut, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GraphQLOut
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GraphAPIService.PostGraphGraphql")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/graph/graphql"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.graphQLIn
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}