feat: use official go generator for Go client (#377)

* ci: add Go client integration tests

Add test-go-client job to CI workflow following the same pattern as
Python, TypeScript, and Rust client tests. The job:
- Sets up Go 1.23 with dependency caching
- Starts the Hindsight API server
- Runs integration tests using the 'integration' build tag
- Displays server logs on failure

The integration tests (hindsight-clients/go/integration_test.go) cover
all core operations: retain, recall, reflect, bank management, and
end-to-end workflows.

* Move Go cookbook content to hindsight-cookbook repo

Removes Go-specific cookbook content that was added in PR #375:
- applications/go-memory-service.md
- recipes/go-quickstart.md
- recipes/go-concurrent-pipeline.md

These have been moved to the hindsight-cookbook repository where
cookbook content should live per project conventions.

* feat(go): add CI test for Go client and patch for ogen null handling

- Add test-go-client job to GitHub Actions CI workflow
- Create post-generation patch script (patch-ogen.sh) to fix ogen's
  handling of null values in optional string fields
- Patch OptString.Decode() to check jx.Next() type before decoding,
  properly handling explicit null in JSON responses

The patch ensures generated code persists across regenerations and
handles the Hindsight API's nullable optional fields correctly.

Fixes: Go client integration tests for retain and bank operations
Note: Some tests still fail for nullable arrays/objects - those
require additional patches for other Opt* types.

* feat: use official go generator for Go client

* feat: use official go generator for Go client

* ci fixes

* chore: sync Go client with latest OpenAPI spec

- Add model_child_operation_status.go (new model)
- Update model_operation_status_response.go with child operations
- Update go.mod/go.sum dependencies
- Update api/openapi.yaml
This commit is contained in:
Nicolò Boschi 2026-02-16 14:04:12 +01:00 committed by GitHub
parent 40d42c58aa
commit 6e30980add
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
137 changed files with 32086 additions and 31249 deletions

View file

@ -648,6 +648,80 @@ jobs:
echo "=== API Server Logs ==="
cat /tmp/api-server.log || echo "No API server log found"
test-go-client:
runs-on: ubuntu-latest
env:
HINDSIGHT_API_LLM_PROVIDER: groq
HINDSIGHT_API_LLM_API_KEY: ${{ secrets.GROQ_API_KEY }}
HINDSIGHT_API_LLM_MODEL: openai/gpt-oss-20b
HINDSIGHT_API_URL: http://localhost:8888
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Prefer CPU-only PyTorch in CI (but keep PyPI for everything else)
UV_INDEX: pytorch=https://download.pytorch.org/whl/cpu
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
prune-cache: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache-dependency-path: hindsight-clients/go/go.sum
- name: Build API
working-directory: ./hindsight-api
run: uv build
- name: Install API dependencies
working-directory: ./hindsight-api
run: uv sync --frozen --no-install-project --index-strategy unsafe-best-match
- name: Create .env file
run: |
cat > .env << EOF
HINDSIGHT_API_LLM_PROVIDER=${{ env.HINDSIGHT_API_LLM_PROVIDER }}
HINDSIGHT_API_LLM_API_KEY=${{ env.HINDSIGHT_API_LLM_API_KEY }}
HINDSIGHT_API_LLM_MODEL=${{ env.HINDSIGHT_API_LLM_MODEL }}
EOF
- name: Start API server
run: |
./scripts/dev/start-api.sh > /tmp/api-server.log 2>&1 &
echo "Waiting for API server to be ready..."
for i in {1..60}; do
if curl -sf http://localhost:8888/health > /dev/null 2>&1; then
echo "API server is ready after ${i}s"
break
fi
if [ $i -eq 60 ]; then
echo "API server failed to start after 60s"
cat /tmp/api-server.log
exit 1
fi
sleep 1
done
- name: Run Go client tests
working-directory: ./hindsight-clients/go
run: go test -v -tags=integration
- name: Show API server logs
if: always()
run: |
echo "=== API Server Logs ==="
cat /tmp/api-server.log || echo "No API server log found"
test-integration:
runs-on: ubuntu-latest
env:

24
hindsight-clients/go/.gitignore vendored Normal file
View file

@ -0,0 +1,24 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof

View file

@ -1,178 +1,226 @@
# Hindsight Go Client
# Go API client for hindsight
Go client for the [Hindsight](https://github.com/vectorize-io/hindsight) agent memory API.
HTTP API for Hindsight
## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
- API version: 0.4.11
- Package version: 1.0.0
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
## Installation
```bash
go get github.com/vectorize-io/hindsight-client-go
Install the following dependencies:
```sh
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
```
Requires Go 1.25+.
## Quick Start
Put the package under your project folder and add the following in import:
```go
package main
import (
"context"
"fmt"
"log"
hindsight "github.com/vectorize-io/hindsight-client-go"
)
func main() {
client, err := hindsight.New("http://localhost:8888")
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
// Store a memory
_, err = client.Retain(ctx, "my-bank", "The user prefers dark mode")
if err != nil {
log.Fatal(err)
}
// Recall memories
resp, err := client.Recall(ctx, "my-bank", "What are the user's preferences?")
if err != nil {
log.Fatal(err)
}
for _, r := range resp.Results {
fmt.Println(r.Text)
}
// Reflect with reasoning
ref, err := client.Reflect(ctx, "my-bank", "Summarize what you know about the user")
if err != nil {
log.Fatal(err)
}
fmt.Println(ref.Text)
}
import hindsight "github.com/vectorize-io/hindsight-client-go"
```
## Authentication
To use a proxy, set the environment variable `HTTP_PROXY`:
```go
client, err := hindsight.New("http://localhost:8888", hindsight.WithAPIKey("your-key"))
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```
## Core Operations
## Configuration of Server URL
### Retain (Store Memories)
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.
### Select Server Configuration
For using other server than the one defined on index 0 set context value `hindsight.ContextServerIndex` of type `int`.
```go
// Single memory
_, err := client.Retain(ctx, "bank-id", "Alice loves Python",
hindsight.WithContext("programming discussion"),
hindsight.WithTags([]string{"tech"}),
hindsight.WithDocumentID("conv-123"),
)
// Batch
items := []hindsight.MemoryItem{
{Content: "First memory"},
{Content: "Second memory"},
}
_, err := client.RetainBatch(ctx, "bank-id", items,
hindsight.WithDocumentTags([]string{"import"}),
hindsight.WithAsync(true),
)
ctx := context.WithValue(context.Background(), hindsight.ContextServerIndex, 1)
```
### Recall (Retrieve Memories)
### Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value `hindsight.ContextServerVariables` of type `map[string]string`.
```go
resp, err := client.Recall(ctx, "bank-id", "What does Alice like?",
hindsight.WithBudget(hindsight.BudgetHigh),
hindsight.WithMaxTokens(4096),
hindsight.WithTypes([]string{"world", "experience"}),
hindsight.WithTrace(true),
hindsight.WithRecallTags([]string{"tech"}),
)
for _, r := range resp.Results {
fmt.Printf("[%s] %s\n", r.Type.Or("unknown"), r.Text)
}
```
### Reflect (Reason with Memories)
```go
resp, err := client.Reflect(ctx, "bank-id", "What are the user's interests?",
hindsight.WithReflectBudget(hindsight.BudgetMid),
hindsight.WithReflectMaxTokens(2048),
hindsight.WithResponseSchema(map[string]any{
"type": "object",
"properties": map[string]any{
"interests": map[string]any{"type": "array", "items": map[string]any{"type": "string"}},
},
}),
)
fmt.Println(resp.Text)
```
### Bank Management
```go
// Create bank with personality
_, err := client.CreateBank(ctx, "my-bank",
hindsight.WithBankName("My Agent"),
hindsight.WithMission("Help users with coding tasks"),
hindsight.WithDisposition(hindsight.DispositionTraits{
Skepticism: 3,
Literalism: 2,
Empathy: 4,
}),
)
// Update mission
_, err = client.SetMission(ctx, "my-bank", "New mission statement")
// List all banks
banks, err := client.ListBanks(ctx)
// Delete bank
err = client.DeleteBank(ctx, "my-bank")
```
## Advanced Usage
For operations not covered by the high-level wrapper (documents, entities, operations, mental models, directives), access the ogen-generated client directly:
```go
ogen := client.OgenClient()
// List entities
resp, err := ogen.ListEntities(ctx, ogenapi.ListEntitiesParams{
BankID: "my-bank",
ctx := context.WithValue(context.Background(), hindsight.ContextServerVariables, map[string]string{
"basePath": "v2",
})
// Create mental model
resp, err := ogen.CreateMentalModel(ctx, &ogenapi.CreateMentalModelRequest{
Name: "user-preferences",
SourceQuery: "What are the user's preferences?",
}, ogenapi.CreateMentalModelParams{BankID: "my-bank"})
```
## Code Generation
Note, enum values are always validated and all unused variables are silently ignored.
The client is built on [ogen](https://github.com/ogen-go/ogen), generating strongly-typed Go code from the OpenAPI 3.1 spec. To regenerate after API changes:
### URLs Configuration per Operation
```bash
cd hindsight-clients/go
go generate ./...
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `hindsight.ContextOperationServerIndices` and `hindsight.ContextOperationServerVariables` context maps.
```go
ctx := context.WithValue(context.Background(), hindsight.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), hindsight.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
```
## Running Tests
## Documentation for API Endpoints
All URIs are relative to *http://localhost*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BanksAPI* | [**AddBankBackground**](docs/BanksAPI.md#addbankbackground) | **Post** /v1/default/banks/{bank_id}/background | Add/merge memory bank background (deprecated)
*BanksAPI* | [**ClearObservations**](docs/BanksAPI.md#clearobservations) | **Delete** /v1/default/banks/{bank_id}/observations | Clear all observations
*BanksAPI* | [**CreateOrUpdateBank**](docs/BanksAPI.md#createorupdatebank) | **Put** /v1/default/banks/{bank_id} | Create or update memory bank
*BanksAPI* | [**DeleteBank**](docs/BanksAPI.md#deletebank) | **Delete** /v1/default/banks/{bank_id} | Delete memory bank
*BanksAPI* | [**GetAgentStats**](docs/BanksAPI.md#getagentstats) | **Get** /v1/default/banks/{bank_id}/stats | Get statistics for memory bank
*BanksAPI* | [**GetBankConfig**](docs/BanksAPI.md#getbankconfig) | **Get** /v1/default/banks/{bank_id}/config | Get bank configuration
*BanksAPI* | [**GetBankProfile**](docs/BanksAPI.md#getbankprofile) | **Get** /v1/default/banks/{bank_id}/profile | Get memory bank profile
*BanksAPI* | [**ListBanks**](docs/BanksAPI.md#listbanks) | **Get** /v1/default/banks | List all memory banks
*BanksAPI* | [**ResetBankConfig**](docs/BanksAPI.md#resetbankconfig) | **Delete** /v1/default/banks/{bank_id}/config | Reset bank configuration
*BanksAPI* | [**TriggerConsolidation**](docs/BanksAPI.md#triggerconsolidation) | **Post** /v1/default/banks/{bank_id}/consolidate | Trigger consolidation
*BanksAPI* | [**UpdateBank**](docs/BanksAPI.md#updatebank) | **Patch** /v1/default/banks/{bank_id} | Partial update memory bank
*BanksAPI* | [**UpdateBankConfig**](docs/BanksAPI.md#updatebankconfig) | **Patch** /v1/default/banks/{bank_id}/config | Update bank configuration
*BanksAPI* | [**UpdateBankDisposition**](docs/BanksAPI.md#updatebankdisposition) | **Put** /v1/default/banks/{bank_id}/profile | Update memory bank disposition
*DirectivesAPI* | [**CreateDirective**](docs/DirectivesAPI.md#createdirective) | **Post** /v1/default/banks/{bank_id}/directives | Create directive
*DirectivesAPI* | [**DeleteDirective**](docs/DirectivesAPI.md#deletedirective) | **Delete** /v1/default/banks/{bank_id}/directives/{directive_id} | Delete directive
*DirectivesAPI* | [**GetDirective**](docs/DirectivesAPI.md#getdirective) | **Get** /v1/default/banks/{bank_id}/directives/{directive_id} | Get directive
*DirectivesAPI* | [**ListDirectives**](docs/DirectivesAPI.md#listdirectives) | **Get** /v1/default/banks/{bank_id}/directives | List directives
*DirectivesAPI* | [**UpdateDirective**](docs/DirectivesAPI.md#updatedirective) | **Patch** /v1/default/banks/{bank_id}/directives/{directive_id} | Update directive
*DocumentsAPI* | [**DeleteDocument**](docs/DocumentsAPI.md#deletedocument) | **Delete** /v1/default/banks/{bank_id}/documents/{document_id} | Delete a document
*DocumentsAPI* | [**GetChunk**](docs/DocumentsAPI.md#getchunk) | **Get** /v1/default/chunks/{chunk_id} | Get chunk details
*DocumentsAPI* | [**GetDocument**](docs/DocumentsAPI.md#getdocument) | **Get** /v1/default/banks/{bank_id}/documents/{document_id} | Get document details
*DocumentsAPI* | [**ListDocuments**](docs/DocumentsAPI.md#listdocuments) | **Get** /v1/default/banks/{bank_id}/documents | List documents
*EntitiesAPI* | [**GetEntity**](docs/EntitiesAPI.md#getentity) | **Get** /v1/default/banks/{bank_id}/entities/{entity_id} | Get entity details
*EntitiesAPI* | [**ListEntities**](docs/EntitiesAPI.md#listentities) | **Get** /v1/default/banks/{bank_id}/entities | List entities
*EntitiesAPI* | [**RegenerateEntityObservations**](docs/EntitiesAPI.md#regenerateentityobservations) | **Post** /v1/default/banks/{bank_id}/entities/{entity_id}/regenerate | Regenerate entity observations (deprecated)
*MemoryAPI* | [**ClearBankMemories**](docs/MemoryAPI.md#clearbankmemories) | **Delete** /v1/default/banks/{bank_id}/memories | Clear memory bank memories
*MemoryAPI* | [**GetGraph**](docs/MemoryAPI.md#getgraph) | **Get** /v1/default/banks/{bank_id}/graph | Get memory graph data
*MemoryAPI* | [**GetMemory**](docs/MemoryAPI.md#getmemory) | **Get** /v1/default/banks/{bank_id}/memories/{memory_id} | Get memory unit
*MemoryAPI* | [**ListMemories**](docs/MemoryAPI.md#listmemories) | **Get** /v1/default/banks/{bank_id}/memories/list | List memory units
*MemoryAPI* | [**ListTags**](docs/MemoryAPI.md#listtags) | **Get** /v1/default/banks/{bank_id}/tags | List tags
*MemoryAPI* | [**RecallMemories**](docs/MemoryAPI.md#recallmemories) | **Post** /v1/default/banks/{bank_id}/memories/recall | Recall memory
*MemoryAPI* | [**Reflect**](docs/MemoryAPI.md#reflect) | **Post** /v1/default/banks/{bank_id}/reflect | Reflect and generate answer
*MemoryAPI* | [**RetainMemories**](docs/MemoryAPI.md#retainmemories) | **Post** /v1/default/banks/{bank_id}/memories | Retain memories
*MentalModelsAPI* | [**CreateMentalModel**](docs/MentalModelsAPI.md#creatementalmodel) | **Post** /v1/default/banks/{bank_id}/mental-models | Create mental model
*MentalModelsAPI* | [**DeleteMentalModel**](docs/MentalModelsAPI.md#deletementalmodel) | **Delete** /v1/default/banks/{bank_id}/mental-models/{mental_model_id} | Delete mental model
*MentalModelsAPI* | [**GetMentalModel**](docs/MentalModelsAPI.md#getmentalmodel) | **Get** /v1/default/banks/{bank_id}/mental-models/{mental_model_id} | Get mental model
*MentalModelsAPI* | [**ListMentalModels**](docs/MentalModelsAPI.md#listmentalmodels) | **Get** /v1/default/banks/{bank_id}/mental-models | List mental models
*MentalModelsAPI* | [**RefreshMentalModel**](docs/MentalModelsAPI.md#refreshmentalmodel) | **Post** /v1/default/banks/{bank_id}/mental-models/{mental_model_id}/refresh | Refresh mental model
*MentalModelsAPI* | [**UpdateMentalModel**](docs/MentalModelsAPI.md#updatementalmodel) | **Patch** /v1/default/banks/{bank_id}/mental-models/{mental_model_id} | Update mental model
*MonitoringAPI* | [**GetVersion**](docs/MonitoringAPI.md#getversion) | **Get** /version | Get API version and feature flags
*MonitoringAPI* | [**HealthEndpointHealthGet**](docs/MonitoringAPI.md#healthendpointhealthget) | **Get** /health | Health check endpoint
*MonitoringAPI* | [**MetricsEndpointMetricsGet**](docs/MonitoringAPI.md#metricsendpointmetricsget) | **Get** /metrics | Prometheus metrics endpoint
*OperationsAPI* | [**CancelOperation**](docs/OperationsAPI.md#canceloperation) | **Delete** /v1/default/banks/{bank_id}/operations/{operation_id} | Cancel a pending async operation
*OperationsAPI* | [**GetOperationStatus**](docs/OperationsAPI.md#getoperationstatus) | **Get** /v1/default/banks/{bank_id}/operations/{operation_id} | Get operation status
*OperationsAPI* | [**ListOperations**](docs/OperationsAPI.md#listoperations) | **Get** /v1/default/banks/{bank_id}/operations | List async operations
## Documentation For Models
- [AddBackgroundRequest](docs/AddBackgroundRequest.md)
- [AsyncOperationSubmitResponse](docs/AsyncOperationSubmitResponse.md)
- [BackgroundResponse](docs/BackgroundResponse.md)
- [BankConfigResponse](docs/BankConfigResponse.md)
- [BankConfigUpdate](docs/BankConfigUpdate.md)
- [BankListItem](docs/BankListItem.md)
- [BankListResponse](docs/BankListResponse.md)
- [BankProfileResponse](docs/BankProfileResponse.md)
- [BankStatsResponse](docs/BankStatsResponse.md)
- [Budget](docs/Budget.md)
- [CancelOperationResponse](docs/CancelOperationResponse.md)
- [ChunkData](docs/ChunkData.md)
- [ChunkIncludeOptions](docs/ChunkIncludeOptions.md)
- [ChunkResponse](docs/ChunkResponse.md)
- [ConsolidationResponse](docs/ConsolidationResponse.md)
- [CreateBankRequest](docs/CreateBankRequest.md)
- [CreateDirectiveRequest](docs/CreateDirectiveRequest.md)
- [CreateMentalModelRequest](docs/CreateMentalModelRequest.md)
- [CreateMentalModelResponse](docs/CreateMentalModelResponse.md)
- [DeleteDocumentResponse](docs/DeleteDocumentResponse.md)
- [DeleteResponse](docs/DeleteResponse.md)
- [DirectiveListResponse](docs/DirectiveListResponse.md)
- [DirectiveResponse](docs/DirectiveResponse.md)
- [DispositionTraits](docs/DispositionTraits.md)
- [DocumentResponse](docs/DocumentResponse.md)
- [EntityDetailResponse](docs/EntityDetailResponse.md)
- [EntityIncludeOptions](docs/EntityIncludeOptions.md)
- [EntityInput](docs/EntityInput.md)
- [EntityListItem](docs/EntityListItem.md)
- [EntityListResponse](docs/EntityListResponse.md)
- [EntityObservationResponse](docs/EntityObservationResponse.md)
- [EntityStateResponse](docs/EntityStateResponse.md)
- [FeaturesInfo](docs/FeaturesInfo.md)
- [GraphDataResponse](docs/GraphDataResponse.md)
- [HTTPValidationError](docs/HTTPValidationError.md)
- [IncludeOptions](docs/IncludeOptions.md)
- [ListDocumentsResponse](docs/ListDocumentsResponse.md)
- [ListMemoryUnitsResponse](docs/ListMemoryUnitsResponse.md)
- [ListTagsResponse](docs/ListTagsResponse.md)
- [MemoryItem](docs/MemoryItem.md)
- [MentalModelListResponse](docs/MentalModelListResponse.md)
- [MentalModelResponse](docs/MentalModelResponse.md)
- [MentalModelTrigger](docs/MentalModelTrigger.md)
- [OperationResponse](docs/OperationResponse.md)
- [OperationStatusResponse](docs/OperationStatusResponse.md)
- [OperationsListResponse](docs/OperationsListResponse.md)
- [RecallRequest](docs/RecallRequest.md)
- [RecallResponse](docs/RecallResponse.md)
- [RecallResult](docs/RecallResult.md)
- [ReflectBasedOn](docs/ReflectBasedOn.md)
- [ReflectDirective](docs/ReflectDirective.md)
- [ReflectFact](docs/ReflectFact.md)
- [ReflectIncludeOptions](docs/ReflectIncludeOptions.md)
- [ReflectLLMCall](docs/ReflectLLMCall.md)
- [ReflectMentalModel](docs/ReflectMentalModel.md)
- [ReflectRequest](docs/ReflectRequest.md)
- [ReflectResponse](docs/ReflectResponse.md)
- [ReflectToolCall](docs/ReflectToolCall.md)
- [ReflectTrace](docs/ReflectTrace.md)
- [RetainRequest](docs/RetainRequest.md)
- [RetainResponse](docs/RetainResponse.md)
- [TagItem](docs/TagItem.md)
- [TokenUsage](docs/TokenUsage.md)
- [ToolCallsIncludeOptions](docs/ToolCallsIncludeOptions.md)
- [UpdateDirectiveRequest](docs/UpdateDirectiveRequest.md)
- [UpdateDispositionRequest](docs/UpdateDispositionRequest.md)
- [UpdateMentalModelRequest](docs/UpdateMentalModelRequest.md)
- [ValidationError](docs/ValidationError.md)
- [ValidationErrorLocInner](docs/ValidationErrorLocInner.md)
- [VersionResponse](docs/VersionResponse.md)
## Documentation For Authorization
Endpoints do not require authorization.
## Documentation for Utility Methods
Due to the fact that model structure members are all pointers, this package contains
a number of utility functions to easily obtain pointers to values of basic types.
Each of these functions takes a value of the given basic type and returns a pointer to it:
* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`
## Author
Integration tests require a running Hindsight API server:
```bash
HINDSIGHT_API_URL=http://localhost:8888 go test -v -tags=integration ./...
```

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,737 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
"reflect"
)
// DirectivesAPIService DirectivesAPI service
type DirectivesAPIService service
type ApiCreateDirectiveRequest struct {
ctx context.Context
ApiService *DirectivesAPIService
bankId string
createDirectiveRequest *CreateDirectiveRequest
authorization *string
}
func (r ApiCreateDirectiveRequest) CreateDirectiveRequest(createDirectiveRequest CreateDirectiveRequest) ApiCreateDirectiveRequest {
r.createDirectiveRequest = &createDirectiveRequest
return r
}
func (r ApiCreateDirectiveRequest) Authorization(authorization string) ApiCreateDirectiveRequest {
r.authorization = &authorization
return r
}
func (r ApiCreateDirectiveRequest) Execute() (*DirectiveResponse, *http.Response, error) {
return r.ApiService.CreateDirectiveExecute(r)
}
/*
CreateDirective Create directive
Create a hard rule that will be injected into prompts.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@return ApiCreateDirectiveRequest
*/
func (a *DirectivesAPIService) CreateDirective(ctx context.Context, bankId string) ApiCreateDirectiveRequest {
return ApiCreateDirectiveRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
}
}
// Execute executes the request
// @return DirectiveResponse
func (a *DirectivesAPIService) CreateDirectiveExecute(r ApiCreateDirectiveRequest) (*DirectiveResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DirectiveResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DirectivesAPIService.CreateDirective")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/directives"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.createDirectiveRequest == nil {
return localVarReturnValue, nil, reportError("createDirectiveRequest 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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
// body params
localVarPostBody = r.createDirectiveRequest
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiDeleteDirectiveRequest struct {
ctx context.Context
ApiService *DirectivesAPIService
bankId string
directiveId string
authorization *string
}
func (r ApiDeleteDirectiveRequest) Authorization(authorization string) ApiDeleteDirectiveRequest {
r.authorization = &authorization
return r
}
func (r ApiDeleteDirectiveRequest) Execute() (interface{}, *http.Response, error) {
return r.ApiService.DeleteDirectiveExecute(r)
}
/*
DeleteDirective Delete directive
Delete a directive.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param directiveId
@return ApiDeleteDirectiveRequest
*/
func (a *DirectivesAPIService) DeleteDirective(ctx context.Context, bankId string, directiveId string) ApiDeleteDirectiveRequest {
return ApiDeleteDirectiveRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
directiveId: directiveId,
}
}
// Execute executes the request
// @return interface{}
func (a *DirectivesAPIService) DeleteDirectiveExecute(r ApiDeleteDirectiveRequest) (interface{}, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue interface{}
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DirectivesAPIService.DeleteDirective")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/directives/{directive_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"directive_id"+"}", url.PathEscape(parameterValueToString(r.directiveId, "directiveId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiGetDirectiveRequest struct {
ctx context.Context
ApiService *DirectivesAPIService
bankId string
directiveId string
authorization *string
}
func (r ApiGetDirectiveRequest) Authorization(authorization string) ApiGetDirectiveRequest {
r.authorization = &authorization
return r
}
func (r ApiGetDirectiveRequest) Execute() (*DirectiveResponse, *http.Response, error) {
return r.ApiService.GetDirectiveExecute(r)
}
/*
GetDirective Get directive
Get a specific directive by ID.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param directiveId
@return ApiGetDirectiveRequest
*/
func (a *DirectivesAPIService) GetDirective(ctx context.Context, bankId string, directiveId string) ApiGetDirectiveRequest {
return ApiGetDirectiveRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
directiveId: directiveId,
}
}
// Execute executes the request
// @return DirectiveResponse
func (a *DirectivesAPIService) GetDirectiveExecute(r ApiGetDirectiveRequest) (*DirectiveResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DirectiveResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DirectivesAPIService.GetDirective")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/directives/{directive_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"directive_id"+"}", url.PathEscape(parameterValueToString(r.directiveId, "directiveId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiListDirectivesRequest struct {
ctx context.Context
ApiService *DirectivesAPIService
bankId string
tags *[]string
tagsMatch *string
activeOnly *bool
limit *int32
offset *int32
authorization *string
}
// Filter by tags
func (r ApiListDirectivesRequest) Tags(tags []string) ApiListDirectivesRequest {
r.tags = &tags
return r
}
// How to match tags
func (r ApiListDirectivesRequest) TagsMatch(tagsMatch string) ApiListDirectivesRequest {
r.tagsMatch = &tagsMatch
return r
}
// Only return active directives
func (r ApiListDirectivesRequest) ActiveOnly(activeOnly bool) ApiListDirectivesRequest {
r.activeOnly = &activeOnly
return r
}
func (r ApiListDirectivesRequest) Limit(limit int32) ApiListDirectivesRequest {
r.limit = &limit
return r
}
func (r ApiListDirectivesRequest) Offset(offset int32) ApiListDirectivesRequest {
r.offset = &offset
return r
}
func (r ApiListDirectivesRequest) Authorization(authorization string) ApiListDirectivesRequest {
r.authorization = &authorization
return r
}
func (r ApiListDirectivesRequest) Execute() (*DirectiveListResponse, *http.Response, error) {
return r.ApiService.ListDirectivesExecute(r)
}
/*
ListDirectives List directives
List hard rules that are injected into prompts.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@return ApiListDirectivesRequest
*/
func (a *DirectivesAPIService) ListDirectives(ctx context.Context, bankId string) ApiListDirectivesRequest {
return ApiListDirectivesRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
}
}
// Execute executes the request
// @return DirectiveListResponse
func (a *DirectivesAPIService) ListDirectivesExecute(r ApiListDirectivesRequest) (*DirectiveListResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DirectiveListResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DirectivesAPIService.ListDirectives")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/directives"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.tags != nil {
t := *r.tags
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
parameterAddToHeaderOrQuery(localVarQueryParams, "tags", s.Index(i).Interface(), "form", "multi")
}
} else {
parameterAddToHeaderOrQuery(localVarQueryParams, "tags", t, "form", "multi")
}
}
if r.tagsMatch != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "tags_match", r.tagsMatch, "form", "")
} else {
var defaultValue string = "any"
r.tagsMatch = &defaultValue
}
if r.activeOnly != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "active_only", r.activeOnly, "form", "")
} else {
var defaultValue bool = true
r.activeOnly = &defaultValue
}
if r.limit != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "")
} else {
var defaultValue int32 = 100
r.limit = &defaultValue
}
if r.offset != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "")
} else {
var defaultValue int32 = 0
r.offset = &defaultValue
}
// 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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiUpdateDirectiveRequest struct {
ctx context.Context
ApiService *DirectivesAPIService
bankId string
directiveId string
updateDirectiveRequest *UpdateDirectiveRequest
authorization *string
}
func (r ApiUpdateDirectiveRequest) UpdateDirectiveRequest(updateDirectiveRequest UpdateDirectiveRequest) ApiUpdateDirectiveRequest {
r.updateDirectiveRequest = &updateDirectiveRequest
return r
}
func (r ApiUpdateDirectiveRequest) Authorization(authorization string) ApiUpdateDirectiveRequest {
r.authorization = &authorization
return r
}
func (r ApiUpdateDirectiveRequest) Execute() (*DirectiveResponse, *http.Response, error) {
return r.ApiService.UpdateDirectiveExecute(r)
}
/*
UpdateDirective Update directive
Update a directive's properties.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param directiveId
@return ApiUpdateDirectiveRequest
*/
func (a *DirectivesAPIService) UpdateDirective(ctx context.Context, bankId string, directiveId string) ApiUpdateDirectiveRequest {
return ApiUpdateDirectiveRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
directiveId: directiveId,
}
}
// Execute executes the request
// @return DirectiveResponse
func (a *DirectivesAPIService) UpdateDirectiveExecute(r ApiUpdateDirectiveRequest) (*DirectiveResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DirectiveResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DirectivesAPIService.UpdateDirective")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/directives/{directive_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"directive_id"+"}", url.PathEscape(parameterValueToString(r.directiveId, "directiveId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.updateDirectiveRequest == nil {
return localVarReturnValue, nil, reportError("updateDirectiveRequest 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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
// body params
localVarPostBody = r.updateDirectiveRequest
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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
}

View file

@ -0,0 +1,560 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
)
// DocumentsAPIService DocumentsAPI service
type DocumentsAPIService service
type ApiDeleteDocumentRequest struct {
ctx context.Context
ApiService *DocumentsAPIService
bankId string
documentId string
authorization *string
}
func (r ApiDeleteDocumentRequest) Authorization(authorization string) ApiDeleteDocumentRequest {
r.authorization = &authorization
return r
}
func (r ApiDeleteDocumentRequest) Execute() (*DeleteDocumentResponse, *http.Response, error) {
return r.ApiService.DeleteDocumentExecute(r)
}
/*
DeleteDocument Delete a document
Delete a document and all its associated memory units and links.
This will cascade delete:
- The document itself
- All memory units extracted from this document
- All links (temporal, semantic, entity) associated with those memory units
This operation cannot be undone.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param documentId
@return ApiDeleteDocumentRequest
*/
func (a *DocumentsAPIService) DeleteDocument(ctx context.Context, bankId string, documentId string) ApiDeleteDocumentRequest {
return ApiDeleteDocumentRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
documentId: documentId,
}
}
// Execute executes the request
// @return DeleteDocumentResponse
func (a *DocumentsAPIService) DeleteDocumentExecute(r ApiDeleteDocumentRequest) (*DeleteDocumentResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DeleteDocumentResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DocumentsAPIService.DeleteDocument")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/documents/{document_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"document_id"+"}", url.PathEscape(parameterValueToString(r.documentId, "documentId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiGetChunkRequest struct {
ctx context.Context
ApiService *DocumentsAPIService
chunkId string
authorization *string
}
func (r ApiGetChunkRequest) Authorization(authorization string) ApiGetChunkRequest {
r.authorization = &authorization
return r
}
func (r ApiGetChunkRequest) Execute() (*ChunkResponse, *http.Response, error) {
return r.ApiService.GetChunkExecute(r)
}
/*
GetChunk Get chunk details
Get a specific chunk by its ID
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param chunkId
@return ApiGetChunkRequest
*/
func (a *DocumentsAPIService) GetChunk(ctx context.Context, chunkId string) ApiGetChunkRequest {
return ApiGetChunkRequest{
ApiService: a,
ctx: ctx,
chunkId: chunkId,
}
}
// Execute executes the request
// @return ChunkResponse
func (a *DocumentsAPIService) GetChunkExecute(r ApiGetChunkRequest) (*ChunkResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ChunkResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DocumentsAPIService.GetChunk")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/chunks/{chunk_id}"
localVarPath = strings.Replace(localVarPath, "{"+"chunk_id"+"}", url.PathEscape(parameterValueToString(r.chunkId, "chunkId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiGetDocumentRequest struct {
ctx context.Context
ApiService *DocumentsAPIService
bankId string
documentId string
authorization *string
}
func (r ApiGetDocumentRequest) Authorization(authorization string) ApiGetDocumentRequest {
r.authorization = &authorization
return r
}
func (r ApiGetDocumentRequest) Execute() (*DocumentResponse, *http.Response, error) {
return r.ApiService.GetDocumentExecute(r)
}
/*
GetDocument Get document details
Get a specific document including its original text
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param documentId
@return ApiGetDocumentRequest
*/
func (a *DocumentsAPIService) GetDocument(ctx context.Context, bankId string, documentId string) ApiGetDocumentRequest {
return ApiGetDocumentRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
documentId: documentId,
}
}
// Execute executes the request
// @return DocumentResponse
func (a *DocumentsAPIService) GetDocumentExecute(r ApiGetDocumentRequest) (*DocumentResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DocumentResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DocumentsAPIService.GetDocument")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/documents/{document_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"document_id"+"}", url.PathEscape(parameterValueToString(r.documentId, "documentId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiListDocumentsRequest struct {
ctx context.Context
ApiService *DocumentsAPIService
bankId string
q *string
limit *int32
offset *int32
authorization *string
}
func (r ApiListDocumentsRequest) Q(q string) ApiListDocumentsRequest {
r.q = &q
return r
}
func (r ApiListDocumentsRequest) Limit(limit int32) ApiListDocumentsRequest {
r.limit = &limit
return r
}
func (r ApiListDocumentsRequest) Offset(offset int32) ApiListDocumentsRequest {
r.offset = &offset
return r
}
func (r ApiListDocumentsRequest) Authorization(authorization string) ApiListDocumentsRequest {
r.authorization = &authorization
return r
}
func (r ApiListDocumentsRequest) Execute() (*ListDocumentsResponse, *http.Response, error) {
return r.ApiService.ListDocumentsExecute(r)
}
/*
ListDocuments List documents
List documents with pagination and optional search. Documents are the source content from which memory units are extracted.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@return ApiListDocumentsRequest
*/
func (a *DocumentsAPIService) ListDocuments(ctx context.Context, bankId string) ApiListDocumentsRequest {
return ApiListDocumentsRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
}
}
// Execute executes the request
// @return ListDocumentsResponse
func (a *DocumentsAPIService) ListDocumentsExecute(r ApiListDocumentsRequest) (*ListDocumentsResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ListDocumentsResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DocumentsAPIService.ListDocuments")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/documents"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.q != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "form", "")
}
if r.limit != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "")
} else {
var defaultValue int32 = 100
r.limit = &defaultValue
}
if r.offset != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "")
} else {
var defaultValue int32 = 0
r.offset = &defaultValue
}
// 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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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
}

View file

@ -0,0 +1,427 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
)
// EntitiesAPIService EntitiesAPI service
type EntitiesAPIService service
type ApiGetEntityRequest struct {
ctx context.Context
ApiService *EntitiesAPIService
bankId string
entityId string
authorization *string
}
func (r ApiGetEntityRequest) Authorization(authorization string) ApiGetEntityRequest {
r.authorization = &authorization
return r
}
func (r ApiGetEntityRequest) Execute() (*EntityDetailResponse, *http.Response, error) {
return r.ApiService.GetEntityExecute(r)
}
/*
GetEntity Get entity details
Get detailed information about an entity including observations (mental model).
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param entityId
@return ApiGetEntityRequest
*/
func (a *EntitiesAPIService) GetEntity(ctx context.Context, bankId string, entityId string) ApiGetEntityRequest {
return ApiGetEntityRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
entityId: entityId,
}
}
// Execute executes the request
// @return EntityDetailResponse
func (a *EntitiesAPIService) GetEntityExecute(r ApiGetEntityRequest) (*EntityDetailResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *EntityDetailResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EntitiesAPIService.GetEntity")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/entities/{entity_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"entity_id"+"}", url.PathEscape(parameterValueToString(r.entityId, "entityId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiListEntitiesRequest struct {
ctx context.Context
ApiService *EntitiesAPIService
bankId string
limit *int32
offset *int32
authorization *string
}
// Maximum number of entities to return
func (r ApiListEntitiesRequest) Limit(limit int32) ApiListEntitiesRequest {
r.limit = &limit
return r
}
// Offset for pagination
func (r ApiListEntitiesRequest) Offset(offset int32) ApiListEntitiesRequest {
r.offset = &offset
return r
}
func (r ApiListEntitiesRequest) Authorization(authorization string) ApiListEntitiesRequest {
r.authorization = &authorization
return r
}
func (r ApiListEntitiesRequest) Execute() (*EntityListResponse, *http.Response, error) {
return r.ApiService.ListEntitiesExecute(r)
}
/*
ListEntities List entities
List all entities (people, organizations, etc.) known by the bank, ordered by mention count. Supports pagination.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@return ApiListEntitiesRequest
*/
func (a *EntitiesAPIService) ListEntities(ctx context.Context, bankId string) ApiListEntitiesRequest {
return ApiListEntitiesRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
}
}
// Execute executes the request
// @return EntityListResponse
func (a *EntitiesAPIService) ListEntitiesExecute(r ApiListEntitiesRequest) (*EntityListResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *EntityListResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EntitiesAPIService.ListEntities")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/entities"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.limit != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "")
} else {
var defaultValue int32 = 100
r.limit = &defaultValue
}
if r.offset != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "")
} else {
var defaultValue int32 = 0
r.offset = &defaultValue
}
// 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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiRegenerateEntityObservationsRequest struct {
ctx context.Context
ApiService *EntitiesAPIService
bankId string
entityId string
authorization *string
}
func (r ApiRegenerateEntityObservationsRequest) Authorization(authorization string) ApiRegenerateEntityObservationsRequest {
r.authorization = &authorization
return r
}
func (r ApiRegenerateEntityObservationsRequest) Execute() (*EntityDetailResponse, *http.Response, error) {
return r.ApiService.RegenerateEntityObservationsExecute(r)
}
/*
RegenerateEntityObservations Regenerate entity observations (deprecated)
This endpoint is deprecated. Entity observations have been replaced by mental models.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param entityId
@return ApiRegenerateEntityObservationsRequest
Deprecated
*/
func (a *EntitiesAPIService) RegenerateEntityObservations(ctx context.Context, bankId string, entityId string) ApiRegenerateEntityObservationsRequest {
return ApiRegenerateEntityObservationsRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
entityId: entityId,
}
}
// Execute executes the request
// @return EntityDetailResponse
// Deprecated
func (a *EntitiesAPIService) RegenerateEntityObservationsExecute(r ApiRegenerateEntityObservationsRequest) (*EntityDetailResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *EntityDetailResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EntitiesAPIService.RegenerateEntityObservations")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/entities/{entity_id}/regenerate"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"entity_id"+"}", url.PathEscape(parameterValueToString(r.entityId, "entityId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,850 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
"reflect"
)
// MentalModelsAPIService MentalModelsAPI service
type MentalModelsAPIService service
type ApiCreateMentalModelRequest struct {
ctx context.Context
ApiService *MentalModelsAPIService
bankId string
createMentalModelRequest *CreateMentalModelRequest
authorization *string
}
func (r ApiCreateMentalModelRequest) CreateMentalModelRequest(createMentalModelRequest CreateMentalModelRequest) ApiCreateMentalModelRequest {
r.createMentalModelRequest = &createMentalModelRequest
return r
}
func (r ApiCreateMentalModelRequest) Authorization(authorization string) ApiCreateMentalModelRequest {
r.authorization = &authorization
return r
}
func (r ApiCreateMentalModelRequest) Execute() (*CreateMentalModelResponse, *http.Response, error) {
return r.ApiService.CreateMentalModelExecute(r)
}
/*
CreateMentalModel Create mental model
Create a mental model by running reflect with the source query in the background. Returns an operation ID to track progress. The content is auto-generated by the reflect endpoint. Use the operations endpoint to check completion status.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@return ApiCreateMentalModelRequest
*/
func (a *MentalModelsAPIService) CreateMentalModel(ctx context.Context, bankId string) ApiCreateMentalModelRequest {
return ApiCreateMentalModelRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
}
}
// Execute executes the request
// @return CreateMentalModelResponse
func (a *MentalModelsAPIService) CreateMentalModelExecute(r ApiCreateMentalModelRequest) (*CreateMentalModelResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CreateMentalModelResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MentalModelsAPIService.CreateMentalModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/mental-models"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.createMentalModelRequest == nil {
return localVarReturnValue, nil, reportError("createMentalModelRequest 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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
// body params
localVarPostBody = r.createMentalModelRequest
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiDeleteMentalModelRequest struct {
ctx context.Context
ApiService *MentalModelsAPIService
bankId string
mentalModelId string
authorization *string
}
func (r ApiDeleteMentalModelRequest) Authorization(authorization string) ApiDeleteMentalModelRequest {
r.authorization = &authorization
return r
}
func (r ApiDeleteMentalModelRequest) Execute() (interface{}, *http.Response, error) {
return r.ApiService.DeleteMentalModelExecute(r)
}
/*
DeleteMentalModel Delete mental model
Delete a mental model.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param mentalModelId
@return ApiDeleteMentalModelRequest
*/
func (a *MentalModelsAPIService) DeleteMentalModel(ctx context.Context, bankId string, mentalModelId string) ApiDeleteMentalModelRequest {
return ApiDeleteMentalModelRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
mentalModelId: mentalModelId,
}
}
// Execute executes the request
// @return interface{}
func (a *MentalModelsAPIService) DeleteMentalModelExecute(r ApiDeleteMentalModelRequest) (interface{}, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue interface{}
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MentalModelsAPIService.DeleteMentalModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"mental_model_id"+"}", url.PathEscape(parameterValueToString(r.mentalModelId, "mentalModelId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiGetMentalModelRequest struct {
ctx context.Context
ApiService *MentalModelsAPIService
bankId string
mentalModelId string
authorization *string
}
func (r ApiGetMentalModelRequest) Authorization(authorization string) ApiGetMentalModelRequest {
r.authorization = &authorization
return r
}
func (r ApiGetMentalModelRequest) Execute() (*MentalModelResponse, *http.Response, error) {
return r.ApiService.GetMentalModelExecute(r)
}
/*
GetMentalModel Get mental model
Get a specific mental model by ID.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param mentalModelId
@return ApiGetMentalModelRequest
*/
func (a *MentalModelsAPIService) GetMentalModel(ctx context.Context, bankId string, mentalModelId string) ApiGetMentalModelRequest {
return ApiGetMentalModelRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
mentalModelId: mentalModelId,
}
}
// Execute executes the request
// @return MentalModelResponse
func (a *MentalModelsAPIService) GetMentalModelExecute(r ApiGetMentalModelRequest) (*MentalModelResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *MentalModelResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MentalModelsAPIService.GetMentalModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"mental_model_id"+"}", url.PathEscape(parameterValueToString(r.mentalModelId, "mentalModelId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiListMentalModelsRequest struct {
ctx context.Context
ApiService *MentalModelsAPIService
bankId string
tags *[]string
tagsMatch *string
limit *int32
offset *int32
authorization *string
}
// Filter by tags
func (r ApiListMentalModelsRequest) Tags(tags []string) ApiListMentalModelsRequest {
r.tags = &tags
return r
}
// How to match tags
func (r ApiListMentalModelsRequest) TagsMatch(tagsMatch string) ApiListMentalModelsRequest {
r.tagsMatch = &tagsMatch
return r
}
func (r ApiListMentalModelsRequest) Limit(limit int32) ApiListMentalModelsRequest {
r.limit = &limit
return r
}
func (r ApiListMentalModelsRequest) Offset(offset int32) ApiListMentalModelsRequest {
r.offset = &offset
return r
}
func (r ApiListMentalModelsRequest) Authorization(authorization string) ApiListMentalModelsRequest {
r.authorization = &authorization
return r
}
func (r ApiListMentalModelsRequest) Execute() (*MentalModelListResponse, *http.Response, error) {
return r.ApiService.ListMentalModelsExecute(r)
}
/*
ListMentalModels List mental models
List user-curated living documents that stay current.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@return ApiListMentalModelsRequest
*/
func (a *MentalModelsAPIService) ListMentalModels(ctx context.Context, bankId string) ApiListMentalModelsRequest {
return ApiListMentalModelsRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
}
}
// Execute executes the request
// @return MentalModelListResponse
func (a *MentalModelsAPIService) ListMentalModelsExecute(r ApiListMentalModelsRequest) (*MentalModelListResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *MentalModelListResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MentalModelsAPIService.ListMentalModels")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/mental-models"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.tags != nil {
t := *r.tags
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
parameterAddToHeaderOrQuery(localVarQueryParams, "tags", s.Index(i).Interface(), "form", "multi")
}
} else {
parameterAddToHeaderOrQuery(localVarQueryParams, "tags", t, "form", "multi")
}
}
if r.tagsMatch != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "tags_match", r.tagsMatch, "form", "")
} else {
var defaultValue string = "any"
r.tagsMatch = &defaultValue
}
if r.limit != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "")
} else {
var defaultValue int32 = 100
r.limit = &defaultValue
}
if r.offset != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "")
} else {
var defaultValue int32 = 0
r.offset = &defaultValue
}
// 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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiRefreshMentalModelRequest struct {
ctx context.Context
ApiService *MentalModelsAPIService
bankId string
mentalModelId string
authorization *string
}
func (r ApiRefreshMentalModelRequest) Authorization(authorization string) ApiRefreshMentalModelRequest {
r.authorization = &authorization
return r
}
func (r ApiRefreshMentalModelRequest) Execute() (*AsyncOperationSubmitResponse, *http.Response, error) {
return r.ApiService.RefreshMentalModelExecute(r)
}
/*
RefreshMentalModel Refresh mental model
Submit an async task to re-run the source query through reflect and update the content.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param mentalModelId
@return ApiRefreshMentalModelRequest
*/
func (a *MentalModelsAPIService) RefreshMentalModel(ctx context.Context, bankId string, mentalModelId string) ApiRefreshMentalModelRequest {
return ApiRefreshMentalModelRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
mentalModelId: mentalModelId,
}
}
// Execute executes the request
// @return AsyncOperationSubmitResponse
func (a *MentalModelsAPIService) RefreshMentalModelExecute(r ApiRefreshMentalModelRequest) (*AsyncOperationSubmitResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *AsyncOperationSubmitResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MentalModelsAPIService.RefreshMentalModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}/refresh"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"mental_model_id"+"}", url.PathEscape(parameterValueToString(r.mentalModelId, "mentalModelId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiUpdateMentalModelRequest struct {
ctx context.Context
ApiService *MentalModelsAPIService
bankId string
mentalModelId string
updateMentalModelRequest *UpdateMentalModelRequest
authorization *string
}
func (r ApiUpdateMentalModelRequest) UpdateMentalModelRequest(updateMentalModelRequest UpdateMentalModelRequest) ApiUpdateMentalModelRequest {
r.updateMentalModelRequest = &updateMentalModelRequest
return r
}
func (r ApiUpdateMentalModelRequest) Authorization(authorization string) ApiUpdateMentalModelRequest {
r.authorization = &authorization
return r
}
func (r ApiUpdateMentalModelRequest) Execute() (*MentalModelResponse, *http.Response, error) {
return r.ApiService.UpdateMentalModelExecute(r)
}
/*
UpdateMentalModel Update mental model
Update a mental model's name and/or source query.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param mentalModelId
@return ApiUpdateMentalModelRequest
*/
func (a *MentalModelsAPIService) UpdateMentalModel(ctx context.Context, bankId string, mentalModelId string) ApiUpdateMentalModelRequest {
return ApiUpdateMentalModelRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
mentalModelId: mentalModelId,
}
}
// Execute executes the request
// @return MentalModelResponse
func (a *MentalModelsAPIService) UpdateMentalModelExecute(r ApiUpdateMentalModelRequest) (*MentalModelResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *MentalModelResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MentalModelsAPIService.UpdateMentalModel")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/mental-models/{mental_model_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"mental_model_id"+"}", url.PathEscape(parameterValueToString(r.mentalModelId, "mentalModelId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.updateMentalModelRequest == nil {
return localVarReturnValue, nil, reportError("updateMentalModelRequest 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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
// body params
localVarPostBody = r.updateMentalModelRequest
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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
}

View file

@ -0,0 +1,320 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
)
// MonitoringAPIService MonitoringAPI service
type MonitoringAPIService service
type ApiGetVersionRequest struct {
ctx context.Context
ApiService *MonitoringAPIService
}
func (r ApiGetVersionRequest) Execute() (*VersionResponse, *http.Response, error) {
return r.ApiService.GetVersionExecute(r)
}
/*
GetVersion Get API version and feature flags
Returns API version information and enabled feature flags. Use this to check which capabilities are available in this deployment.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetVersionRequest
*/
func (a *MonitoringAPIService) GetVersion(ctx context.Context) ApiGetVersionRequest {
return ApiGetVersionRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return VersionResponse
func (a *MonitoringAPIService) GetVersionExecute(r ApiGetVersionRequest) (*VersionResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *VersionResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitoringAPIService.GetVersion")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/version"
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"}
// 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 ApiHealthEndpointHealthGetRequest struct {
ctx context.Context
ApiService *MonitoringAPIService
}
func (r ApiHealthEndpointHealthGetRequest) Execute() (interface{}, *http.Response, error) {
return r.ApiService.HealthEndpointHealthGetExecute(r)
}
/*
HealthEndpointHealthGet Health check endpoint
Checks the health of the API and database connection
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiHealthEndpointHealthGetRequest
*/
func (a *MonitoringAPIService) HealthEndpointHealthGet(ctx context.Context) ApiHealthEndpointHealthGetRequest {
return ApiHealthEndpointHealthGetRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return interface{}
func (a *MonitoringAPIService) HealthEndpointHealthGetExecute(r ApiHealthEndpointHealthGetRequest) (interface{}, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue interface{}
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitoringAPIService.HealthEndpointHealthGet")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/health"
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"}
// 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 ApiMetricsEndpointMetricsGetRequest struct {
ctx context.Context
ApiService *MonitoringAPIService
}
func (r ApiMetricsEndpointMetricsGetRequest) Execute() (interface{}, *http.Response, error) {
return r.ApiService.MetricsEndpointMetricsGetExecute(r)
}
/*
MetricsEndpointMetricsGet Prometheus metrics endpoint
Exports metrics in Prometheus format for scraping
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiMetricsEndpointMetricsGetRequest
*/
func (a *MonitoringAPIService) MetricsEndpointMetricsGet(ctx context.Context) ApiMetricsEndpointMetricsGetRequest {
return ApiMetricsEndpointMetricsGetRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return interface{}
func (a *MonitoringAPIService) MetricsEndpointMetricsGetExecute(r ApiMetricsEndpointMetricsGetRequest) (interface{}, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue interface{}
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitoringAPIService.MetricsEndpointMetricsGet")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/metrics"
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"}
// 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
}

View file

@ -0,0 +1,434 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
)
// OperationsAPIService OperationsAPI service
type OperationsAPIService service
type ApiCancelOperationRequest struct {
ctx context.Context
ApiService *OperationsAPIService
bankId string
operationId string
authorization *string
}
func (r ApiCancelOperationRequest) Authorization(authorization string) ApiCancelOperationRequest {
r.authorization = &authorization
return r
}
func (r ApiCancelOperationRequest) Execute() (*CancelOperationResponse, *http.Response, error) {
return r.ApiService.CancelOperationExecute(r)
}
/*
CancelOperation Cancel a pending async operation
Cancel a pending async operation by removing it from the queue
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param operationId
@return ApiCancelOperationRequest
*/
func (a *OperationsAPIService) CancelOperation(ctx context.Context, bankId string, operationId string) ApiCancelOperationRequest {
return ApiCancelOperationRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
operationId: operationId,
}
}
// Execute executes the request
// @return CancelOperationResponse
func (a *OperationsAPIService) CancelOperationExecute(r ApiCancelOperationRequest) (*CancelOperationResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CancelOperationResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperationsAPIService.CancelOperation")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/operations/{operation_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterValueToString(r.operationId, "operationId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiGetOperationStatusRequest struct {
ctx context.Context
ApiService *OperationsAPIService
bankId string
operationId string
authorization *string
}
func (r ApiGetOperationStatusRequest) Authorization(authorization string) ApiGetOperationStatusRequest {
r.authorization = &authorization
return r
}
func (r ApiGetOperationStatusRequest) Execute() (*OperationStatusResponse, *http.Response, error) {
return r.ApiService.GetOperationStatusExecute(r)
}
/*
GetOperationStatus Get operation status
Get the status of a specific async operation. Returns 'pending', 'completed', or 'failed'. Completed operations are removed from storage, so 'completed' means the operation finished successfully.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@param operationId
@return ApiGetOperationStatusRequest
*/
func (a *OperationsAPIService) GetOperationStatus(ctx context.Context, bankId string, operationId string) ApiGetOperationStatusRequest {
return ApiGetOperationStatusRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
operationId: operationId,
}
}
// Execute executes the request
// @return OperationStatusResponse
func (a *OperationsAPIService) GetOperationStatusExecute(r ApiGetOperationStatusRequest) (*OperationStatusResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *OperationStatusResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperationsAPIService.GetOperationStatus")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/operations/{operation_id}"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"operation_id"+"}", url.PathEscape(parameterValueToString(r.operationId, "operationId")), -1)
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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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 ApiListOperationsRequest struct {
ctx context.Context
ApiService *OperationsAPIService
bankId string
status *string
limit *int32
offset *int32
authorization *string
}
// Filter by status: pending, completed, or failed
func (r ApiListOperationsRequest) Status(status string) ApiListOperationsRequest {
r.status = &status
return r
}
// Maximum number of operations to return
func (r ApiListOperationsRequest) Limit(limit int32) ApiListOperationsRequest {
r.limit = &limit
return r
}
// Number of operations to skip
func (r ApiListOperationsRequest) Offset(offset int32) ApiListOperationsRequest {
r.offset = &offset
return r
}
func (r ApiListOperationsRequest) Authorization(authorization string) ApiListOperationsRequest {
r.authorization = &authorization
return r
}
func (r ApiListOperationsRequest) Execute() (*OperationsListResponse, *http.Response, error) {
return r.ApiService.ListOperationsExecute(r)
}
/*
ListOperations List async operations
Get a list of async operations for a specific agent, with optional filtering by status. Results are sorted by most recent first.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param bankId
@return ApiListOperationsRequest
*/
func (a *OperationsAPIService) ListOperations(ctx context.Context, bankId string) ApiListOperationsRequest {
return ApiListOperationsRequest{
ApiService: a,
ctx: ctx,
bankId: bankId,
}
}
// Execute executes the request
// @return OperationsListResponse
func (a *OperationsAPIService) ListOperationsExecute(r ApiListOperationsRequest) (*OperationsListResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *OperationsListResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperationsAPIService.ListOperations")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/default/banks/{bank_id}/operations"
localVarPath = strings.Replace(localVarPath, "{"+"bank_id"+"}", url.PathEscape(parameterValueToString(r.bankId, "bankId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.status != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "")
}
if r.limit != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "")
} else {
var defaultValue int32 = 20
r.limit = &defaultValue
}
if r.offset != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "")
} else {
var defaultValue int32 = 0
r.offset = &defaultValue
}
// 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"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.authorization != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "authorization", r.authorization, "simple", "")
}
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,
}
if localVarHTTPResponse.StatusCode == 422 {
var v HTTPValidationError
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
}

View file

@ -1,118 +0,0 @@
package hindsight
import (
"context"
"fmt"
"github.com/vectorize-io/hindsight-client-go/internal/ogenapi"
)
// CreateBank creates a new memory bank or updates an existing one.
func (c *Client) CreateBank(ctx context.Context, bankID string, opts ...CreateBankOption) (*BankProfileResponse, error) {
var cfg createBankConfig
for _, o := range opts {
o(&cfg)
}
req := &ogenapi.CreateBankRequest{}
if cfg.name != nil {
req.Name = ogenapi.NewOptString(*cfg.name)
}
if cfg.mission != nil {
req.Mission = ogenapi.NewOptString(*cfg.mission)
}
if cfg.disposition != nil {
req.Disposition = ogenapi.NewOptDispositionTraits(*cfg.disposition)
}
res, err := c.api.CreateOrUpdateBank(ctx, req, ogenapi.CreateOrUpdateBankParams{
BankID: bankID,
})
if err != nil {
return nil, err
}
resp, ok := res.(*ogenapi.BankProfileResponse)
if !ok {
return nil, fmt.Errorf("hindsight: unexpected response type %T", res)
}
return resp, nil
}
// GetBankProfile retrieves the profile for a memory bank.
func (c *Client) GetBankProfile(ctx context.Context, bankID string) (*BankProfileResponse, error) {
res, err := c.api.GetBankProfile(ctx, ogenapi.GetBankProfileParams{
BankID: bankID,
})
if err != nil {
return nil, err
}
resp, ok := res.(*ogenapi.BankProfileResponse)
if !ok {
return nil, fmt.Errorf("hindsight: unexpected response type %T", res)
}
return resp, nil
}
// ListBanks returns all memory banks.
func (c *Client) ListBanks(ctx context.Context) (*BankListResponse, error) {
res, err := c.api.ListBanks(ctx)
if err != nil {
return nil, err
}
resp, ok := res.(*ogenapi.BankListResponse)
if !ok {
return nil, fmt.Errorf("hindsight: unexpected response type %T", res)
}
return resp, nil
}
// DeleteBank permanently deletes a memory bank and all its data.
func (c *Client) DeleteBank(ctx context.Context, bankID string) error {
_, err := c.api.DeleteBank(ctx, ogenapi.DeleteBankParams{
BankID: bankID,
})
return err
}
// SetMission updates the mission for a memory bank.
func (c *Client) SetMission(ctx context.Context, bankID, mission string) (*BankProfileResponse, error) {
req := &ogenapi.CreateBankRequest{
Mission: ogenapi.NewOptString(mission),
}
res, err := c.api.CreateOrUpdateBank(ctx, req, ogenapi.CreateOrUpdateBankParams{
BankID: bankID,
})
if err != nil {
return nil, err
}
resp, ok := res.(*ogenapi.BankProfileResponse)
if !ok {
return nil, fmt.Errorf("hindsight: unexpected response type %T", res)
}
return resp, nil
}
// UpdateDisposition updates the personality traits for a memory bank.
func (c *Client) UpdateDisposition(ctx context.Context, bankID string, traits DispositionTraits) (*BankProfileResponse, error) {
req := &ogenapi.UpdateDispositionRequest{
Disposition: traits,
}
res, err := c.api.UpdateBankDisposition(ctx, req, ogenapi.UpdateBankDispositionParams{
BankID: bankID,
})
if err != nil {
return nil, err
}
resp, ok := res.(*ogenapi.BankProfileResponse)
if !ok {
return nil, fmt.Errorf("hindsight: unexpected response type %T", res)
}
return resp, nil
}

View file

@ -0,0 +1,673 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"bytes"
"context"
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"net/http/httputil"
"net/url"
"os"
"path/filepath"
"reflect"
"regexp"
"strconv"
"strings"
"time"
"unicode/utf8"
)
var (
JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`)
XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`)
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" )
)
// APIClient manages communication with the Hindsight HTTP API API v0.4.11
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *Configuration
common service // Reuse a single struct instead of allocating one for each service on the heap.
// API Services
BanksAPI *BanksAPIService
DirectivesAPI *DirectivesAPIService
DocumentsAPI *DocumentsAPIService
EntitiesAPI *EntitiesAPIService
MemoryAPI *MemoryAPIService
MentalModelsAPI *MentalModelsAPIService
MonitoringAPI *MonitoringAPIService
OperationsAPI *OperationsAPIService
}
type service struct {
client *APIClient
}
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
// optionally a custom http.Client to allow for advanced features such as caching.
func NewAPIClient(cfg *Configuration) *APIClient {
if cfg.HTTPClient == nil {
cfg.HTTPClient = http.DefaultClient
}
c := &APIClient{}
c.cfg = cfg
c.common.client = c
// API Services
c.BanksAPI = (*BanksAPIService)(&c.common)
c.DirectivesAPI = (*DirectivesAPIService)(&c.common)
c.DocumentsAPI = (*DocumentsAPIService)(&c.common)
c.EntitiesAPI = (*EntitiesAPIService)(&c.common)
c.MemoryAPI = (*MemoryAPIService)(&c.common)
c.MentalModelsAPI = (*MentalModelsAPIService)(&c.common)
c.MonitoringAPI = (*MonitoringAPIService)(&c.common)
c.OperationsAPI = (*OperationsAPIService)(&c.common)
return c
}
func atoi(in string) (int, error) {
return strconv.Atoi(in)
}
// selectHeaderContentType select a content type from the available list.
func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
return ""
}
if contains(contentTypes, "application/json") {
return "application/json"
}
return contentTypes[0] // use the first content type specified in 'consumes'
}
// selectHeaderAccept join all accept types and return
func selectHeaderAccept(accepts []string) string {
if len(accepts) == 0 {
return ""
}
if contains(accepts, "application/json") {
return "application/json"
}
return strings.Join(accepts, ",")
}
// contains is a case insensitive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.EqualFold(a, needle) {
return true
}
}
return false
}
// Verify optional parameters are of the correct type.
func typeCheckParameter(obj interface{}, expected string, name string) error {
// Make sure there is an object.
if obj == nil {
return nil
}
// Check the type is as expected.
if reflect.TypeOf(obj).String() != expected {
return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String())
}
return nil
}
func parameterValueToString( obj interface{}, key string ) string {
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
return fmt.Sprintf("%v", obj)
}
var param,ok = obj.(MappedNullable)
if !ok {
return ""
}
dataMap,err := param.ToMap()
if err != nil {
return ""
}
return fmt.Sprintf("%v", dataMap[key])
}
// parameterAddToHeaderOrQuery adds the provided object to the request header or url query
// supporting deep object syntax
func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) {
var v = reflect.ValueOf(obj)
var value = ""
if v == reflect.ValueOf(nil) {
value = "null"
} else {
switch v.Kind() {
case reflect.Invalid:
value = "invalid"
case reflect.Struct:
if t,ok := obj.(MappedNullable); ok {
dataMap,err := t.ToMap()
if err != nil {
return
}
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType)
return
}
if t, ok := obj.(time.Time); ok {
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType)
return
}
value = v.Type().String() + " value"
case reflect.Slice:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
var lenIndValue = indValue.Len()
for i:=0;i<lenIndValue;i++ {
var arrayValue = indValue.Index(i)
var keyPrefixForCollectionType = keyPrefix
if style == "deepObject" {
keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]"
}
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType)
}
return
case reflect.Map:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
iter := indValue.MapRange()
for iter.Next() {
k,v := iter.Key(), iter.Value()
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType)
}
return
case reflect.Interface:
fallthrough
case reflect.Ptr:
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType)
return
case reflect.Int, reflect.Int8, reflect.Int16,
reflect.Int32, reflect.Int64:
value = strconv.FormatInt(v.Int(), 10)
case reflect.Uint, reflect.Uint8, reflect.Uint16,
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
value = strconv.FormatUint(v.Uint(), 10)
case reflect.Float32, reflect.Float64:
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
case reflect.Bool:
value = strconv.FormatBool(v.Bool())
case reflect.String:
value = v.String()
default:
value = v.Type().String() + " value"
}
}
switch valuesMap := headerOrQueryParams.(type) {
case url.Values:
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix) + "," + value)
} else {
valuesMap.Add(keyPrefix, value)
}
break
case map[string]string:
valuesMap[keyPrefix] = value
break
}
}
// helper for converting interface{} parameters to json strings
func parameterToJson(obj interface{}) (string, error) {
jsonBuf, err := json.Marshal(obj)
if err != nil {
return "", err
}
return string(jsonBuf), err
}
// callAPI do the request.
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
if c.cfg.Debug {
dump, err := httputil.DumpRequestOut(request, true)
if err != nil {
return nil, err
}
log.Printf("\n%s\n", string(dump))
}
resp, err := c.cfg.HTTPClient.Do(request)
if err != nil {
return resp, err
}
if c.cfg.Debug {
dump, err := httputil.DumpResponse(resp, true)
if err != nil {
return resp, err
}
log.Printf("\n%s\n", string(dump))
}
return resp, err
}
// Allow modification of underlying config for alternate implementations and testing
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
func (c *APIClient) GetConfig() *Configuration {
return c.cfg
}
type formFile struct {
fileBytes []byte
fileName string
formFileName string
}
// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,
path string, method string,
postBody interface{},
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
formFiles []formFile) (localVarRequest *http.Request, err error) {
var body *bytes.Buffer
// Detect postBody type and post.
if postBody != nil {
contentType := headerParams["Content-Type"]
if contentType == "" {
contentType = detectContentType(postBody)
headerParams["Content-Type"] = contentType
}
body, err = setBody(postBody, contentType)
if err != nil {
return nil, err
}
}
// add form parameters and file if available.
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
body = &bytes.Buffer{}
w := multipart.NewWriter(body)
for k, v := range formParams {
for _, iv := range v {
if strings.HasPrefix(k, "@") { // file
err = addFile(w, k[1:], iv)
if err != nil {
return nil, err
}
} else { // form value
w.WriteField(k, iv)
}
}
}
for _, formFile := range formFiles {
if len(formFile.fileBytes) > 0 && formFile.fileName != "" {
w.Boundary()
part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName))
if err != nil {
return nil, err
}
_, err = part.Write(formFile.fileBytes)
if err != nil {
return nil, err
}
}
}
// Set the Boundary in the Content-Type
headerParams["Content-Type"] = w.FormDataContentType()
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
w.Close()
}
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
if body != nil {
return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
}
body = &bytes.Buffer{}
body.WriteString(formParams.Encode())
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
}
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
return nil, err
}
// Override request host, if applicable
if c.cfg.Host != "" {
url.Host = c.cfg.Host
}
// Override request scheme, if applicable
if c.cfg.Scheme != "" {
url.Scheme = c.cfg.Scheme
}
// Adding Query Param
query := url.Query()
for k, v := range queryParams {
for _, iv := range v {
query.Add(k, iv)
}
}
// Encode the parameters.
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
pieces := strings.Split(s, "=")
pieces[0] = queryDescape.Replace(pieces[0])
return strings.Join(pieces, "=")
})
// Generate a new request
if body != nil {
localVarRequest, err = http.NewRequest(method, url.String(), body)
} else {
localVarRequest, err = http.NewRequest(method, url.String(), nil)
}
if err != nil {
return nil, err
}
// add header parameters, if any
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers[h] = []string{v}
}
localVarRequest.Header = headers
}
// Add the user agent to the request.
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
if ctx != nil {
// add context to the request
localVarRequest = localVarRequest.WithContext(ctx)
// Walk through any authentication.
}
for header, value := range c.cfg.DefaultHeader {
localVarRequest.Header.Add(header, value)
}
return localVarRequest, nil
}
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
if len(b) == 0 {
return nil
}
if s, ok := v.(*string); ok {
*s = string(b)
return nil
}
if f, ok := v.(*os.File); ok {
f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
_, err = f.Write(b)
if err != nil {
return
}
_, err = f.Seek(0, io.SeekStart)
return
}
if f, ok := v.(**os.File); ok {
*f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
_, err = (*f).Write(b)
if err != nil {
return
}
_, err = (*f).Seek(0, io.SeekStart)
return
}
if XmlCheck.MatchString(contentType) {
if err = xml.Unmarshal(b, v); err != nil {
return err
}
return nil
}
if JsonCheck.MatchString(contentType) {
if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined
if err = unmarshalObj.UnmarshalJSON(b); err != nil {
return err
}
} else {
return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined")
}
} else if err = json.Unmarshal(b, v); err != nil { // simple model
return err
}
return nil
}
return errors.New("undefined response type")
}
// Add a file to the multipart request
func addFile(w *multipart.Writer, fieldName, path string) error {
file, err := os.Open(filepath.Clean(path))
if err != nil {
return err
}
err = file.Close()
if err != nil {
return err
}
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {
return err
}
_, err = io.Copy(part, file)
return err
}
// Set request body from an interface{}
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
if bodyBuf == nil {
bodyBuf = &bytes.Buffer{}
}
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if fp, ok := body.(*os.File); ok {
_, err = bodyBuf.ReadFrom(fp)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
_, err = bodyBuf.WriteString(s)
} else if s, ok := body.(*string); ok {
_, err = bodyBuf.WriteString(*s)
} else if JsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if XmlCheck.MatchString(contentType) {
var bs []byte
bs, err = xml.Marshal(body)
if err == nil {
bodyBuf.Write(bs)
}
}
if err != nil {
return nil, err
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("invalid body type %s\n", contentType)
return nil, err
}
return bodyBuf, nil
}
// detectContentType method is used to figure out `Request.Body` content type for request header
func detectContentType(body interface{}) string {
contentType := "text/plain; charset=utf-8"
kind := reflect.TypeOf(body).Kind()
switch kind {
case reflect.Struct, reflect.Map, reflect.Ptr:
contentType = "application/json; charset=utf-8"
case reflect.String:
contentType = "text/plain; charset=utf-8"
default:
if b, ok := body.([]byte); ok {
contentType = http.DetectContentType(b)
} else if kind == reflect.Slice {
contentType = "application/json; charset=utf-8"
}
}
return contentType
}
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
type cacheControl map[string]string
func parseCacheControl(headers http.Header) cacheControl {
cc := cacheControl{}
ccHeader := headers.Get("Cache-Control")
for _, part := range strings.Split(ccHeader, ",") {
part = strings.Trim(part, " ")
if part == "" {
continue
}
if strings.ContainsRune(part, '=') {
keyval := strings.Split(part, "=")
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
} else {
cc[part] = ""
}
}
return cc
}
// CacheExpires helper function to determine remaining time before repeating a request.
func CacheExpires(r *http.Response) time.Time {
// Figure out when the cache expires.
var expires time.Time
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
if err != nil {
return time.Now()
}
respCacheControl := parseCacheControl(r.Header)
if maxAge, ok := respCacheControl["max-age"]; ok {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
} else {
expires = now.Add(lifetime)
}
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {
expires, err = time.Parse(time.RFC1123, expiresHeader)
if err != nil {
expires = now
}
}
}
return expires
}
func strlen(s string) int {
return utf8.RuneCountInString(s)
}
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
type GenericOpenAPIError struct {
body []byte
error string
model interface{}
}
// Error returns non-empty string if there was an error.
func (e GenericOpenAPIError) Error() string {
return e.error
}
// Body returns the raw bytes of the response
func (e GenericOpenAPIError) Body() []byte {
return e.body
}
// Model returns the unpacked model of the error
func (e GenericOpenAPIError) Model() interface{} {
return e.model
}
// format error message using title and detail when model implements rfc7807
func formatErrorMessage(status string, v interface{}) string {
str := ""
metaValue := reflect.ValueOf(v).Elem()
if metaValue.Kind() == reflect.Struct {
field := metaValue.FieldByName("Title")
if field != (reflect.Value{}) {
str = fmt.Sprintf("%s", field.Interface())
}
field = metaValue.FieldByName("Detail")
if field != (reflect.Value{}) {
str = fmt.Sprintf("%s (%s)", str, field.Interface())
}
}
return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
}

View file

@ -0,0 +1,215 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"context"
"fmt"
"net/http"
"strings"
)
// contextKeys are used to identify the type of value in the context.
// Since these are string, it is possible to get a short description of the
// context key for logging and debugging using key.String().
type contextKey string
func (c contextKey) String() string {
return "auth " + string(c)
}
var (
// ContextServerIndex uses a server configuration from the index.
ContextServerIndex = contextKey("serverIndex")
// ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerIndices = contextKey("serverOperationIndices")
// ContextServerVariables overrides a server configuration variables.
ContextServerVariables = contextKey("serverVariables")
// ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextOperationServerVariables = contextKey("serverOperationVariables")
)
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIKey struct {
Key string
Prefix string
}
// ServerVariable stores the information about a server variable
type ServerVariable struct {
Description string
DefaultValue string
EnumValues []string
}
// ServerConfiguration stores the information about a server
type ServerConfiguration struct {
URL string
Description string
Variables map[string]ServerVariable
}
// ServerConfigurations stores multiple ServerConfiguration items
type ServerConfigurations []ServerConfiguration
// Configuration stores the configuration of the API client
type Configuration struct {
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
Debug bool `json:"debug,omitempty"`
Servers ServerConfigurations
OperationServers map[string]ServerConfigurations
HTTPClient *http.Client
}
// NewConfiguration returns a new Configuration object
func NewConfiguration() *Configuration {
cfg := &Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/1.0.0/go",
Debug: false,
Servers: ServerConfigurations{
{
URL: "",
Description: "No description provided",
},
},
OperationServers: map[string]ServerConfigurations{
},
}
return cfg
}
// AddDefaultHeader adds a new HTTP header to the default header in the request
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.DefaultHeader[key] = value
}
// URL formats template on a index using given variables
func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) {
if index < 0 || len(sc) <= index {
return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1)
}
server := sc[index]
url := server.URL
// go through variables and replace placeholders
for name, variable := range server.Variables {
if value, ok := variables[name]; ok {
found := bool(len(variable.EnumValues) == 0)
for _, enumValue := range variable.EnumValues {
if value == enumValue {
found = true
}
}
if !found {
return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues)
}
url = strings.Replace(url, "{"+name+"}", value, -1)
} else {
url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1)
}
}
return url, nil
}
// ServerURL returns URL based on server settings
func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) {
return c.Servers.URL(index, variables)
}
func getServerIndex(ctx context.Context) (int, error) {
si := ctx.Value(ContextServerIndex)
if si != nil {
if index, ok := si.(int); ok {
return index, nil
}
return 0, reportError("Invalid type %T should be int", si)
}
return 0, nil
}
func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) {
osi := ctx.Value(ContextOperationServerIndices)
if osi != nil {
if operationIndices, ok := osi.(map[string]int); !ok {
return 0, reportError("Invalid type %T should be map[string]int", osi)
} else {
index, ok := operationIndices[endpoint]
if ok {
return index, nil
}
}
}
return getServerIndex(ctx)
}
func getServerVariables(ctx context.Context) (map[string]string, error) {
sv := ctx.Value(ContextServerVariables)
if sv != nil {
if variables, ok := sv.(map[string]string); ok {
return variables, nil
}
return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv)
}
return nil, nil
}
func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) {
osv := ctx.Value(ContextOperationServerVariables)
if osv != nil {
if operationVariables, ok := osv.(map[string]map[string]string); !ok {
return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv)
} else {
variables, ok := operationVariables[endpoint]
if ok {
return variables, nil
}
}
}
return getServerVariables(ctx)
}
// ServerURLWithContext returns a new server URL given an endpoint
func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) {
sc, ok := c.OperationServers[endpoint]
if !ok {
sc = c.Servers
}
if ctx == nil {
return sc.URL(0, nil)
}
index, err := getServerOperationIndex(ctx, endpoint)
if err != nil {
return "", err
}
variables, err := getServerOperationVariables(ctx, endpoint)
if err != nil {
return "", err
}
return sc.URL(index, variables)
}

View file

@ -1,40 +0,0 @@
// Package hindsight provides a Go client for the Hindsight agent memory API.
//
// Hindsight is a long-term memory system for AI agents. This client wraps the
// auto-generated ogen API client with a simpler, Go-idiomatic interface for the
// core operations: retain (store), recall (retrieve), and reflect (reason).
//
// # Quick Start
//
// client, err := hindsight.New("http://localhost:8888")
// if err != nil {
// log.Fatal(err)
// }
//
// // Store a memory
// _, err = client.Retain(ctx, "my-bank", "The user prefers dark mode")
//
// // Recall memories
// resp, err := client.Recall(ctx, "my-bank", "What are the user's preferences?")
// for _, r := range resp.Results {
// fmt.Println(r.Text)
// }
//
// // Reflect with reasoning
// ref, err := client.Reflect(ctx, "my-bank", "Summarize what you know about the user")
// fmt.Println(ref.Text)
//
// # Authentication
//
// For authenticated deployments, pass an API key:
//
// client, err := hindsight.New("http://localhost:8888", hindsight.WithAPIKey("your-key"))
//
// # Advanced Usage
//
// For operations not covered by the high-level wrapper (documents, entities,
// operations, mental models, directives), access the ogen-generated client:
//
// ogen := client.OgenClient()
// resp, err := ogen.ListEntities(ctx, ogenapi.ListEntitiesParams{BankID: "my-bank"})
package hindsight

View file

@ -1,124 +0,0 @@
package hindsight_test
import (
"context"
"fmt"
"log"
hindsight "github.com/vectorize-io/hindsight-client-go"
)
func Example() {
client, err := hindsight.New("http://localhost:8888")
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
// Store a memory
_, err = client.Retain(ctx, "my-bank", "The user prefers dark mode")
if err != nil {
log.Fatal(err)
}
// Recall memories
resp, err := client.Recall(ctx, "my-bank", "What are the user's preferences?")
if err != nil {
log.Fatal(err)
}
for _, r := range resp.Results {
fmt.Println(r.Text)
}
// Reflect with reasoning
ref, err := client.Reflect(ctx, "my-bank", "Summarize what you know about the user")
if err != nil {
log.Fatal(err)
}
fmt.Println(ref.Text)
}
func ExampleNew_withAPIKey() {
_, err := hindsight.New(
"http://localhost:8888",
hindsight.WithAPIKey("your-api-key"),
)
if err != nil {
log.Fatal(err)
}
}
func ExampleClient_Retain() {
client, _ := hindsight.New("http://localhost:8888")
ctx := context.Background()
// Simple retain
_, _ = client.Retain(ctx, "my-bank", "Alice loves Python programming")
// Retain with options
_, _ = client.Retain(ctx, "my-bank", "Bob went hiking",
hindsight.WithContext("outdoor activities"),
hindsight.WithTags([]string{"hobbies"}),
hindsight.WithDocumentID("conversation-123"),
)
}
func ExampleClient_RetainBatch() {
client, _ := hindsight.New("http://localhost:8888")
ctx := context.Background()
items := []hindsight.MemoryItem{
{Content: "Alice completed the project"},
{Content: "Bob started learning Go"},
{Content: "Charlie presented at the conference"},
}
_, _ = client.RetainBatch(ctx, "my-bank", items,
hindsight.WithDocumentTags([]string{"team-updates"}),
)
}
func ExampleClient_Recall() {
client, _ := hindsight.New("http://localhost:8888")
ctx := context.Background()
resp, _ := client.Recall(ctx, "my-bank", "What does Alice like?",
hindsight.WithBudget(hindsight.BudgetHigh),
hindsight.WithMaxTokens(4096),
hindsight.WithTypes([]string{"world", "experience"}),
hindsight.WithTrace(true),
)
for _, r := range resp.Results {
fmt.Printf("[%s] %s\n", r.Type.Or("unknown"), r.Text)
}
}
func ExampleClient_Reflect() {
client, _ := hindsight.New("http://localhost:8888")
ctx := context.Background()
resp, _ := client.Reflect(ctx, "my-bank",
"What are the user's professional interests?",
hindsight.WithReflectBudget(hindsight.BudgetMid),
hindsight.WithReflectMaxTokens(2048),
)
fmt.Println(resp.Text)
}
func ExampleClient_CreateBank() {
client, _ := hindsight.New("http://localhost:8888")
ctx := context.Background()
_, _ = client.CreateBank(ctx, "my-bank",
hindsight.WithBankName("My Agent"),
hindsight.WithMission("Help users with programming tasks"),
hindsight.WithDisposition(hindsight.DispositionTraits{
Skepticism: 3,
Literalism: 2,
Empathy: 4,
}),
)
}

View file

@ -1,4 +0,0 @@
package hindsight
//go:generate go run ./internal/cmd/preprocess ../../hindsight-docs/static/openapi.json internal/ogenapi/openapi.json
//go:generate go run github.com/ogen-go/ogen/cmd/ogen --target internal/ogenapi -package ogenapi --clean --config ogen.yml internal/ogenapi/openapi.json

View file

@ -1,29 +1,11 @@
module github.com/vectorize-io/hindsight-client-go
go 1.25.0
go 1.18
require github.com/stretchr/testify v1.11.1
require (
github.com/go-faster/errors v0.7.1
github.com/go-faster/jx v1.2.0
github.com/ogen-go/ogen v1.19.0
)
require (
github.com/dlclark/regexp2 v1.11.5 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-faster/yaml v0.4.6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/segmentio/asm v1.2.1 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.1 // indirect
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect
golang.org/x/net v0.50.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/text v0.34.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View file

@ -1,60 +1,10 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ=
github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg=
github.com/go-faster/errors v0.7.1/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7FPGZP2quo=
github.com/go-faster/jx v1.2.0 h1:T2YHJPrFaYu21fJtUxC9GzmluKu8rVIFDwwGBKTDseI=
github.com/go-faster/jx v1.2.0/go.mod h1:UWLOVDmMG597a5tBFPLIWJdUxz5/2emOpfsj9Neg0PE=
github.com/go-faster/yaml v0.4.6 h1:lOK/EhI04gCpPgPhgt0bChS6bvw7G3WwI8xxVe0sw9I=
github.com/go-faster/yaml v0.4.6/go.mod h1:390dRIvV4zbnO7qC9FGo6YYutc+wyyUSHBgbXL52eXk=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/ogen-go/ogen v1.19.0 h1:YvdNpeQJ8A8dLLpS6Vs4WxXL53BT6tBPxH0VSjfALhA=
github.com/ogen-go/ogen v1.19.0/go.mod h1:DeShwO+TEpLYXNCuZliSAedphphXsJaTGGbmSomWUjE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY=
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60=
golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM=
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View file

@ -1,66 +0,0 @@
package hindsight
import (
"net/http"
"github.com/vectorize-io/hindsight-client-go/internal/ogenapi"
)
// Client is the high-level Hindsight API client. It wraps the ogen-generated
// client with convenience methods for core operations.
type Client struct {
api *ogenapi.Client
}
// New creates a new Hindsight client for the given base URL.
//
// By default, no authentication is configured. Use [WithAPIKey] to set a
// Bearer token, or [WithHTTPClient] for full control over the HTTP transport.
func New(baseURL string, opts ...Option) (*Client, error) {
cfg := clientConfig{}
for _, o := range opts {
o(&cfg)
}
var httpClient http.Client
if cfg.httpClient != nil {
httpClient = *cfg.httpClient
}
if cfg.apiKey != "" {
base := httpClient.Transport
if base == nil {
base = http.DefaultTransport
}
httpClient.Transport = &authTransport{
base: base,
token: cfg.apiKey,
}
}
api, err := ogenapi.NewClient(baseURL, ogenapi.WithClient(&httpClient))
if err != nil {
return nil, err
}
return &Client{api: api}, nil
}
// OgenClient returns the underlying ogen-generated client for advanced
// operations not covered by the high-level wrapper (documents, entities,
// operations, mental models, directives).
func (c *Client) OgenClient() *ogenapi.Client {
return c.api
}
// authTransport injects a Bearer token into every request.
type authTransport struct {
base http.RoundTripper
token string
}
func (t *authTransport) RoundTrip(r *http.Request) (*http.Response, error) {
r = r.Clone(r.Context())
r.Header.Set("Authorization", "Bearer "+t.token)
return t.base.RoundTrip(r)
}

View file

@ -1,6 +1,6 @@
//go:build integration
package hindsight_test
package hindsight
import (
"context"
@ -8,8 +8,6 @@ import (
"os"
"testing"
"time"
hindsight "github.com/vectorize-io/hindsight-client-go"
)
func apiURL(t *testing.T) string {
@ -21,13 +19,13 @@ func apiURL(t *testing.T) string {
return u
}
func newClient(t *testing.T) *hindsight.Client {
func newClient(t *testing.T) *APIClient {
t.Helper()
c, err := hindsight.New(apiURL(t))
if err != nil {
t.Fatal(err)
cfg := NewConfiguration()
cfg.Servers = ServerConfigurations{
{URL: apiURL(t)},
}
return c
return NewAPIClient(cfg)
}
func uniqueBank(t *testing.T) string {
@ -38,335 +36,426 @@ func uniqueBank(t *testing.T) string {
// --- Retain tests ---
func TestRetainSingle(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
resp, err := c.Retain(ctx, uniqueBank(t), "Alice loves artificial intelligence and machine learning")
req := RetainRequest{
Items: []MemoryItem{
{Content: "Alice loves artificial intelligence and machine learning"},
},
}
resp, httpResp, err := client.MemoryAPI.RetainMemories(ctx, bankID).RetainRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
if !resp.Success {
defer httpResp.Body.Close()
if !resp.GetSuccess() {
t.Error("expected success=true")
}
}
func TestRetainWithContext(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
resp, err := c.Retain(ctx, uniqueBank(t), "Bob went hiking in the mountains",
hindsight.WithTimestamp(time.Date(2024, 1, 15, 10, 30, 0, 0, time.UTC)),
hindsight.WithContext("outdoor activities"),
)
timestamp := time.Date(2024, 1, 15, 10, 30, 0, 0, time.UTC)
req := RetainRequest{
Items: []MemoryItem{
{
Content: "Bob went hiking in the mountains",
Timestamp: *NewNullableTime(PtrTime(timestamp)),
Context: *NewNullableString(PtrString("outdoor activities")),
},
},
}
resp, httpResp, err := client.MemoryAPI.RetainMemories(ctx, bankID).RetainRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
if !resp.Success {
defer httpResp.Body.Close()
if !resp.GetSuccess() {
t.Error("expected success=true")
}
}
func TestRetainBatch(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
items := []hindsight.MemoryItem{
req := RetainRequest{
Items: []MemoryItem{
{Content: "Charlie enjoys reading science fiction books"},
{Content: "Diana is learning to play the guitar"},
{Content: "Eve completed a marathon last month"},
},
}
resp, err := c.RetainBatch(ctx, uniqueBank(t), items)
resp, httpResp, err := client.MemoryAPI.RetainMemories(ctx, bankID).RetainRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
if !resp.Success {
defer httpResp.Body.Close()
if !resp.GetSuccess() {
t.Error("expected success=true")
}
if resp.ItemsCount != 3 {
t.Errorf("expected items_count=3, got %d", resp.ItemsCount)
if resp.GetItemsCount() != 3 {
t.Errorf("expected items_count=3, got %d", resp.GetItemsCount())
}
}
func TestRetainWithTags(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
resp, err := c.Retain(ctx, uniqueBank(t), "New feature implementation for project Z",
hindsight.WithTags([]string{"project_z", "features"}),
)
req := RetainRequest{
Items: []MemoryItem{
{
Content: "New feature implementation for project Z",
Tags: []string{"project_z", "features"},
},
},
}
resp, httpResp, err := client.MemoryAPI.RetainMemories(ctx, bankID).RetainRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
if !resp.Success {
defer httpResp.Body.Close()
if !resp.GetSuccess() {
t.Error("expected success=true")
}
}
func TestRetainBatchWithDocumentTags(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
items := []hindsight.MemoryItem{
{Content: "First item in batch"},
{Content: "Second item in batch"},
req := RetainRequest{
Items: []MemoryItem{
{Content: "Document with tags test 1"},
{Content: "Document with tags test 2"},
},
DocumentTags: []string{"test_doc", "batch"},
}
resp, err := c.RetainBatch(ctx, uniqueBank(t), items,
hindsight.WithDocumentTags([]string{"batch_import", "test_data"}),
)
resp, httpResp, err := client.MemoryAPI.RetainMemories(ctx, bankID).RetainRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
if !resp.Success {
defer httpResp.Body.Close()
if !resp.GetSuccess() {
t.Error("expected success=true")
}
if resp.ItemsCount != 2 {
t.Errorf("expected items_count=2, got %d", resp.ItemsCount)
}
}
// --- Recall tests ---
func setupRecallBank(t *testing.T, c *hindsight.Client, bankID string) {
func setupRecallBank(t *testing.T, client *APIClient, bankID string) {
t.Helper()
ctx := context.Background()
items := []hindsight.MemoryItem{
{Content: "Alice loves programming in Python"},
{Content: "Bob enjoys hiking and outdoor adventures"},
{Content: "Charlie is interested in quantum physics"},
{Content: "Diana plays the violin beautifully"},
req := RetainRequest{
Items: []MemoryItem{
{Content: "Alice enjoys hiking in the mountains"},
{Content: "Bob loves to read science fiction novels"},
{Content: "Charlie is learning to play the piano"},
},
}
_, err := c.RetainBatch(ctx, bankID, items)
_, _, err := client.MemoryAPI.RetainMemories(ctx, bankID).RetainRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
// Give the system time to process
time.Sleep(time.Second)
}
func TestRecallBasic(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
setupRecallBank(t, c, bankID)
setupRecallBank(t, client, bankID)
resp, err := c.Recall(ctx, bankID, "What does Alice like?")
req := RecallRequest{
Query: "outdoor activities",
}
resp, httpResp, err := client.MemoryAPI.RecallMemories(ctx, bankID).RecallRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
if len(resp.Results) == 0 {
t.Error("expected at least one result")
}
defer httpResp.Body.Close()
found := false
for _, r := range resp.Results {
if contains(r.Text, "Alice") || contains(r.Text, "Python") || contains(r.Text, "programming") {
found = true
break
}
}
if !found {
t.Error("expected a result mentioning Alice or Python")
if resp.Results == nil {
t.Error("expected results, got nil")
}
}
func TestRecallWithMaxTokens(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
setupRecallBank(t, c, bankID)
setupRecallBank(t, client, bankID)
resp, err := c.Recall(ctx, bankID, "outdoor activities",
hindsight.WithMaxTokens(1024),
)
req := RecallRequest{
Query: "outdoor activities",
MaxTokens: PtrInt32(1024),
}
resp, httpResp, err := client.MemoryAPI.RecallMemories(ctx, bankID).RecallRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
defer httpResp.Body.Close()
if resp.Results == nil {
t.Error("expected results, got nil")
}
}
func TestRecallFullFeatured(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
setupRecallBank(t, c, bankID)
setupRecallBank(t, client, bankID)
resp, err := c.Recall(ctx, bankID, "What are people's hobbies?",
hindsight.WithTypes([]string{"world"}),
hindsight.WithMaxTokens(2048),
hindsight.WithTrace(true),
)
req := RecallRequest{
Query: "What are people's hobbies?",
Types: []string{"world"},
MaxTokens: PtrInt32(2048),
Trace: PtrBool(true),
}
resp, httpResp, err := client.MemoryAPI.RecallMemories(ctx, bankID).RecallRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
defer httpResp.Body.Close()
if resp.Results == nil {
t.Error("expected results, got nil")
}
// Verify trace data is present
if resp.Trace != nil && len(resp.Trace) > 0 {
t.Logf("✓ Trace data received with %d keys", len(resp.Trace))
}
}
// --- Reflect tests ---
func setupReflectBank(t *testing.T, c *hindsight.Client, bankID string) {
func setupReflectBank(t *testing.T, client *APIClient, bankID string) {
t.Helper()
ctx := context.Background()
_, err := c.CreateBank(ctx, bankID,
hindsight.WithMission("I am a helpful AI assistant interested in technology and science."),
)
// Create bank with mission
createReq := CreateBankRequest{
Mission: *NewNullableString(PtrString("I am a helpful AI assistant interested in technology and science.")),
}
_, _, err := client.BanksAPI.CreateOrUpdateBank(ctx, bankID).CreateBankRequest(createReq).Execute()
if err != nil {
t.Fatal(err)
}
items := []hindsight.MemoryItem{
{Content: "The Python programming language is great for data science"},
{Content: "Machine learning models can recognize patterns in data"},
// Add memories
retainReq := RetainRequest{
Items: []MemoryItem{
{Content: "Quantum computing uses quantum bits (qubits) for processing"},
{Content: "Neural networks are inspired by biological neurons"},
},
}
_, err = c.RetainBatch(ctx, bankID, items)
_, _, err = client.MemoryAPI.RetainMemories(ctx, bankID).RetainRequest(retainReq).Execute()
if err != nil {
t.Fatal(err)
}
time.Sleep(time.Second)
}
func TestReflectBasic(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
setupReflectBank(t, c, bankID)
setupReflectBank(t, client, bankID)
resp, err := c.Reflect(ctx, bankID, "What do you think about artificial intelligence?")
req := ReflectRequest{
Query: "What do you know about computing?",
}
resp, httpResp, err := client.MemoryAPI.Reflect(ctx, bankID).ReflectRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
if resp.Text == "" {
t.Error("expected non-empty response text")
defer httpResp.Body.Close()
if resp.GetText() == "" {
t.Error("expected non-empty answer")
}
}
func TestReflectWithMaxTokens(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
setupReflectBank(t, c, bankID)
setupReflectBank(t, client, bankID)
resp, err := c.Reflect(ctx, bankID, "What do you think about Python?",
hindsight.WithReflectMaxTokens(500),
)
req := ReflectRequest{
Query: "Tell me about neural networks",
MaxTokens: PtrInt32(500),
}
resp, httpResp, err := client.MemoryAPI.Reflect(ctx, bankID).ReflectRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
if resp.Text == "" {
t.Error("expected non-empty response text")
defer httpResp.Body.Close()
if resp.GetText() == "" {
t.Error("expected non-empty answer")
}
}
// --- Bank tests ---
func TestCreateBank(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
resp, err := c.CreateBank(ctx, bankID,
hindsight.WithBankName("Test Bank"),
hindsight.WithMission("A test bank for Go client"),
)
req := CreateBankRequest{
Mission: *NewNullableString(PtrString("Test mission")),
}
resp, httpResp, err := client.BanksAPI.CreateOrUpdateBank(ctx, bankID).CreateBankRequest(req).Execute()
if err != nil {
t.Fatal(err)
}
if resp.BankID != bankID {
t.Errorf("expected bank_id=%q, got %q", bankID, resp.BankID)
defer httpResp.Body.Close()
if resp.GetBankId() != bankID {
t.Errorf("expected bank_id=%s, got %s", bankID, resp.GetBankId())
}
}
func TestSetMission(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
resp, err := c.SetMission(ctx, bankID, "Be a helpful PM tracking sprint progress")
// Create bank with initial mission
createReq := CreateBankRequest{
Mission: *NewNullableString(PtrString("Initial mission")),
}
_, _, err := client.BanksAPI.CreateOrUpdateBank(ctx, bankID).CreateBankRequest(createReq).Execute()
if err != nil {
t.Fatal(err)
}
if resp.BankID != bankID {
t.Errorf("expected bank_id=%q, got %q", bankID, resp.BankID)
// Update mission by creating/updating bank again
updateReq := CreateBankRequest{
Mission: *NewNullableString(PtrString("Updated mission")),
}
if resp.Mission != "Be a helpful PM tracking sprint progress" {
t.Errorf("expected mission=%q, got %q", "Be a helpful PM tracking sprint progress", resp.Mission)
resp, httpResp, err := client.BanksAPI.CreateOrUpdateBank(ctx, bankID).CreateBankRequest(updateReq).Execute()
if err != nil {
t.Fatal(err)
}
defer httpResp.Body.Close()
if resp.GetMission() != "Updated mission" {
t.Errorf("expected mission='Updated mission', got %s", resp.GetMission())
}
}
func TestListBanks(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
// Create a bank first
bankID := uniqueBank(t)
_, err := c.CreateBank(ctx, bankID)
resp, httpResp, err := client.BanksAPI.ListBanks(ctx).Execute()
if err != nil {
t.Fatal(err)
}
defer httpResp.Body.Close()
resp, err := c.ListBanks(ctx)
if err != nil {
t.Fatal(err)
}
if len(resp.Banks) == 0 {
t.Error("expected at least one bank")
if resp.Banks == nil {
t.Error("expected banks list, got nil")
}
}
func TestDeleteBank(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
_, err := c.CreateBank(ctx, bankID, hindsight.WithMission("will be deleted"))
// Create bank
createReq := CreateBankRequest{}
_, _, err := client.BanksAPI.CreateOrUpdateBank(ctx, bankID).CreateBankRequest(createReq).Execute()
if err != nil {
t.Fatal(err)
}
err = c.DeleteBank(ctx, bankID)
// Delete bank
resp, httpResp, err := client.BanksAPI.DeleteBank(ctx, bankID).Execute()
if err != nil {
t.Fatal(err)
}
defer httpResp.Body.Close()
if !resp.GetSuccess() {
t.Error("expected success=true")
}
}
// --- End-to-end workflow ---
// --- End-to-end workflow test ---
func TestCompleteWorkflow(t *testing.T) {
c := newClient(t)
client := newClient(t)
ctx := context.Background()
bankID := uniqueBank(t)
// 1. Create bank
_, err := c.CreateBank(ctx, bankID,
hindsight.WithMission("I am a software engineer who loves Python programming."),
)
createReq := CreateBankRequest{
Mission: *NewNullableString(PtrString("I am a helpful assistant")),
}
_, _, err := client.BanksAPI.CreateOrUpdateBank(ctx, bankID).CreateBankRequest(createReq).Execute()
if err != nil {
t.Fatal(err)
}
// 2. Store memories
items := []hindsight.MemoryItem{
{Content: "I completed a project using FastAPI"},
{Content: "I learned about async programming in Python"},
{Content: "I enjoy working on open source projects"},
// 2. Retain memories
retainReq := RetainRequest{
Items: []MemoryItem{
{Content: "Paris is the capital of France"},
{Content: "The Eiffel Tower is in Paris"},
},
}
storeResp, err := c.RetainBatch(ctx, bankID, items)
retainResp, _, err := client.MemoryAPI.RetainMemories(ctx, bankID).RetainRequest(retainReq).Execute()
if err != nil {
t.Fatal(err)
}
if !storeResp.Success {
t.Error("expected retain success")
if !retainResp.GetSuccess() {
t.Error("retain failed")
}
// 3. Search for relevant memories
recallResp, err := c.Recall(ctx, bankID, "What programming technologies do I use?")
time.Sleep(time.Second)
// 3. Recall
recallReq := RecallRequest{
Query: "What is in Paris?",
}
recallResp, _, err := client.MemoryAPI.RecallMemories(ctx, bankID).RecallRequest(recallReq).Execute()
if err != nil {
t.Fatal(err)
}
@ -374,26 +463,17 @@ func TestCompleteWorkflow(t *testing.T) {
t.Error("expected recall results")
}
// 4. Generate contextual answer
reflectResp, err := c.Reflect(ctx, bankID, "What are my professional interests?")
// 4. Reflect
reflectReq := ReflectRequest{
Query: "Tell me about Paris",
}
reflectResp, _, err := client.MemoryAPI.Reflect(ctx, bankID).ReflectRequest(reflectReq).Execute()
if err != nil {
t.Fatal(err)
}
if reflectResp.Text == "" {
t.Error("expected non-empty reflect response")
if reflectResp.GetText() == "" {
t.Error("expected reflect answer")
}
}
// contains checks if s contains substr (case-sensitive).
func contains(s, substr string) bool {
return len(s) >= len(substr) && searchString(s, substr)
}
func searchString(s, substr string) bool {
for i := 0; i <= len(s)-len(substr); i++ {
if s[i:i+len(substr)] == substr {
return true
}
}
return false
t.Log("✓ Complete workflow passed")
}

View file

@ -1,111 +0,0 @@
// Command preprocess converts an OpenAPI 3.1 spec to be ogen-compatible.
//
// Hindsight's OpenAPI spec uses anyOf: [{type: T}, {type: null}] for optional
// fields. ogen cannot handle the null type in header/query parameter schemas
// with style:simple. This tool rewrites such patterns to plain {type: T},
// making the spec consumable by ogen while preserving semantic meaning (the
// fields are already marked as required: false).
package main
import (
"encoding/json"
"fmt"
"os"
)
func main() {
if len(os.Args) != 3 {
fmt.Fprintf(os.Stderr, "usage: preprocess <input.json> <output.json>\n")
os.Exit(1)
}
data, err := os.ReadFile(os.Args[1])
if err != nil {
fmt.Fprintf(os.Stderr, "read: %v\n", err)
os.Exit(1)
}
var spec map[string]any
if err := json.Unmarshal(data, &spec); err != nil {
fmt.Fprintf(os.Stderr, "parse: %v\n", err)
os.Exit(1)
}
convertAnyOfNull(spec)
out, err := json.MarshalIndent(spec, "", " ")
if err != nil {
fmt.Fprintf(os.Stderr, "marshal: %v\n", err)
os.Exit(1)
}
if err := os.WriteFile(os.Args[2], out, 0o644); err != nil {
fmt.Fprintf(os.Stderr, "write: %v\n", err)
os.Exit(1)
}
}
// convertAnyOfNull recursively walks the spec and converts
// anyOf: [{type: T}, {type: null}] → {type: T} (or just the non-null schema).
// For component schema properties, it also does the conversion but additionally
// handles cases where the non-null branch is a $ref.
func convertAnyOfNull(v any) {
switch val := v.(type) {
case map[string]any:
// Check if this object has an "anyOf" with exactly a non-null + null pair.
if tryConvertAnyOf(val) {
// Converted in place; recurse into the result.
convertAnyOfNull(val)
return
}
// Recurse into all values.
for _, child := range val {
convertAnyOfNull(child)
}
case []any:
for _, child := range val {
convertAnyOfNull(child)
}
}
}
// tryConvertAnyOf checks if m has anyOf: [{...}, {type: null}] and converts
// it in-place. Returns true if conversion happened.
func tryConvertAnyOf(m map[string]any) bool {
anyOf, ok := m["anyOf"].([]any)
if !ok || len(anyOf) != 2 {
return false
}
// Identify which branch is null and which is the real type.
var realIdx int = -1
for i, branch := range anyOf {
branchMap, ok := branch.(map[string]any)
if !ok {
return false
}
if branchMap["type"] == "null" {
continue
}
realIdx = i
}
if realIdx == -1 {
return false // Both are null? Skip.
}
realBranch, ok := anyOf[realIdx].(map[string]any)
if !ok {
return false
}
// Remove the anyOf key.
delete(m, "anyOf")
// Copy all properties from the real branch into the parent.
for k, v := range realBranch {
m[k] = v
}
return true
}

View file

@ -1,2 +0,0 @@
# Preprocessed OpenAPI spec (intermediate artifact, regenerated by go generate)
openapi.json

View file

@ -1,61 +0,0 @@
// Code generated by ogen, DO NOT EDIT.
package ogenapi
import (
"net/http"
ht "github.com/ogen-go/ogen/http"
)
type (
optionFunc[C any] func(*C)
)
type clientConfig struct {
Client ht.Client
}
// ClientOption is client config option.
type ClientOption interface {
applyClient(*clientConfig)
}
var _ ClientOption = (optionFunc[clientConfig])(nil)
func (o optionFunc[C]) applyClient(c *C) {
o(c)
}
func newClientConfig(opts ...ClientOption) clientConfig {
cfg := clientConfig{
Client: http.DefaultClient,
}
for _, opt := range opts {
opt.applyClient(&cfg)
}
return cfg
}
type baseClient struct {
cfg clientConfig
}
func (cfg clientConfig) baseClient() (c baseClient, err error) {
c = baseClient{cfg: cfg}
return c, nil
}
// Option is config option.
type Option interface {
ClientOption
}
// WithClient specifies http client to use.
func WithClient(client ht.Client) ClientOption {
return optionFunc[clientConfig](func(cfg *clientConfig) {
if client != nil {
cfg.Client = client
}
})
}

File diff suppressed because it is too large Load diff

View file

@ -1,179 +0,0 @@
// Code generated by ogen, DO NOT EDIT.
package ogenapi
// setDefaults set default value of fields.
func (s *AddBackgroundRequest) setDefaults() {
{
val := bool(true)
s.UpdateDisposition.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *BankStatsResponse) setDefaults() {
{
val := int(0)
s.PendingConsolidation.SetTo(val)
}
{
val := int(0)
s.TotalObservations.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *ChunkData) setDefaults() {
{
val := bool(false)
s.Truncated.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *ChunkIncludeOptions) setDefaults() {
{
val := int(8192)
s.MaxTokens.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *ConsolidationResponse) setDefaults() {
{
val := bool(false)
s.Deduplicated.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *CreateDirectiveRequest) setDefaults() {
{
val := bool(true)
s.IsActive.SetTo(val)
}
{
val := int(0)
s.Priority.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *CreateMentalModelRequest) setDefaults() {
{
val := int(2048)
s.MaxTokens.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *DirectiveResponse) setDefaults() {
{
val := bool(true)
s.IsActive.SetTo(val)
}
{
val := int(0)
s.Priority.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *EntityIncludeOptions) setDefaults() {
{
val := int(500)
s.MaxTokens.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *MentalModelResponse) setDefaults() {
{
val := int(2048)
s.MaxTokens.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *MentalModelTrigger) setDefaults() {
{
val := bool(false)
s.RefreshAfterConsolidation.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *RecallRequest) setDefaults() {
{
val := Budget("low")
s.Budget.SetTo(val)
}
{
val := int(4096)
s.MaxTokens.SetTo(val)
}
{
val := RecallRequestTagsMatch("any")
s.TagsMatch.SetTo(val)
}
{
val := bool(false)
s.Trace.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *ReflectRequest) setDefaults() {
{
val := Budget("low")
s.Budget.SetTo(val)
}
{
val := int(4096)
s.MaxTokens.SetTo(val)
}
{
val := ReflectRequestTagsMatch("any")
s.TagsMatch.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *ReflectToolCall) setDefaults() {
{
val := int(0)
s.Iteration.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *RetainRequest) setDefaults() {
{
val := bool(false)
s.Async.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *TokenUsage) setDefaults() {
{
val := int(0)
s.InputTokens.SetTo(val)
}
{
val := int(0)
s.OutputTokens.SetTo(val)
}
{
val := int(0)
s.TotalTokens.SetTo(val)
}
}
// setDefaults set default value of fields.
func (s *ToolCallsIncludeOptions) setDefaults() {
{
val := bool(true)
s.Output.SetTo(val)
}
}

View file

@ -1,170 +0,0 @@
// Code generated by ogen, DO NOT EDIT.
package ogenapi
type AddBankBackgroundRes interface {
addBankBackgroundRes()
}
type CancelOperationRes interface {
cancelOperationRes()
}
type ClearBankMemoriesRes interface {
clearBankMemoriesRes()
}
type ClearObservationsRes interface {
clearObservationsRes()
}
type CreateDirectiveRes interface {
createDirectiveRes()
}
type CreateMentalModelRes interface {
createMentalModelRes()
}
type CreateOrUpdateBankRes interface {
createOrUpdateBankRes()
}
type DeleteBankRes interface {
deleteBankRes()
}
type DeleteDirectiveRes interface {
deleteDirectiveRes()
}
type DeleteDocumentRes interface {
deleteDocumentRes()
}
type DeleteMentalModelRes interface {
deleteMentalModelRes()
}
type GetAgentStatsRes interface {
getAgentStatsRes()
}
type GetBankConfigRes interface {
getBankConfigRes()
}
type GetBankProfileRes interface {
getBankProfileRes()
}
type GetChunkRes interface {
getChunkRes()
}
type GetDirectiveRes interface {
getDirectiveRes()
}
type GetDocumentRes interface {
getDocumentRes()
}
type GetEntityRes interface {
getEntityRes()
}
type GetGraphRes interface {
getGraphRes()
}
type GetMemoryRes interface {
getMemoryRes()
}
type GetMentalModelRes interface {
getMentalModelRes()
}
type GetOperationStatusRes interface {
getOperationStatusRes()
}
type ListBanksRes interface {
listBanksRes()
}
type ListDirectivesRes interface {
listDirectivesRes()
}
type ListDocumentsRes interface {
listDocumentsRes()
}
type ListEntitiesRes interface {
listEntitiesRes()
}
type ListMemoriesRes interface {
listMemoriesRes()
}
type ListMentalModelsRes interface {
listMentalModelsRes()
}
type ListOperationsRes interface {
listOperationsRes()
}
type ListTagsRes interface {
listTagsRes()
}
type RecallMemoriesRes interface {
recallMemoriesRes()
}
type ReflectRes interface {
reflectRes()
}
type RefreshMentalModelRes interface {
refreshMentalModelRes()
}
type RegenerateEntityObservationsRes interface {
regenerateEntityObservationsRes()
}
type ResetBankConfigRes interface {
resetBankConfigRes()
}
type RetainMemoriesRes interface {
retainMemoriesRes()
}
type TriggerConsolidationRes interface {
triggerConsolidationRes()
}
type UpdateBankConfigRes interface {
updateBankConfigRes()
}
type UpdateBankDispositionRes interface {
updateBankDispositionRes()
}
type UpdateBankRes interface {
updateBankRes()
}
type UpdateDirectiveRes interface {
updateDirectiveRes()
}
type UpdateMentalModelRes interface {
updateMentalModelRes()
}

File diff suppressed because it is too large Load diff

View file

@ -1,54 +0,0 @@
// Code generated by ogen, DO NOT EDIT.
package ogenapi
// OperationName is the ogen operation name
type OperationName = string
const (
AddBankBackgroundOperation OperationName = "AddBankBackground"
CancelOperationOperation OperationName = "CancelOperation"
ClearBankMemoriesOperation OperationName = "ClearBankMemories"
ClearObservationsOperation OperationName = "ClearObservations"
CreateDirectiveOperation OperationName = "CreateDirective"
CreateMentalModelOperation OperationName = "CreateMentalModel"
CreateOrUpdateBankOperation OperationName = "CreateOrUpdateBank"
DeleteBankOperation OperationName = "DeleteBank"
DeleteDirectiveOperation OperationName = "DeleteDirective"
DeleteDocumentOperation OperationName = "DeleteDocument"
DeleteMentalModelOperation OperationName = "DeleteMentalModel"
GetAgentStatsOperation OperationName = "GetAgentStats"
GetBankConfigOperation OperationName = "GetBankConfig"
GetBankProfileOperation OperationName = "GetBankProfile"
GetChunkOperation OperationName = "GetChunk"
GetDirectiveOperation OperationName = "GetDirective"
GetDocumentOperation OperationName = "GetDocument"
GetEntityOperation OperationName = "GetEntity"
GetGraphOperation OperationName = "GetGraph"
GetMemoryOperation OperationName = "GetMemory"
GetMentalModelOperation OperationName = "GetMentalModel"
GetOperationStatusOperation OperationName = "GetOperationStatus"
GetVersionOperation OperationName = "GetVersion"
HealthEndpointHealthGetOperation OperationName = "HealthEndpointHealthGet"
ListBanksOperation OperationName = "ListBanks"
ListDirectivesOperation OperationName = "ListDirectives"
ListDocumentsOperation OperationName = "ListDocuments"
ListEntitiesOperation OperationName = "ListEntities"
ListMemoriesOperation OperationName = "ListMemories"
ListMentalModelsOperation OperationName = "ListMentalModels"
ListOperationsOperation OperationName = "ListOperations"
ListTagsOperation OperationName = "ListTags"
MetricsEndpointMetricsGetOperation OperationName = "MetricsEndpointMetricsGet"
RecallMemoriesOperation OperationName = "RecallMemories"
ReflectOperation OperationName = "Reflect"
RefreshMentalModelOperation OperationName = "RefreshMentalModel"
RegenerateEntityObservationsOperation OperationName = "RegenerateEntityObservations"
ResetBankConfigOperation OperationName = "ResetBankConfig"
RetainMemoriesOperation OperationName = "RetainMemories"
TriggerConsolidationOperation OperationName = "TriggerConsolidation"
UpdateBankOperation OperationName = "UpdateBank"
UpdateBankConfigOperation OperationName = "UpdateBankConfig"
UpdateBankDispositionOperation OperationName = "UpdateBankDisposition"
UpdateDirectiveOperation OperationName = "UpdateDirective"
UpdateMentalModelOperation OperationName = "UpdateMentalModel"
)

View file

@ -1,264 +0,0 @@
// Code generated by ogen, DO NOT EDIT.
package ogenapi
// AddBankBackgroundParams is parameters of add_bank_background operation.
type AddBankBackgroundParams struct {
BankID string
}
// CancelOperationParams is parameters of cancel_operation operation.
type CancelOperationParams struct {
BankID string
OperationID string
}
// ClearBankMemoriesParams is parameters of clear_bank_memories operation.
type ClearBankMemoriesParams struct {
BankID string
// Optional fact type filter (world, experience, opinion).
Type OptString `json:",omitempty,omitzero"`
}
// ClearObservationsParams is parameters of clear_observations operation.
type ClearObservationsParams struct {
BankID string
}
// CreateDirectiveParams is parameters of create_directive operation.
type CreateDirectiveParams struct {
BankID string
}
// CreateMentalModelParams is parameters of create_mental_model operation.
type CreateMentalModelParams struct {
BankID string
}
// CreateOrUpdateBankParams is parameters of create_or_update_bank operation.
type CreateOrUpdateBankParams struct {
BankID string
}
// DeleteBankParams is parameters of delete_bank operation.
type DeleteBankParams struct {
BankID string
}
// DeleteDirectiveParams is parameters of delete_directive operation.
type DeleteDirectiveParams struct {
BankID string
DirectiveID string
}
// DeleteDocumentParams is parameters of delete_document operation.
type DeleteDocumentParams struct {
BankID string
DocumentID string
}
// DeleteMentalModelParams is parameters of delete_mental_model operation.
type DeleteMentalModelParams struct {
BankID string
MentalModelID string
}
// GetAgentStatsParams is parameters of get_agent_stats operation.
type GetAgentStatsParams struct {
BankID string
}
// GetBankConfigParams is parameters of get_bank_config operation.
type GetBankConfigParams struct {
BankID string
}
// GetBankProfileParams is parameters of get_bank_profile operation.
type GetBankProfileParams struct {
BankID string
}
// GetChunkParams is parameters of get_chunk operation.
type GetChunkParams struct {
ChunkID string
}
// GetDirectiveParams is parameters of get_directive operation.
type GetDirectiveParams struct {
BankID string
DirectiveID string
}
// GetDocumentParams is parameters of get_document operation.
type GetDocumentParams struct {
BankID string
DocumentID string
}
// GetEntityParams is parameters of get_entity operation.
type GetEntityParams struct {
BankID string
EntityID string
}
// GetGraphParams is parameters of get_graph operation.
type GetGraphParams struct {
BankID string
Type OptString `json:",omitempty,omitzero"`
Limit OptInt `json:",omitempty,omitzero"`
}
// GetMemoryParams is parameters of get_memory operation.
type GetMemoryParams struct {
BankID string
MemoryID string
}
// GetMentalModelParams is parameters of get_mental_model operation.
type GetMentalModelParams struct {
BankID string
MentalModelID string
}
// GetOperationStatusParams is parameters of get_operation_status operation.
type GetOperationStatusParams struct {
BankID string
OperationID string
}
// ListDirectivesParams is parameters of list_directives operation.
type ListDirectivesParams struct {
BankID string
// Filter by tags.
Tags []string `json:",omitempty"`
// How to match tags.
TagsMatch OptListDirectivesTagsMatch `json:",omitempty,omitzero"`
// Only return active directives.
ActiveOnly OptBool `json:",omitempty,omitzero"`
Limit OptInt `json:",omitempty,omitzero"`
Offset OptInt `json:",omitempty,omitzero"`
}
// ListDocumentsParams is parameters of list_documents operation.
type ListDocumentsParams struct {
BankID string
Q OptString `json:",omitempty,omitzero"`
Limit OptInt `json:",omitempty,omitzero"`
Offset OptInt `json:",omitempty,omitzero"`
}
// ListEntitiesParams is parameters of list_entities operation.
type ListEntitiesParams struct {
BankID string
// Maximum number of entities to return.
Limit OptInt `json:",omitempty,omitzero"`
// Offset for pagination.
Offset OptInt `json:",omitempty,omitzero"`
}
// ListMemoriesParams is parameters of list_memories operation.
type ListMemoriesParams struct {
BankID string
Type OptString `json:",omitempty,omitzero"`
Q OptString `json:",omitempty,omitzero"`
Limit OptInt `json:",omitempty,omitzero"`
Offset OptInt `json:",omitempty,omitzero"`
}
// ListMentalModelsParams is parameters of list_mental_models operation.
type ListMentalModelsParams struct {
BankID string
// Filter by tags.
Tags []string `json:",omitempty"`
// How to match tags.
TagsMatch OptListMentalModelsTagsMatch `json:",omitempty,omitzero"`
Limit OptInt `json:",omitempty,omitzero"`
Offset OptInt `json:",omitempty,omitzero"`
}
// ListOperationsParams is parameters of list_operations operation.
type ListOperationsParams struct {
BankID string
// Filter by status: pending, completed, or failed.
Status OptString `json:",omitempty,omitzero"`
// Maximum number of operations to return.
Limit OptInt `json:",omitempty,omitzero"`
// Number of operations to skip.
Offset OptInt `json:",omitempty,omitzero"`
}
// ListTagsParams is parameters of list_tags operation.
type ListTagsParams struct {
BankID string
// Wildcard pattern to filter tags (e.g., 'user:*' for user:alice, '*-admin' for role-admin). Use '*'
// as wildcard. Case-insensitive.
Q OptString `json:",omitempty,omitzero"`
// Maximum number of tags to return.
Limit OptInt `json:",omitempty,omitzero"`
// Offset for pagination.
Offset OptInt `json:",omitempty,omitzero"`
}
// RecallMemoriesParams is parameters of recall_memories operation.
type RecallMemoriesParams struct {
BankID string
}
// ReflectParams is parameters of reflect operation.
type ReflectParams struct {
BankID string
}
// RefreshMentalModelParams is parameters of refresh_mental_model operation.
type RefreshMentalModelParams struct {
BankID string
MentalModelID string
}
// RegenerateEntityObservationsParams is parameters of regenerate_entity_observations operation.
type RegenerateEntityObservationsParams struct {
BankID string
EntityID string
}
// ResetBankConfigParams is parameters of reset_bank_config operation.
type ResetBankConfigParams struct {
BankID string
}
// RetainMemoriesParams is parameters of retain_memories operation.
type RetainMemoriesParams struct {
BankID string
}
// TriggerConsolidationParams is parameters of trigger_consolidation operation.
type TriggerConsolidationParams struct {
BankID string
}
// UpdateBankParams is parameters of update_bank operation.
type UpdateBankParams struct {
BankID string
}
// UpdateBankConfigParams is parameters of update_bank_config operation.
type UpdateBankConfigParams struct {
BankID string
}
// UpdateBankDispositionParams is parameters of update_bank_disposition operation.
type UpdateBankDispositionParams struct {
BankID string
}
// UpdateDirectiveParams is parameters of update_directive operation.
type UpdateDirectiveParams struct {
BankID string
DirectiveID string
}
// UpdateMentalModelParams is parameters of update_mental_model operation.
type UpdateMentalModelParams struct {
BankID string
MentalModelID string
}

View file

@ -1,179 +0,0 @@
// Code generated by ogen, DO NOT EDIT.
package ogenapi
import (
"bytes"
"net/http"
"github.com/go-faster/jx"
ht "github.com/ogen-go/ogen/http"
)
func encodeAddBankBackgroundRequest(
req *AddBackgroundRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeCreateDirectiveRequest(
req *CreateDirectiveRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeCreateMentalModelRequest(
req *CreateMentalModelRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeCreateOrUpdateBankRequest(
req *CreateBankRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeRecallMemoriesRequest(
req *RecallRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeReflectRequest(
req *ReflectRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeRetainMemoriesRequest(
req *RetainRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeUpdateBankRequest(
req *CreateBankRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeUpdateBankConfigRequest(
req *BankConfigUpdate,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeUpdateBankDispositionRequest(
req *UpdateDispositionRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeUpdateDirectiveRequest(
req *UpdateDirectiveRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}
func encodeUpdateMentalModelRequest(
req *UpdateMentalModelRequest,
r *http.Request,
) error {
const contentType = "application/json"
e := new(jx.Encoder)
{
req.Encode(e)
}
encoded := e.Bytes()
ht.SetBody(r, bytes.NewReader(encoded), contentType)
return nil
}

File diff suppressed because it is too large Load diff

View file

@ -1,935 +0,0 @@
// Code generated by ogen, DO NOT EDIT.
package ogenapi
import (
"fmt"
"github.com/go-faster/errors"
"github.com/ogen-go/ogen/validate"
)
func (s *BackgroundResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if value, ok := s.Disposition.Get(); ok {
if err := func() error {
if err := value.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "disposition",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *BankListItem) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.Disposition.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "disposition",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *BankListResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Banks == nil {
return errors.New("nil is invalid value")
}
var failures []validate.FieldError
for i, elem := range s.Banks {
if err := func() error {
if err := elem.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: fmt.Sprintf("[%d]", i),
Error: err,
})
}
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "banks",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *BankProfileResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.Disposition.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "disposition",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s Budget) Validate() error {
switch s {
case "low":
return nil
case "mid":
return nil
case "high":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *CreateBankRequest) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if value, ok := s.Disposition.Get(); ok {
if err := func() error {
if err := value.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "disposition",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *CreateMentalModelRequest) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if value, ok := s.MaxTokens.Get(); ok {
if err := func() error {
if err := (validate.Int{
MinSet: true,
Min: 256,
MaxSet: true,
Max: 8192,
MinExclusive: false,
MaxExclusive: false,
MultipleOfSet: false,
MultipleOf: 0,
Pattern: nil,
}).Validate(int64(value)); err != nil {
return errors.Wrap(err, "int")
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "max_tokens",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *DirectiveListResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Items == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "items",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *DispositionTraits) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := (validate.Int{
MinSet: true,
Min: 1,
MaxSet: true,
Max: 5,
MinExclusive: false,
MaxExclusive: false,
MultipleOfSet: false,
MultipleOf: 0,
Pattern: nil,
}).Validate(int64(s.Empathy)); err != nil {
return errors.Wrap(err, "int")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "empathy",
Error: err,
})
}
if err := func() error {
if err := (validate.Int{
MinSet: true,
Min: 1,
MaxSet: true,
Max: 5,
MinExclusive: false,
MaxExclusive: false,
MultipleOfSet: false,
MultipleOf: 0,
Pattern: nil,
}).Validate(int64(s.Literalism)); err != nil {
return errors.Wrap(err, "int")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "literalism",
Error: err,
})
}
if err := func() error {
if err := (validate.Int{
MinSet: true,
Min: 1,
MaxSet: true,
Max: 5,
MinExclusive: false,
MaxExclusive: false,
MultipleOfSet: false,
MultipleOf: 0,
Pattern: nil,
}).Validate(int64(s.Skepticism)); err != nil {
return errors.Wrap(err, "int")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "skepticism",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *EntityDetailResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Observations == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "observations",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *EntityListResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Items == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "items",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *EntityStateResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Observations == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "observations",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *GraphDataResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Edges == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "edges",
Error: err,
})
}
if err := func() error {
if s.Nodes == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "nodes",
Error: err,
})
}
if err := func() error {
if s.TableRows == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "table_rows",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *HTTPValidationError) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
var failures []validate.FieldError
for i, elem := range s.Detail {
if err := func() error {
if err := elem.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: fmt.Sprintf("[%d]", i),
Error: err,
})
}
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "detail",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s ListDirectivesTagsMatch) Validate() error {
switch s {
case "any":
return nil
case "all":
return nil
case "exact":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *ListDocumentsResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Items == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "items",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *ListMemoryUnitsResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Items == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "items",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s ListMentalModelsTagsMatch) Validate() error {
switch s {
case "any":
return nil
case "all":
return nil
case "exact":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *ListTagsResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Items == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "items",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *MentalModelListResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Items == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "items",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *OperationStatusResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.Status.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "status",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s OperationStatusResponseStatus) Validate() error {
switch s {
case "pending":
return nil
case "completed":
return nil
case "failed":
return nil
case "not_found":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *OperationsListResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Operations == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "operations",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *RecallRequest) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if value, ok := s.Budget.Get(); ok {
if err := func() error {
if err := value.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "budget",
Error: err,
})
}
if err := func() error {
if value, ok := s.TagsMatch.Get(); ok {
if err := func() error {
if err := value.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "tags_match",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s RecallRequestTagsMatch) Validate() error {
switch s {
case "any":
return nil
case "all":
return nil
case "any_strict":
return nil
case "all_strict":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *RecallResponse) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if value, ok := s.Entities.Get(); ok {
if err := func() error {
if err := value.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "entities",
Error: err,
})
}
if err := func() error {
if s.Results == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "results",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s RecallResponseEntities) Validate() error {
var failures []validate.FieldError
for key, elem := range s {
if err := func() error {
if err := elem.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: key,
Error: err,
})
}
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *ReflectRequest) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if value, ok := s.Budget.Get(); ok {
if err := func() error {
if err := value.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "budget",
Error: err,
})
}
if err := func() error {
if value, ok := s.TagsMatch.Get(); ok {
if err := func() error {
if err := value.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "tags_match",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s ReflectRequestTagsMatch) Validate() error {
switch s {
case "any":
return nil
case "all":
return nil
case "any_strict":
return nil
case "all_strict":
return nil
default:
return errors.Errorf("invalid value: %v", s)
}
}
func (s *RetainRequest) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Items == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "items",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *UpdateDispositionRequest) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if err := s.Disposition.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "disposition",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *UpdateMentalModelRequest) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if value, ok := s.MaxTokens.Get(); ok {
if err := func() error {
if err := (validate.Int{
MinSet: true,
Min: 256,
MaxSet: true,
Max: 8192,
MinExclusive: false,
MaxExclusive: false,
MultipleOfSet: false,
MultipleOf: 0,
Pattern: nil,
}).Validate(int64(value)); err != nil {
return errors.Wrap(err, "int")
}
return nil
}(); err != nil {
return err
}
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "max_tokens",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}
func (s *ValidationError) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
if s.Loc == nil {
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
Name: "loc",
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}

View file

@ -0,0 +1,200 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the AddBackgroundRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AddBackgroundRequest{}
// AddBackgroundRequest Request model for adding/merging background information. Deprecated: use SetMissionRequest instead.
type AddBackgroundRequest struct {
// New background information to add or merge
Content string `json:"content"`
// Deprecated - disposition is no longer auto-inferred from mission
UpdateDisposition *bool `json:"update_disposition,omitempty"`
}
type _AddBackgroundRequest AddBackgroundRequest
// NewAddBackgroundRequest instantiates a new AddBackgroundRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewAddBackgroundRequest(content string) *AddBackgroundRequest {
this := AddBackgroundRequest{}
this.Content = content
var updateDisposition bool = true
this.UpdateDisposition = &updateDisposition
return &this
}
// NewAddBackgroundRequestWithDefaults instantiates a new AddBackgroundRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewAddBackgroundRequestWithDefaults() *AddBackgroundRequest {
this := AddBackgroundRequest{}
var updateDisposition bool = true
this.UpdateDisposition = &updateDisposition
return &this
}
// GetContent returns the Content field value
func (o *AddBackgroundRequest) GetContent() string {
if o == nil {
var ret string
return ret
}
return o.Content
}
// GetContentOk returns a tuple with the Content field value
// and a boolean to check if the value has been set.
func (o *AddBackgroundRequest) GetContentOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Content, true
}
// SetContent sets field value
func (o *AddBackgroundRequest) SetContent(v string) {
o.Content = v
}
// GetUpdateDisposition returns the UpdateDisposition field value if set, zero value otherwise.
func (o *AddBackgroundRequest) GetUpdateDisposition() bool {
if o == nil || IsNil(o.UpdateDisposition) {
var ret bool
return ret
}
return *o.UpdateDisposition
}
// GetUpdateDispositionOk returns a tuple with the UpdateDisposition field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AddBackgroundRequest) GetUpdateDispositionOk() (*bool, bool) {
if o == nil || IsNil(o.UpdateDisposition) {
return nil, false
}
return o.UpdateDisposition, true
}
// HasUpdateDisposition returns a boolean if a field has been set.
func (o *AddBackgroundRequest) HasUpdateDisposition() bool {
if o != nil && !IsNil(o.UpdateDisposition) {
return true
}
return false
}
// SetUpdateDisposition gets a reference to the given bool and assigns it to the UpdateDisposition field.
func (o *AddBackgroundRequest) SetUpdateDisposition(v bool) {
o.UpdateDisposition = &v
}
func (o AddBackgroundRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AddBackgroundRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["content"] = o.Content
if !IsNil(o.UpdateDisposition) {
toSerialize["update_disposition"] = o.UpdateDisposition
}
return toSerialize, nil
}
func (o *AddBackgroundRequest) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"content",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varAddBackgroundRequest := _AddBackgroundRequest{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varAddBackgroundRequest)
if err != nil {
return err
}
*o = AddBackgroundRequest(varAddBackgroundRequest)
return err
}
type NullableAddBackgroundRequest struct {
value *AddBackgroundRequest
isSet bool
}
func (v NullableAddBackgroundRequest) Get() *AddBackgroundRequest {
return v.value
}
func (v *NullableAddBackgroundRequest) Set(val *AddBackgroundRequest) {
v.value = val
v.isSet = true
}
func (v NullableAddBackgroundRequest) IsSet() bool {
return v.isSet
}
func (v *NullableAddBackgroundRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAddBackgroundRequest(val *AddBackgroundRequest) *NullableAddBackgroundRequest {
return &NullableAddBackgroundRequest{value: val, isSet: true}
}
func (v NullableAddBackgroundRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAddBackgroundRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,186 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the AsyncOperationSubmitResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AsyncOperationSubmitResponse{}
// AsyncOperationSubmitResponse Response model for submitting an async operation.
type AsyncOperationSubmitResponse struct {
OperationId string `json:"operation_id"`
Status string `json:"status"`
}
type _AsyncOperationSubmitResponse AsyncOperationSubmitResponse
// NewAsyncOperationSubmitResponse instantiates a new AsyncOperationSubmitResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewAsyncOperationSubmitResponse(operationId string, status string) *AsyncOperationSubmitResponse {
this := AsyncOperationSubmitResponse{}
this.OperationId = operationId
this.Status = status
return &this
}
// NewAsyncOperationSubmitResponseWithDefaults instantiates a new AsyncOperationSubmitResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewAsyncOperationSubmitResponseWithDefaults() *AsyncOperationSubmitResponse {
this := AsyncOperationSubmitResponse{}
return &this
}
// GetOperationId returns the OperationId field value
func (o *AsyncOperationSubmitResponse) GetOperationId() string {
if o == nil {
var ret string
return ret
}
return o.OperationId
}
// GetOperationIdOk returns a tuple with the OperationId field value
// and a boolean to check if the value has been set.
func (o *AsyncOperationSubmitResponse) GetOperationIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OperationId, true
}
// SetOperationId sets field value
func (o *AsyncOperationSubmitResponse) SetOperationId(v string) {
o.OperationId = v
}
// GetStatus returns the Status field value
func (o *AsyncOperationSubmitResponse) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *AsyncOperationSubmitResponse) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *AsyncOperationSubmitResponse) SetStatus(v string) {
o.Status = v
}
func (o AsyncOperationSubmitResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AsyncOperationSubmitResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["operation_id"] = o.OperationId
toSerialize["status"] = o.Status
return toSerialize, nil
}
func (o *AsyncOperationSubmitResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"operation_id",
"status",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varAsyncOperationSubmitResponse := _AsyncOperationSubmitResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varAsyncOperationSubmitResponse)
if err != nil {
return err
}
*o = AsyncOperationSubmitResponse(varAsyncOperationSubmitResponse)
return err
}
type NullableAsyncOperationSubmitResponse struct {
value *AsyncOperationSubmitResponse
isSet bool
}
func (v NullableAsyncOperationSubmitResponse) Get() *AsyncOperationSubmitResponse {
return v.value
}
func (v *NullableAsyncOperationSubmitResponse) Set(val *AsyncOperationSubmitResponse) {
v.value = val
v.isSet = true
}
func (v NullableAsyncOperationSubmitResponse) IsSet() bool {
return v.isSet
}
func (v *NullableAsyncOperationSubmitResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAsyncOperationSubmitResponse(val *AsyncOperationSubmitResponse) *NullableAsyncOperationSubmitResponse {
return &NullableAsyncOperationSubmitResponse{value: val, isSet: true}
}
func (v NullableAsyncOperationSubmitResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAsyncOperationSubmitResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,250 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the BackgroundResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BackgroundResponse{}
// BackgroundResponse Response model for background update. Deprecated: use MissionResponse instead.
type BackgroundResponse struct {
Mission string `json:"mission"`
Background NullableString `json:"background,omitempty"`
Disposition NullableDispositionTraits `json:"disposition,omitempty"`
}
type _BackgroundResponse BackgroundResponse
// NewBackgroundResponse instantiates a new BackgroundResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBackgroundResponse(mission string) *BackgroundResponse {
this := BackgroundResponse{}
this.Mission = mission
return &this
}
// NewBackgroundResponseWithDefaults instantiates a new BackgroundResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBackgroundResponseWithDefaults() *BackgroundResponse {
this := BackgroundResponse{}
return &this
}
// GetMission returns the Mission field value
func (o *BackgroundResponse) GetMission() string {
if o == nil {
var ret string
return ret
}
return o.Mission
}
// GetMissionOk returns a tuple with the Mission field value
// and a boolean to check if the value has been set.
func (o *BackgroundResponse) GetMissionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Mission, true
}
// SetMission sets field value
func (o *BackgroundResponse) SetMission(v string) {
o.Mission = v
}
// GetBackground returns the Background field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BackgroundResponse) GetBackground() string {
if o == nil || IsNil(o.Background.Get()) {
var ret string
return ret
}
return *o.Background.Get()
}
// GetBackgroundOk returns a tuple with the Background field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BackgroundResponse) GetBackgroundOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Background.Get(), o.Background.IsSet()
}
// HasBackground returns a boolean if a field has been set.
func (o *BackgroundResponse) HasBackground() bool {
if o != nil && o.Background.IsSet() {
return true
}
return false
}
// SetBackground gets a reference to the given NullableString and assigns it to the Background field.
func (o *BackgroundResponse) SetBackground(v string) {
o.Background.Set(&v)
}
// SetBackgroundNil sets the value for Background to be an explicit nil
func (o *BackgroundResponse) SetBackgroundNil() {
o.Background.Set(nil)
}
// UnsetBackground ensures that no value is present for Background, not even an explicit nil
func (o *BackgroundResponse) UnsetBackground() {
o.Background.Unset()
}
// GetDisposition returns the Disposition field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BackgroundResponse) GetDisposition() DispositionTraits {
if o == nil || IsNil(o.Disposition.Get()) {
var ret DispositionTraits
return ret
}
return *o.Disposition.Get()
}
// GetDispositionOk returns a tuple with the Disposition field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BackgroundResponse) GetDispositionOk() (*DispositionTraits, bool) {
if o == nil {
return nil, false
}
return o.Disposition.Get(), o.Disposition.IsSet()
}
// HasDisposition returns a boolean if a field has been set.
func (o *BackgroundResponse) HasDisposition() bool {
if o != nil && o.Disposition.IsSet() {
return true
}
return false
}
// SetDisposition gets a reference to the given NullableDispositionTraits and assigns it to the Disposition field.
func (o *BackgroundResponse) SetDisposition(v DispositionTraits) {
o.Disposition.Set(&v)
}
// SetDispositionNil sets the value for Disposition to be an explicit nil
func (o *BackgroundResponse) SetDispositionNil() {
o.Disposition.Set(nil)
}
// UnsetDisposition ensures that no value is present for Disposition, not even an explicit nil
func (o *BackgroundResponse) UnsetDisposition() {
o.Disposition.Unset()
}
func (o BackgroundResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BackgroundResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["mission"] = o.Mission
if o.Background.IsSet() {
toSerialize["background"] = o.Background.Get()
}
if o.Disposition.IsSet() {
toSerialize["disposition"] = o.Disposition.Get()
}
return toSerialize, nil
}
func (o *BackgroundResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"mission",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varBackgroundResponse := _BackgroundResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varBackgroundResponse)
if err != nil {
return err
}
*o = BackgroundResponse(varBackgroundResponse)
return err
}
type NullableBackgroundResponse struct {
value *BackgroundResponse
isSet bool
}
func (v NullableBackgroundResponse) Get() *BackgroundResponse {
return v.value
}
func (v *NullableBackgroundResponse) Set(val *BackgroundResponse) {
v.value = val
v.isSet = true
}
func (v NullableBackgroundResponse) IsSet() bool {
return v.isSet
}
func (v *NullableBackgroundResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBackgroundResponse(val *BackgroundResponse) *NullableBackgroundResponse {
return &NullableBackgroundResponse{value: val, isSet: true}
}
func (v NullableBackgroundResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBackgroundResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,217 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the BankConfigResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BankConfigResponse{}
// BankConfigResponse Response model for bank configuration.
type BankConfigResponse struct {
// Bank identifier
BankId string `json:"bank_id"`
// Fully resolved configuration with all hierarchical overrides applied (Python field names)
Config map[string]interface{} `json:"config"`
// Bank-specific configuration overrides only (Python field names)
Overrides map[string]interface{} `json:"overrides"`
}
type _BankConfigResponse BankConfigResponse
// NewBankConfigResponse instantiates a new BankConfigResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBankConfigResponse(bankId string, config map[string]interface{}, overrides map[string]interface{}) *BankConfigResponse {
this := BankConfigResponse{}
this.BankId = bankId
this.Config = config
this.Overrides = overrides
return &this
}
// NewBankConfigResponseWithDefaults instantiates a new BankConfigResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBankConfigResponseWithDefaults() *BankConfigResponse {
this := BankConfigResponse{}
return &this
}
// GetBankId returns the BankId field value
func (o *BankConfigResponse) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *BankConfigResponse) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *BankConfigResponse) SetBankId(v string) {
o.BankId = v
}
// GetConfig returns the Config field value
func (o *BankConfigResponse) GetConfig() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Config
}
// GetConfigOk returns a tuple with the Config field value
// and a boolean to check if the value has been set.
func (o *BankConfigResponse) GetConfigOk() (map[string]interface{}, bool) {
if o == nil {
return map[string]interface{}{}, false
}
return o.Config, true
}
// SetConfig sets field value
func (o *BankConfigResponse) SetConfig(v map[string]interface{}) {
o.Config = v
}
// GetOverrides returns the Overrides field value
func (o *BankConfigResponse) GetOverrides() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Overrides
}
// GetOverridesOk returns a tuple with the Overrides field value
// and a boolean to check if the value has been set.
func (o *BankConfigResponse) GetOverridesOk() (map[string]interface{}, bool) {
if o == nil {
return map[string]interface{}{}, false
}
return o.Overrides, true
}
// SetOverrides sets field value
func (o *BankConfigResponse) SetOverrides(v map[string]interface{}) {
o.Overrides = v
}
func (o BankConfigResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BankConfigResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["bank_id"] = o.BankId
toSerialize["config"] = o.Config
toSerialize["overrides"] = o.Overrides
return toSerialize, nil
}
func (o *BankConfigResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"bank_id",
"config",
"overrides",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varBankConfigResponse := _BankConfigResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varBankConfigResponse)
if err != nil {
return err
}
*o = BankConfigResponse(varBankConfigResponse)
return err
}
type NullableBankConfigResponse struct {
value *BankConfigResponse
isSet bool
}
func (v NullableBankConfigResponse) Get() *BankConfigResponse {
return v.value
}
func (v *NullableBankConfigResponse) Set(val *BankConfigResponse) {
v.value = val
v.isSet = true
}
func (v NullableBankConfigResponse) IsSet() bool {
return v.isSet
}
func (v *NullableBankConfigResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBankConfigResponse(val *BankConfigResponse) *NullableBankConfigResponse {
return &NullableBankConfigResponse{value: val, isSet: true}
}
func (v NullableBankConfigResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBankConfigResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,159 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the BankConfigUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BankConfigUpdate{}
// BankConfigUpdate Request model for updating bank configuration.
type BankConfigUpdate struct {
// Configuration overrides. Keys can be in Python field format (llm_provider) or environment variable format (HINDSIGHT_API_LLM_PROVIDER). Only hierarchical fields can be overridden per-bank.
Updates map[string]interface{} `json:"updates"`
}
type _BankConfigUpdate BankConfigUpdate
// NewBankConfigUpdate instantiates a new BankConfigUpdate object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBankConfigUpdate(updates map[string]interface{}) *BankConfigUpdate {
this := BankConfigUpdate{}
this.Updates = updates
return &this
}
// NewBankConfigUpdateWithDefaults instantiates a new BankConfigUpdate object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBankConfigUpdateWithDefaults() *BankConfigUpdate {
this := BankConfigUpdate{}
return &this
}
// GetUpdates returns the Updates field value
func (o *BankConfigUpdate) GetUpdates() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Updates
}
// GetUpdatesOk returns a tuple with the Updates field value
// and a boolean to check if the value has been set.
func (o *BankConfigUpdate) GetUpdatesOk() (map[string]interface{}, bool) {
if o == nil {
return map[string]interface{}{}, false
}
return o.Updates, true
}
// SetUpdates sets field value
func (o *BankConfigUpdate) SetUpdates(v map[string]interface{}) {
o.Updates = v
}
func (o BankConfigUpdate) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BankConfigUpdate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["updates"] = o.Updates
return toSerialize, nil
}
func (o *BankConfigUpdate) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"updates",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varBankConfigUpdate := _BankConfigUpdate{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varBankConfigUpdate)
if err != nil {
return err
}
*o = BankConfigUpdate(varBankConfigUpdate)
return err
}
type NullableBankConfigUpdate struct {
value *BankConfigUpdate
isSet bool
}
func (v NullableBankConfigUpdate) Get() *BankConfigUpdate {
return v.value
}
func (v *NullableBankConfigUpdate) Set(val *BankConfigUpdate) {
v.value = val
v.isSet = true
}
func (v NullableBankConfigUpdate) IsSet() bool {
return v.isSet
}
func (v *NullableBankConfigUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBankConfigUpdate(val *BankConfigUpdate) *NullableBankConfigUpdate {
return &NullableBankConfigUpdate{value: val, isSet: true}
}
func (v NullableBankConfigUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBankConfigUpdate) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,370 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the BankListItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BankListItem{}
// BankListItem Bank list item with profile summary.
type BankListItem struct {
BankId string `json:"bank_id"`
Name NullableString `json:"name,omitempty"`
Disposition DispositionTraits `json:"disposition"`
Mission NullableString `json:"mission,omitempty"`
CreatedAt NullableString `json:"created_at,omitempty"`
UpdatedAt NullableString `json:"updated_at,omitempty"`
}
type _BankListItem BankListItem
// NewBankListItem instantiates a new BankListItem object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBankListItem(bankId string, disposition DispositionTraits) *BankListItem {
this := BankListItem{}
this.BankId = bankId
this.Disposition = disposition
return &this
}
// NewBankListItemWithDefaults instantiates a new BankListItem object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBankListItemWithDefaults() *BankListItem {
this := BankListItem{}
return &this
}
// GetBankId returns the BankId field value
func (o *BankListItem) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *BankListItem) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *BankListItem) SetBankId(v string) {
o.BankId = v
}
// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankListItem) GetName() string {
if o == nil || IsNil(o.Name.Get()) {
var ret string
return ret
}
return *o.Name.Get()
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankListItem) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Name.Get(), o.Name.IsSet()
}
// HasName returns a boolean if a field has been set.
func (o *BankListItem) HasName() bool {
if o != nil && o.Name.IsSet() {
return true
}
return false
}
// SetName gets a reference to the given NullableString and assigns it to the Name field.
func (o *BankListItem) SetName(v string) {
o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *BankListItem) SetNameNil() {
o.Name.Set(nil)
}
// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *BankListItem) UnsetName() {
o.Name.Unset()
}
// GetDisposition returns the Disposition field value
func (o *BankListItem) GetDisposition() DispositionTraits {
if o == nil {
var ret DispositionTraits
return ret
}
return o.Disposition
}
// GetDispositionOk returns a tuple with the Disposition field value
// and a boolean to check if the value has been set.
func (o *BankListItem) GetDispositionOk() (*DispositionTraits, bool) {
if o == nil {
return nil, false
}
return &o.Disposition, true
}
// SetDisposition sets field value
func (o *BankListItem) SetDisposition(v DispositionTraits) {
o.Disposition = v
}
// GetMission returns the Mission field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankListItem) GetMission() string {
if o == nil || IsNil(o.Mission.Get()) {
var ret string
return ret
}
return *o.Mission.Get()
}
// GetMissionOk returns a tuple with the Mission field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankListItem) GetMissionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Mission.Get(), o.Mission.IsSet()
}
// HasMission returns a boolean if a field has been set.
func (o *BankListItem) HasMission() bool {
if o != nil && o.Mission.IsSet() {
return true
}
return false
}
// SetMission gets a reference to the given NullableString and assigns it to the Mission field.
func (o *BankListItem) SetMission(v string) {
o.Mission.Set(&v)
}
// SetMissionNil sets the value for Mission to be an explicit nil
func (o *BankListItem) SetMissionNil() {
o.Mission.Set(nil)
}
// UnsetMission ensures that no value is present for Mission, not even an explicit nil
func (o *BankListItem) UnsetMission() {
o.Mission.Unset()
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankListItem) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt.Get()) {
var ret string
return ret
}
return *o.CreatedAt.Get()
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankListItem) GetCreatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CreatedAt.Get(), o.CreatedAt.IsSet()
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *BankListItem) HasCreatedAt() bool {
if o != nil && o.CreatedAt.IsSet() {
return true
}
return false
}
// SetCreatedAt gets a reference to the given NullableString and assigns it to the CreatedAt field.
func (o *BankListItem) SetCreatedAt(v string) {
o.CreatedAt.Set(&v)
}
// SetCreatedAtNil sets the value for CreatedAt to be an explicit nil
func (o *BankListItem) SetCreatedAtNil() {
o.CreatedAt.Set(nil)
}
// UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil
func (o *BankListItem) UnsetCreatedAt() {
o.CreatedAt.Unset()
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankListItem) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt.Get()) {
var ret string
return ret
}
return *o.UpdatedAt.Get()
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankListItem) GetUpdatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.UpdatedAt.Get(), o.UpdatedAt.IsSet()
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *BankListItem) HasUpdatedAt() bool {
if o != nil && o.UpdatedAt.IsSet() {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given NullableString and assigns it to the UpdatedAt field.
func (o *BankListItem) SetUpdatedAt(v string) {
o.UpdatedAt.Set(&v)
}
// SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil
func (o *BankListItem) SetUpdatedAtNil() {
o.UpdatedAt.Set(nil)
}
// UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil
func (o *BankListItem) UnsetUpdatedAt() {
o.UpdatedAt.Unset()
}
func (o BankListItem) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BankListItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["bank_id"] = o.BankId
if o.Name.IsSet() {
toSerialize["name"] = o.Name.Get()
}
toSerialize["disposition"] = o.Disposition
if o.Mission.IsSet() {
toSerialize["mission"] = o.Mission.Get()
}
if o.CreatedAt.IsSet() {
toSerialize["created_at"] = o.CreatedAt.Get()
}
if o.UpdatedAt.IsSet() {
toSerialize["updated_at"] = o.UpdatedAt.Get()
}
return toSerialize, nil
}
func (o *BankListItem) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"bank_id",
"disposition",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varBankListItem := _BankListItem{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varBankListItem)
if err != nil {
return err
}
*o = BankListItem(varBankListItem)
return err
}
type NullableBankListItem struct {
value *BankListItem
isSet bool
}
func (v NullableBankListItem) Get() *BankListItem {
return v.value
}
func (v *NullableBankListItem) Set(val *BankListItem) {
v.value = val
v.isSet = true
}
func (v NullableBankListItem) IsSet() bool {
return v.isSet
}
func (v *NullableBankListItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBankListItem(val *BankListItem) *NullableBankListItem {
return &NullableBankListItem{value: val, isSet: true}
}
func (v NullableBankListItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBankListItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,158 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the BankListResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BankListResponse{}
// BankListResponse Response model for listing all banks.
type BankListResponse struct {
Banks []BankListItem `json:"banks"`
}
type _BankListResponse BankListResponse
// NewBankListResponse instantiates a new BankListResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBankListResponse(banks []BankListItem) *BankListResponse {
this := BankListResponse{}
this.Banks = banks
return &this
}
// NewBankListResponseWithDefaults instantiates a new BankListResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBankListResponseWithDefaults() *BankListResponse {
this := BankListResponse{}
return &this
}
// GetBanks returns the Banks field value
func (o *BankListResponse) GetBanks() []BankListItem {
if o == nil {
var ret []BankListItem
return ret
}
return o.Banks
}
// GetBanksOk returns a tuple with the Banks field value
// and a boolean to check if the value has been set.
func (o *BankListResponse) GetBanksOk() ([]BankListItem, bool) {
if o == nil {
return nil, false
}
return o.Banks, true
}
// SetBanks sets field value
func (o *BankListResponse) SetBanks(v []BankListItem) {
o.Banks = v
}
func (o BankListResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BankListResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["banks"] = o.Banks
return toSerialize, nil
}
func (o *BankListResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"banks",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varBankListResponse := _BankListResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varBankListResponse)
if err != nil {
return err
}
*o = BankListResponse(varBankListResponse)
return err
}
type NullableBankListResponse struct {
value *BankListResponse
isSet bool
}
func (v NullableBankListResponse) Get() *BankListResponse {
return v.value
}
func (v *NullableBankListResponse) Set(val *BankListResponse) {
v.value = val
v.isSet = true
}
func (v NullableBankListResponse) IsSet() bool {
return v.isSet
}
func (v *NullableBankListResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBankListResponse(val *BankListResponse) *NullableBankListResponse {
return &NullableBankListResponse{value: val, isSet: true}
}
func (v NullableBankListResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBankListResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,289 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the BankProfileResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BankProfileResponse{}
// BankProfileResponse Response model for bank profile.
type BankProfileResponse struct {
BankId string `json:"bank_id"`
Name string `json:"name"`
Disposition DispositionTraits `json:"disposition"`
// The agent's mission - who they are and what they're trying to accomplish
Mission string `json:"mission"`
Background NullableString `json:"background,omitempty"`
}
type _BankProfileResponse BankProfileResponse
// NewBankProfileResponse instantiates a new BankProfileResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBankProfileResponse(bankId string, name string, disposition DispositionTraits, mission string) *BankProfileResponse {
this := BankProfileResponse{}
this.BankId = bankId
this.Name = name
this.Disposition = disposition
this.Mission = mission
return &this
}
// NewBankProfileResponseWithDefaults instantiates a new BankProfileResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBankProfileResponseWithDefaults() *BankProfileResponse {
this := BankProfileResponse{}
return &this
}
// GetBankId returns the BankId field value
func (o *BankProfileResponse) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *BankProfileResponse) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *BankProfileResponse) SetBankId(v string) {
o.BankId = v
}
// GetName returns the Name field value
func (o *BankProfileResponse) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *BankProfileResponse) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *BankProfileResponse) SetName(v string) {
o.Name = v
}
// GetDisposition returns the Disposition field value
func (o *BankProfileResponse) GetDisposition() DispositionTraits {
if o == nil {
var ret DispositionTraits
return ret
}
return o.Disposition
}
// GetDispositionOk returns a tuple with the Disposition field value
// and a boolean to check if the value has been set.
func (o *BankProfileResponse) GetDispositionOk() (*DispositionTraits, bool) {
if o == nil {
return nil, false
}
return &o.Disposition, true
}
// SetDisposition sets field value
func (o *BankProfileResponse) SetDisposition(v DispositionTraits) {
o.Disposition = v
}
// GetMission returns the Mission field value
func (o *BankProfileResponse) GetMission() string {
if o == nil {
var ret string
return ret
}
return o.Mission
}
// GetMissionOk returns a tuple with the Mission field value
// and a boolean to check if the value has been set.
func (o *BankProfileResponse) GetMissionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Mission, true
}
// SetMission sets field value
func (o *BankProfileResponse) SetMission(v string) {
o.Mission = v
}
// GetBackground returns the Background field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankProfileResponse) GetBackground() string {
if o == nil || IsNil(o.Background.Get()) {
var ret string
return ret
}
return *o.Background.Get()
}
// GetBackgroundOk returns a tuple with the Background field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankProfileResponse) GetBackgroundOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Background.Get(), o.Background.IsSet()
}
// HasBackground returns a boolean if a field has been set.
func (o *BankProfileResponse) HasBackground() bool {
if o != nil && o.Background.IsSet() {
return true
}
return false
}
// SetBackground gets a reference to the given NullableString and assigns it to the Background field.
func (o *BankProfileResponse) SetBackground(v string) {
o.Background.Set(&v)
}
// SetBackgroundNil sets the value for Background to be an explicit nil
func (o *BankProfileResponse) SetBackgroundNil() {
o.Background.Set(nil)
}
// UnsetBackground ensures that no value is present for Background, not even an explicit nil
func (o *BankProfileResponse) UnsetBackground() {
o.Background.Unset()
}
func (o BankProfileResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BankProfileResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["bank_id"] = o.BankId
toSerialize["name"] = o.Name
toSerialize["disposition"] = o.Disposition
toSerialize["mission"] = o.Mission
if o.Background.IsSet() {
toSerialize["background"] = o.Background.Get()
}
return toSerialize, nil
}
func (o *BankProfileResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"bank_id",
"name",
"disposition",
"mission",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varBankProfileResponse := _BankProfileResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varBankProfileResponse)
if err != nil {
return err
}
*o = BankProfileResponse(varBankProfileResponse)
return err
}
type NullableBankProfileResponse struct {
value *BankProfileResponse
isSet bool
}
func (v NullableBankProfileResponse) Get() *BankProfileResponse {
return v.value
}
func (v *NullableBankProfileResponse) Set(val *BankProfileResponse) {
v.value = val
v.isSet = true
}
func (v NullableBankProfileResponse) IsSet() bool {
return v.isSet
}
func (v *NullableBankProfileResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBankProfileResponse(val *BankProfileResponse) *NullableBankProfileResponse {
return &NullableBankProfileResponse{value: val, isSet: true}
}
func (v NullableBankProfileResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBankProfileResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,538 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the BankStatsResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BankStatsResponse{}
// BankStatsResponse Response model for bank statistics endpoint.
type BankStatsResponse struct {
BankId string `json:"bank_id"`
TotalNodes int32 `json:"total_nodes"`
TotalLinks int32 `json:"total_links"`
TotalDocuments int32 `json:"total_documents"`
NodesByFactType map[string]int32 `json:"nodes_by_fact_type"`
LinksByLinkType map[string]int32 `json:"links_by_link_type"`
LinksByFactType map[string]int32 `json:"links_by_fact_type"`
LinksBreakdown map[string]map[string]int32 `json:"links_breakdown"`
PendingOperations int32 `json:"pending_operations"`
FailedOperations int32 `json:"failed_operations"`
LastConsolidatedAt NullableString `json:"last_consolidated_at,omitempty"`
// Number of memories not yet processed into observations
PendingConsolidation *int32 `json:"pending_consolidation,omitempty"`
// Total number of observations
TotalObservations *int32 `json:"total_observations,omitempty"`
}
type _BankStatsResponse BankStatsResponse
// NewBankStatsResponse instantiates a new BankStatsResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBankStatsResponse(bankId string, totalNodes int32, totalLinks int32, totalDocuments int32, nodesByFactType map[string]int32, linksByLinkType map[string]int32, linksByFactType map[string]int32, linksBreakdown map[string]map[string]int32, pendingOperations int32, failedOperations int32) *BankStatsResponse {
this := BankStatsResponse{}
this.BankId = bankId
this.TotalNodes = totalNodes
this.TotalLinks = totalLinks
this.TotalDocuments = totalDocuments
this.NodesByFactType = nodesByFactType
this.LinksByLinkType = linksByLinkType
this.LinksByFactType = linksByFactType
this.LinksBreakdown = linksBreakdown
this.PendingOperations = pendingOperations
this.FailedOperations = failedOperations
var pendingConsolidation int32 = 0
this.PendingConsolidation = &pendingConsolidation
var totalObservations int32 = 0
this.TotalObservations = &totalObservations
return &this
}
// NewBankStatsResponseWithDefaults instantiates a new BankStatsResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBankStatsResponseWithDefaults() *BankStatsResponse {
this := BankStatsResponse{}
var pendingConsolidation int32 = 0
this.PendingConsolidation = &pendingConsolidation
var totalObservations int32 = 0
this.TotalObservations = &totalObservations
return &this
}
// GetBankId returns the BankId field value
func (o *BankStatsResponse) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *BankStatsResponse) SetBankId(v string) {
o.BankId = v
}
// GetTotalNodes returns the TotalNodes field value
func (o *BankStatsResponse) GetTotalNodes() int32 {
if o == nil {
var ret int32
return ret
}
return o.TotalNodes
}
// GetTotalNodesOk returns a tuple with the TotalNodes field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetTotalNodesOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.TotalNodes, true
}
// SetTotalNodes sets field value
func (o *BankStatsResponse) SetTotalNodes(v int32) {
o.TotalNodes = v
}
// GetTotalLinks returns the TotalLinks field value
func (o *BankStatsResponse) GetTotalLinks() int32 {
if o == nil {
var ret int32
return ret
}
return o.TotalLinks
}
// GetTotalLinksOk returns a tuple with the TotalLinks field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetTotalLinksOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.TotalLinks, true
}
// SetTotalLinks sets field value
func (o *BankStatsResponse) SetTotalLinks(v int32) {
o.TotalLinks = v
}
// GetTotalDocuments returns the TotalDocuments field value
func (o *BankStatsResponse) GetTotalDocuments() int32 {
if o == nil {
var ret int32
return ret
}
return o.TotalDocuments
}
// GetTotalDocumentsOk returns a tuple with the TotalDocuments field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetTotalDocumentsOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.TotalDocuments, true
}
// SetTotalDocuments sets field value
func (o *BankStatsResponse) SetTotalDocuments(v int32) {
o.TotalDocuments = v
}
// GetNodesByFactType returns the NodesByFactType field value
func (o *BankStatsResponse) GetNodesByFactType() map[string]int32 {
if o == nil {
var ret map[string]int32
return ret
}
return o.NodesByFactType
}
// GetNodesByFactTypeOk returns a tuple with the NodesByFactType field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetNodesByFactTypeOk() (map[string]int32, bool) {
if o == nil {
return map[string]int32{}, false
}
return o.NodesByFactType, true
}
// SetNodesByFactType sets field value
func (o *BankStatsResponse) SetNodesByFactType(v map[string]int32) {
o.NodesByFactType = v
}
// GetLinksByLinkType returns the LinksByLinkType field value
func (o *BankStatsResponse) GetLinksByLinkType() map[string]int32 {
if o == nil {
var ret map[string]int32
return ret
}
return o.LinksByLinkType
}
// GetLinksByLinkTypeOk returns a tuple with the LinksByLinkType field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetLinksByLinkTypeOk() (map[string]int32, bool) {
if o == nil {
return map[string]int32{}, false
}
return o.LinksByLinkType, true
}
// SetLinksByLinkType sets field value
func (o *BankStatsResponse) SetLinksByLinkType(v map[string]int32) {
o.LinksByLinkType = v
}
// GetLinksByFactType returns the LinksByFactType field value
func (o *BankStatsResponse) GetLinksByFactType() map[string]int32 {
if o == nil {
var ret map[string]int32
return ret
}
return o.LinksByFactType
}
// GetLinksByFactTypeOk returns a tuple with the LinksByFactType field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetLinksByFactTypeOk() (map[string]int32, bool) {
if o == nil {
return map[string]int32{}, false
}
return o.LinksByFactType, true
}
// SetLinksByFactType sets field value
func (o *BankStatsResponse) SetLinksByFactType(v map[string]int32) {
o.LinksByFactType = v
}
// GetLinksBreakdown returns the LinksBreakdown field value
func (o *BankStatsResponse) GetLinksBreakdown() map[string]map[string]int32 {
if o == nil {
var ret map[string]map[string]int32
return ret
}
return o.LinksBreakdown
}
// GetLinksBreakdownOk returns a tuple with the LinksBreakdown field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetLinksBreakdownOk() (map[string]map[string]int32, bool) {
if o == nil {
return map[string]map[string]int32{}, false
}
return o.LinksBreakdown, true
}
// SetLinksBreakdown sets field value
func (o *BankStatsResponse) SetLinksBreakdown(v map[string]map[string]int32) {
o.LinksBreakdown = v
}
// GetPendingOperations returns the PendingOperations field value
func (o *BankStatsResponse) GetPendingOperations() int32 {
if o == nil {
var ret int32
return ret
}
return o.PendingOperations
}
// GetPendingOperationsOk returns a tuple with the PendingOperations field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetPendingOperationsOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.PendingOperations, true
}
// SetPendingOperations sets field value
func (o *BankStatsResponse) SetPendingOperations(v int32) {
o.PendingOperations = v
}
// GetFailedOperations returns the FailedOperations field value
func (o *BankStatsResponse) GetFailedOperations() int32 {
if o == nil {
var ret int32
return ret
}
return o.FailedOperations
}
// GetFailedOperationsOk returns a tuple with the FailedOperations field value
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetFailedOperationsOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.FailedOperations, true
}
// SetFailedOperations sets field value
func (o *BankStatsResponse) SetFailedOperations(v int32) {
o.FailedOperations = v
}
// GetLastConsolidatedAt returns the LastConsolidatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BankStatsResponse) GetLastConsolidatedAt() string {
if o == nil || IsNil(o.LastConsolidatedAt.Get()) {
var ret string
return ret
}
return *o.LastConsolidatedAt.Get()
}
// GetLastConsolidatedAtOk returns a tuple with the LastConsolidatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BankStatsResponse) GetLastConsolidatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.LastConsolidatedAt.Get(), o.LastConsolidatedAt.IsSet()
}
// HasLastConsolidatedAt returns a boolean if a field has been set.
func (o *BankStatsResponse) HasLastConsolidatedAt() bool {
if o != nil && o.LastConsolidatedAt.IsSet() {
return true
}
return false
}
// SetLastConsolidatedAt gets a reference to the given NullableString and assigns it to the LastConsolidatedAt field.
func (o *BankStatsResponse) SetLastConsolidatedAt(v string) {
o.LastConsolidatedAt.Set(&v)
}
// SetLastConsolidatedAtNil sets the value for LastConsolidatedAt to be an explicit nil
func (o *BankStatsResponse) SetLastConsolidatedAtNil() {
o.LastConsolidatedAt.Set(nil)
}
// UnsetLastConsolidatedAt ensures that no value is present for LastConsolidatedAt, not even an explicit nil
func (o *BankStatsResponse) UnsetLastConsolidatedAt() {
o.LastConsolidatedAt.Unset()
}
// GetPendingConsolidation returns the PendingConsolidation field value if set, zero value otherwise.
func (o *BankStatsResponse) GetPendingConsolidation() int32 {
if o == nil || IsNil(o.PendingConsolidation) {
var ret int32
return ret
}
return *o.PendingConsolidation
}
// GetPendingConsolidationOk returns a tuple with the PendingConsolidation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetPendingConsolidationOk() (*int32, bool) {
if o == nil || IsNil(o.PendingConsolidation) {
return nil, false
}
return o.PendingConsolidation, true
}
// HasPendingConsolidation returns a boolean if a field has been set.
func (o *BankStatsResponse) HasPendingConsolidation() bool {
if o != nil && !IsNil(o.PendingConsolidation) {
return true
}
return false
}
// SetPendingConsolidation gets a reference to the given int32 and assigns it to the PendingConsolidation field.
func (o *BankStatsResponse) SetPendingConsolidation(v int32) {
o.PendingConsolidation = &v
}
// GetTotalObservations returns the TotalObservations field value if set, zero value otherwise.
func (o *BankStatsResponse) GetTotalObservations() int32 {
if o == nil || IsNil(o.TotalObservations) {
var ret int32
return ret
}
return *o.TotalObservations
}
// GetTotalObservationsOk returns a tuple with the TotalObservations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BankStatsResponse) GetTotalObservationsOk() (*int32, bool) {
if o == nil || IsNil(o.TotalObservations) {
return nil, false
}
return o.TotalObservations, true
}
// HasTotalObservations returns a boolean if a field has been set.
func (o *BankStatsResponse) HasTotalObservations() bool {
if o != nil && !IsNil(o.TotalObservations) {
return true
}
return false
}
// SetTotalObservations gets a reference to the given int32 and assigns it to the TotalObservations field.
func (o *BankStatsResponse) SetTotalObservations(v int32) {
o.TotalObservations = &v
}
func (o BankStatsResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BankStatsResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["bank_id"] = o.BankId
toSerialize["total_nodes"] = o.TotalNodes
toSerialize["total_links"] = o.TotalLinks
toSerialize["total_documents"] = o.TotalDocuments
toSerialize["nodes_by_fact_type"] = o.NodesByFactType
toSerialize["links_by_link_type"] = o.LinksByLinkType
toSerialize["links_by_fact_type"] = o.LinksByFactType
toSerialize["links_breakdown"] = o.LinksBreakdown
toSerialize["pending_operations"] = o.PendingOperations
toSerialize["failed_operations"] = o.FailedOperations
if o.LastConsolidatedAt.IsSet() {
toSerialize["last_consolidated_at"] = o.LastConsolidatedAt.Get()
}
if !IsNil(o.PendingConsolidation) {
toSerialize["pending_consolidation"] = o.PendingConsolidation
}
if !IsNil(o.TotalObservations) {
toSerialize["total_observations"] = o.TotalObservations
}
return toSerialize, nil
}
func (o *BankStatsResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"bank_id",
"total_nodes",
"total_links",
"total_documents",
"nodes_by_fact_type",
"links_by_link_type",
"links_by_fact_type",
"links_breakdown",
"pending_operations",
"failed_operations",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varBankStatsResponse := _BankStatsResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varBankStatsResponse)
if err != nil {
return err
}
*o = BankStatsResponse(varBankStatsResponse)
return err
}
type NullableBankStatsResponse struct {
value *BankStatsResponse
isSet bool
}
func (v NullableBankStatsResponse) Get() *BankStatsResponse {
return v.value
}
func (v *NullableBankStatsResponse) Set(val *BankStatsResponse) {
v.value = val
v.isSet = true
}
func (v NullableBankStatsResponse) IsSet() bool {
return v.isSet
}
func (v *NullableBankStatsResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBankStatsResponse(val *BankStatsResponse) *NullableBankStatsResponse {
return &NullableBankStatsResponse{value: val, isSet: true}
}
func (v NullableBankStatsResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBankStatsResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,113 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"fmt"
)
// Budget Budget levels for recall/reflect operations.
type Budget string
// List of Budget
const (
LOW Budget = "low"
MID Budget = "mid"
HIGH Budget = "high"
)
// All allowed values of Budget enum
var AllowedBudgetEnumValues = []Budget{
"low",
"mid",
"high",
}
func (v *Budget) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := Budget(value)
for _, existing := range AllowedBudgetEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid Budget", value)
}
// NewBudgetFromValue returns a pointer to a valid Budget
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewBudgetFromValue(v string) (*Budget, error) {
ev := Budget(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for Budget: valid values are %v", v, AllowedBudgetEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v Budget) IsValid() bool {
for _, existing := range AllowedBudgetEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to Budget value
func (v Budget) Ptr() *Budget {
return &v
}
type NullableBudget struct {
value *Budget
isSet bool
}
func (v NullableBudget) Get() *Budget {
return v.value
}
func (v *NullableBudget) Set(val *Budget) {
v.value = val
v.isSet = true
}
func (v NullableBudget) IsSet() bool {
return v.isSet
}
func (v *NullableBudget) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBudget(val *Budget) *NullableBudget {
return &NullableBudget{value: val, isSet: true}
}
func (v NullableBudget) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBudget) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,214 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the CancelOperationResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CancelOperationResponse{}
// CancelOperationResponse Response model for cancel operation endpoint.
type CancelOperationResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
OperationId string `json:"operation_id"`
}
type _CancelOperationResponse CancelOperationResponse
// NewCancelOperationResponse instantiates a new CancelOperationResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCancelOperationResponse(success bool, message string, operationId string) *CancelOperationResponse {
this := CancelOperationResponse{}
this.Success = success
this.Message = message
this.OperationId = operationId
return &this
}
// NewCancelOperationResponseWithDefaults instantiates a new CancelOperationResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCancelOperationResponseWithDefaults() *CancelOperationResponse {
this := CancelOperationResponse{}
return &this
}
// GetSuccess returns the Success field value
func (o *CancelOperationResponse) GetSuccess() bool {
if o == nil {
var ret bool
return ret
}
return o.Success
}
// GetSuccessOk returns a tuple with the Success field value
// and a boolean to check if the value has been set.
func (o *CancelOperationResponse) GetSuccessOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Success, true
}
// SetSuccess sets field value
func (o *CancelOperationResponse) SetSuccess(v bool) {
o.Success = v
}
// GetMessage returns the Message field value
func (o *CancelOperationResponse) GetMessage() string {
if o == nil {
var ret string
return ret
}
return o.Message
}
// GetMessageOk returns a tuple with the Message field value
// and a boolean to check if the value has been set.
func (o *CancelOperationResponse) GetMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Message, true
}
// SetMessage sets field value
func (o *CancelOperationResponse) SetMessage(v string) {
o.Message = v
}
// GetOperationId returns the OperationId field value
func (o *CancelOperationResponse) GetOperationId() string {
if o == nil {
var ret string
return ret
}
return o.OperationId
}
// GetOperationIdOk returns a tuple with the OperationId field value
// and a boolean to check if the value has been set.
func (o *CancelOperationResponse) GetOperationIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OperationId, true
}
// SetOperationId sets field value
func (o *CancelOperationResponse) SetOperationId(v string) {
o.OperationId = v
}
func (o CancelOperationResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CancelOperationResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["success"] = o.Success
toSerialize["message"] = o.Message
toSerialize["operation_id"] = o.OperationId
return toSerialize, nil
}
func (o *CancelOperationResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"success",
"message",
"operation_id",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCancelOperationResponse := _CancelOperationResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varCancelOperationResponse)
if err != nil {
return err
}
*o = CancelOperationResponse(varCancelOperationResponse)
return err
}
type NullableCancelOperationResponse struct {
value *CancelOperationResponse
isSet bool
}
func (v NullableCancelOperationResponse) Get() *CancelOperationResponse {
return v.value
}
func (v *NullableCancelOperationResponse) Set(val *CancelOperationResponse) {
v.value = val
v.isSet = true
}
func (v NullableCancelOperationResponse) IsSet() bool {
return v.isSet
}
func (v *NullableCancelOperationResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCancelOperationResponse(val *CancelOperationResponse) *NullableCancelOperationResponse {
return &NullableCancelOperationResponse{value: val, isSet: true}
}
func (v NullableCancelOperationResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCancelOperationResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,324 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ChildOperationStatus type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ChildOperationStatus{}
// ChildOperationStatus Status of a child operation (for batch operations).
type ChildOperationStatus struct {
OperationId string `json:"operation_id"`
Status string `json:"status"`
SubBatchIndex NullableInt32 `json:"sub_batch_index,omitempty"`
ItemsCount NullableInt32 `json:"items_count,omitempty"`
ErrorMessage NullableString `json:"error_message,omitempty"`
}
type _ChildOperationStatus ChildOperationStatus
// NewChildOperationStatus instantiates a new ChildOperationStatus object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewChildOperationStatus(operationId string, status string) *ChildOperationStatus {
this := ChildOperationStatus{}
this.OperationId = operationId
this.Status = status
return &this
}
// NewChildOperationStatusWithDefaults instantiates a new ChildOperationStatus object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewChildOperationStatusWithDefaults() *ChildOperationStatus {
this := ChildOperationStatus{}
return &this
}
// GetOperationId returns the OperationId field value
func (o *ChildOperationStatus) GetOperationId() string {
if o == nil {
var ret string
return ret
}
return o.OperationId
}
// GetOperationIdOk returns a tuple with the OperationId field value
// and a boolean to check if the value has been set.
func (o *ChildOperationStatus) GetOperationIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OperationId, true
}
// SetOperationId sets field value
func (o *ChildOperationStatus) SetOperationId(v string) {
o.OperationId = v
}
// GetStatus returns the Status field value
func (o *ChildOperationStatus) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *ChildOperationStatus) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *ChildOperationStatus) SetStatus(v string) {
o.Status = v
}
// GetSubBatchIndex returns the SubBatchIndex field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ChildOperationStatus) GetSubBatchIndex() int32 {
if o == nil || IsNil(o.SubBatchIndex.Get()) {
var ret int32
return ret
}
return *o.SubBatchIndex.Get()
}
// GetSubBatchIndexOk returns a tuple with the SubBatchIndex field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ChildOperationStatus) GetSubBatchIndexOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.SubBatchIndex.Get(), o.SubBatchIndex.IsSet()
}
// HasSubBatchIndex returns a boolean if a field has been set.
func (o *ChildOperationStatus) HasSubBatchIndex() bool {
if o != nil && o.SubBatchIndex.IsSet() {
return true
}
return false
}
// SetSubBatchIndex gets a reference to the given NullableInt32 and assigns it to the SubBatchIndex field.
func (o *ChildOperationStatus) SetSubBatchIndex(v int32) {
o.SubBatchIndex.Set(&v)
}
// SetSubBatchIndexNil sets the value for SubBatchIndex to be an explicit nil
func (o *ChildOperationStatus) SetSubBatchIndexNil() {
o.SubBatchIndex.Set(nil)
}
// UnsetSubBatchIndex ensures that no value is present for SubBatchIndex, not even an explicit nil
func (o *ChildOperationStatus) UnsetSubBatchIndex() {
o.SubBatchIndex.Unset()
}
// GetItemsCount returns the ItemsCount field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ChildOperationStatus) GetItemsCount() int32 {
if o == nil || IsNil(o.ItemsCount.Get()) {
var ret int32
return ret
}
return *o.ItemsCount.Get()
}
// GetItemsCountOk returns a tuple with the ItemsCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ChildOperationStatus) GetItemsCountOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.ItemsCount.Get(), o.ItemsCount.IsSet()
}
// HasItemsCount returns a boolean if a field has been set.
func (o *ChildOperationStatus) HasItemsCount() bool {
if o != nil && o.ItemsCount.IsSet() {
return true
}
return false
}
// SetItemsCount gets a reference to the given NullableInt32 and assigns it to the ItemsCount field.
func (o *ChildOperationStatus) SetItemsCount(v int32) {
o.ItemsCount.Set(&v)
}
// SetItemsCountNil sets the value for ItemsCount to be an explicit nil
func (o *ChildOperationStatus) SetItemsCountNil() {
o.ItemsCount.Set(nil)
}
// UnsetItemsCount ensures that no value is present for ItemsCount, not even an explicit nil
func (o *ChildOperationStatus) UnsetItemsCount() {
o.ItemsCount.Unset()
}
// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ChildOperationStatus) GetErrorMessage() string {
if o == nil || IsNil(o.ErrorMessage.Get()) {
var ret string
return ret
}
return *o.ErrorMessage.Get()
}
// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ChildOperationStatus) GetErrorMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ErrorMessage.Get(), o.ErrorMessage.IsSet()
}
// HasErrorMessage returns a boolean if a field has been set.
func (o *ChildOperationStatus) HasErrorMessage() bool {
if o != nil && o.ErrorMessage.IsSet() {
return true
}
return false
}
// SetErrorMessage gets a reference to the given NullableString and assigns it to the ErrorMessage field.
func (o *ChildOperationStatus) SetErrorMessage(v string) {
o.ErrorMessage.Set(&v)
}
// SetErrorMessageNil sets the value for ErrorMessage to be an explicit nil
func (o *ChildOperationStatus) SetErrorMessageNil() {
o.ErrorMessage.Set(nil)
}
// UnsetErrorMessage ensures that no value is present for ErrorMessage, not even an explicit nil
func (o *ChildOperationStatus) UnsetErrorMessage() {
o.ErrorMessage.Unset()
}
func (o ChildOperationStatus) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ChildOperationStatus) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["operation_id"] = o.OperationId
toSerialize["status"] = o.Status
if o.SubBatchIndex.IsSet() {
toSerialize["sub_batch_index"] = o.SubBatchIndex.Get()
}
if o.ItemsCount.IsSet() {
toSerialize["items_count"] = o.ItemsCount.Get()
}
if o.ErrorMessage.IsSet() {
toSerialize["error_message"] = o.ErrorMessage.Get()
}
return toSerialize, nil
}
func (o *ChildOperationStatus) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"operation_id",
"status",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varChildOperationStatus := _ChildOperationStatus{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varChildOperationStatus)
if err != nil {
return err
}
*o = ChildOperationStatus(varChildOperationStatus)
return err
}
type NullableChildOperationStatus struct {
value *ChildOperationStatus
isSet bool
}
func (v NullableChildOperationStatus) Get() *ChildOperationStatus {
return v.value
}
func (v *NullableChildOperationStatus) Set(val *ChildOperationStatus) {
v.value = val
v.isSet = true
}
func (v NullableChildOperationStatus) IsSet() bool {
return v.isSet
}
func (v *NullableChildOperationStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableChildOperationStatus(val *ChildOperationStatus) *NullableChildOperationStatus {
return &NullableChildOperationStatus{value: val, isSet: true}
}
func (v NullableChildOperationStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableChildOperationStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,255 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ChunkData type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ChunkData{}
// ChunkData Chunk data for a single chunk.
type ChunkData struct {
Id string `json:"id"`
Text string `json:"text"`
ChunkIndex int32 `json:"chunk_index"`
// Whether the chunk text was truncated due to token limits
Truncated *bool `json:"truncated,omitempty"`
}
type _ChunkData ChunkData
// NewChunkData instantiates a new ChunkData object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewChunkData(id string, text string, chunkIndex int32) *ChunkData {
this := ChunkData{}
this.Id = id
this.Text = text
this.ChunkIndex = chunkIndex
var truncated bool = false
this.Truncated = &truncated
return &this
}
// NewChunkDataWithDefaults instantiates a new ChunkData object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewChunkDataWithDefaults() *ChunkData {
this := ChunkData{}
var truncated bool = false
this.Truncated = &truncated
return &this
}
// GetId returns the Id field value
func (o *ChunkData) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *ChunkData) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *ChunkData) SetId(v string) {
o.Id = v
}
// GetText returns the Text field value
func (o *ChunkData) GetText() string {
if o == nil {
var ret string
return ret
}
return o.Text
}
// GetTextOk returns a tuple with the Text field value
// and a boolean to check if the value has been set.
func (o *ChunkData) GetTextOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Text, true
}
// SetText sets field value
func (o *ChunkData) SetText(v string) {
o.Text = v
}
// GetChunkIndex returns the ChunkIndex field value
func (o *ChunkData) GetChunkIndex() int32 {
if o == nil {
var ret int32
return ret
}
return o.ChunkIndex
}
// GetChunkIndexOk returns a tuple with the ChunkIndex field value
// and a boolean to check if the value has been set.
func (o *ChunkData) GetChunkIndexOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.ChunkIndex, true
}
// SetChunkIndex sets field value
func (o *ChunkData) SetChunkIndex(v int32) {
o.ChunkIndex = v
}
// GetTruncated returns the Truncated field value if set, zero value otherwise.
func (o *ChunkData) GetTruncated() bool {
if o == nil || IsNil(o.Truncated) {
var ret bool
return ret
}
return *o.Truncated
}
// GetTruncatedOk returns a tuple with the Truncated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ChunkData) GetTruncatedOk() (*bool, bool) {
if o == nil || IsNil(o.Truncated) {
return nil, false
}
return o.Truncated, true
}
// HasTruncated returns a boolean if a field has been set.
func (o *ChunkData) HasTruncated() bool {
if o != nil && !IsNil(o.Truncated) {
return true
}
return false
}
// SetTruncated gets a reference to the given bool and assigns it to the Truncated field.
func (o *ChunkData) SetTruncated(v bool) {
o.Truncated = &v
}
func (o ChunkData) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ChunkData) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["text"] = o.Text
toSerialize["chunk_index"] = o.ChunkIndex
if !IsNil(o.Truncated) {
toSerialize["truncated"] = o.Truncated
}
return toSerialize, nil
}
func (o *ChunkData) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"text",
"chunk_index",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varChunkData := _ChunkData{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varChunkData)
if err != nil {
return err
}
*o = ChunkData(varChunkData)
return err
}
type NullableChunkData struct {
value *ChunkData
isSet bool
}
func (v NullableChunkData) Get() *ChunkData {
return v.value
}
func (v *NullableChunkData) Set(val *ChunkData) {
v.value = val
v.isSet = true
}
func (v NullableChunkData) IsSet() bool {
return v.isSet
}
func (v *NullableChunkData) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableChunkData(val *ChunkData) *NullableChunkData {
return &NullableChunkData{value: val, isSet: true}
}
func (v NullableChunkData) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableChunkData) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,131 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the ChunkIncludeOptions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ChunkIncludeOptions{}
// ChunkIncludeOptions Options for including chunks in recall results.
type ChunkIncludeOptions struct {
// Maximum tokens for chunks (chunks may be truncated)
MaxTokens *int32 `json:"max_tokens,omitempty"`
}
// NewChunkIncludeOptions instantiates a new ChunkIncludeOptions object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewChunkIncludeOptions() *ChunkIncludeOptions {
this := ChunkIncludeOptions{}
var maxTokens int32 = 8192
this.MaxTokens = &maxTokens
return &this
}
// NewChunkIncludeOptionsWithDefaults instantiates a new ChunkIncludeOptions object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewChunkIncludeOptionsWithDefaults() *ChunkIncludeOptions {
this := ChunkIncludeOptions{}
var maxTokens int32 = 8192
this.MaxTokens = &maxTokens
return &this
}
// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise.
func (o *ChunkIncludeOptions) GetMaxTokens() int32 {
if o == nil || IsNil(o.MaxTokens) {
var ret int32
return ret
}
return *o.MaxTokens
}
// GetMaxTokensOk returns a tuple with the MaxTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ChunkIncludeOptions) GetMaxTokensOk() (*int32, bool) {
if o == nil || IsNil(o.MaxTokens) {
return nil, false
}
return o.MaxTokens, true
}
// HasMaxTokens returns a boolean if a field has been set.
func (o *ChunkIncludeOptions) HasMaxTokens() bool {
if o != nil && !IsNil(o.MaxTokens) {
return true
}
return false
}
// SetMaxTokens gets a reference to the given int32 and assigns it to the MaxTokens field.
func (o *ChunkIncludeOptions) SetMaxTokens(v int32) {
o.MaxTokens = &v
}
func (o ChunkIncludeOptions) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ChunkIncludeOptions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.MaxTokens) {
toSerialize["max_tokens"] = o.MaxTokens
}
return toSerialize, nil
}
type NullableChunkIncludeOptions struct {
value *ChunkIncludeOptions
isSet bool
}
func (v NullableChunkIncludeOptions) Get() *ChunkIncludeOptions {
return v.value
}
func (v *NullableChunkIncludeOptions) Set(val *ChunkIncludeOptions) {
v.value = val
v.isSet = true
}
func (v NullableChunkIncludeOptions) IsSet() bool {
return v.isSet
}
func (v *NullableChunkIncludeOptions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableChunkIncludeOptions(val *ChunkIncludeOptions) *NullableChunkIncludeOptions {
return &NullableChunkIncludeOptions{value: val, isSet: true}
}
func (v NullableChunkIncludeOptions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableChunkIncludeOptions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,298 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ChunkResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ChunkResponse{}
// ChunkResponse Response model for get chunk endpoint.
type ChunkResponse struct {
ChunkId string `json:"chunk_id"`
DocumentId string `json:"document_id"`
BankId string `json:"bank_id"`
ChunkIndex int32 `json:"chunk_index"`
ChunkText string `json:"chunk_text"`
CreatedAt string `json:"created_at"`
}
type _ChunkResponse ChunkResponse
// NewChunkResponse instantiates a new ChunkResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewChunkResponse(chunkId string, documentId string, bankId string, chunkIndex int32, chunkText string, createdAt string) *ChunkResponse {
this := ChunkResponse{}
this.ChunkId = chunkId
this.DocumentId = documentId
this.BankId = bankId
this.ChunkIndex = chunkIndex
this.ChunkText = chunkText
this.CreatedAt = createdAt
return &this
}
// NewChunkResponseWithDefaults instantiates a new ChunkResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewChunkResponseWithDefaults() *ChunkResponse {
this := ChunkResponse{}
return &this
}
// GetChunkId returns the ChunkId field value
func (o *ChunkResponse) GetChunkId() string {
if o == nil {
var ret string
return ret
}
return o.ChunkId
}
// GetChunkIdOk returns a tuple with the ChunkId field value
// and a boolean to check if the value has been set.
func (o *ChunkResponse) GetChunkIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ChunkId, true
}
// SetChunkId sets field value
func (o *ChunkResponse) SetChunkId(v string) {
o.ChunkId = v
}
// GetDocumentId returns the DocumentId field value
func (o *ChunkResponse) GetDocumentId() string {
if o == nil {
var ret string
return ret
}
return o.DocumentId
}
// GetDocumentIdOk returns a tuple with the DocumentId field value
// and a boolean to check if the value has been set.
func (o *ChunkResponse) GetDocumentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DocumentId, true
}
// SetDocumentId sets field value
func (o *ChunkResponse) SetDocumentId(v string) {
o.DocumentId = v
}
// GetBankId returns the BankId field value
func (o *ChunkResponse) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *ChunkResponse) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *ChunkResponse) SetBankId(v string) {
o.BankId = v
}
// GetChunkIndex returns the ChunkIndex field value
func (o *ChunkResponse) GetChunkIndex() int32 {
if o == nil {
var ret int32
return ret
}
return o.ChunkIndex
}
// GetChunkIndexOk returns a tuple with the ChunkIndex field value
// and a boolean to check if the value has been set.
func (o *ChunkResponse) GetChunkIndexOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.ChunkIndex, true
}
// SetChunkIndex sets field value
func (o *ChunkResponse) SetChunkIndex(v int32) {
o.ChunkIndex = v
}
// GetChunkText returns the ChunkText field value
func (o *ChunkResponse) GetChunkText() string {
if o == nil {
var ret string
return ret
}
return o.ChunkText
}
// GetChunkTextOk returns a tuple with the ChunkText field value
// and a boolean to check if the value has been set.
func (o *ChunkResponse) GetChunkTextOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ChunkText, true
}
// SetChunkText sets field value
func (o *ChunkResponse) SetChunkText(v string) {
o.ChunkText = v
}
// GetCreatedAt returns the CreatedAt field value
func (o *ChunkResponse) GetCreatedAt() string {
if o == nil {
var ret string
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *ChunkResponse) GetCreatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *ChunkResponse) SetCreatedAt(v string) {
o.CreatedAt = v
}
func (o ChunkResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ChunkResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["chunk_id"] = o.ChunkId
toSerialize["document_id"] = o.DocumentId
toSerialize["bank_id"] = o.BankId
toSerialize["chunk_index"] = o.ChunkIndex
toSerialize["chunk_text"] = o.ChunkText
toSerialize["created_at"] = o.CreatedAt
return toSerialize, nil
}
func (o *ChunkResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"chunk_id",
"document_id",
"bank_id",
"chunk_index",
"chunk_text",
"created_at",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varChunkResponse := _ChunkResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varChunkResponse)
if err != nil {
return err
}
*o = ChunkResponse(varChunkResponse)
return err
}
type NullableChunkResponse struct {
value *ChunkResponse
isSet bool
}
func (v NullableChunkResponse) Get() *ChunkResponse {
return v.value
}
func (v *NullableChunkResponse) Set(val *ChunkResponse) {
v.value = val
v.isSet = true
}
func (v NullableChunkResponse) IsSet() bool {
return v.isSet
}
func (v *NullableChunkResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableChunkResponse(val *ChunkResponse) *NullableChunkResponse {
return &NullableChunkResponse{value: val, isSet: true}
}
func (v NullableChunkResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableChunkResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,200 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ConsolidationResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ConsolidationResponse{}
// ConsolidationResponse Response model for consolidation trigger endpoint.
type ConsolidationResponse struct {
// ID of the async consolidation operation
OperationId string `json:"operation_id"`
// True if an existing pending task was reused
Deduplicated *bool `json:"deduplicated,omitempty"`
}
type _ConsolidationResponse ConsolidationResponse
// NewConsolidationResponse instantiates a new ConsolidationResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewConsolidationResponse(operationId string) *ConsolidationResponse {
this := ConsolidationResponse{}
this.OperationId = operationId
var deduplicated bool = false
this.Deduplicated = &deduplicated
return &this
}
// NewConsolidationResponseWithDefaults instantiates a new ConsolidationResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewConsolidationResponseWithDefaults() *ConsolidationResponse {
this := ConsolidationResponse{}
var deduplicated bool = false
this.Deduplicated = &deduplicated
return &this
}
// GetOperationId returns the OperationId field value
func (o *ConsolidationResponse) GetOperationId() string {
if o == nil {
var ret string
return ret
}
return o.OperationId
}
// GetOperationIdOk returns a tuple with the OperationId field value
// and a boolean to check if the value has been set.
func (o *ConsolidationResponse) GetOperationIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OperationId, true
}
// SetOperationId sets field value
func (o *ConsolidationResponse) SetOperationId(v string) {
o.OperationId = v
}
// GetDeduplicated returns the Deduplicated field value if set, zero value otherwise.
func (o *ConsolidationResponse) GetDeduplicated() bool {
if o == nil || IsNil(o.Deduplicated) {
var ret bool
return ret
}
return *o.Deduplicated
}
// GetDeduplicatedOk returns a tuple with the Deduplicated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConsolidationResponse) GetDeduplicatedOk() (*bool, bool) {
if o == nil || IsNil(o.Deduplicated) {
return nil, false
}
return o.Deduplicated, true
}
// HasDeduplicated returns a boolean if a field has been set.
func (o *ConsolidationResponse) HasDeduplicated() bool {
if o != nil && !IsNil(o.Deduplicated) {
return true
}
return false
}
// SetDeduplicated gets a reference to the given bool and assigns it to the Deduplicated field.
func (o *ConsolidationResponse) SetDeduplicated(v bool) {
o.Deduplicated = &v
}
func (o ConsolidationResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ConsolidationResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["operation_id"] = o.OperationId
if !IsNil(o.Deduplicated) {
toSerialize["deduplicated"] = o.Deduplicated
}
return toSerialize, nil
}
func (o *ConsolidationResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"operation_id",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varConsolidationResponse := _ConsolidationResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varConsolidationResponse)
if err != nil {
return err
}
*o = ConsolidationResponse(varConsolidationResponse)
return err
}
type NullableConsolidationResponse struct {
value *ConsolidationResponse
isSet bool
}
func (v NullableConsolidationResponse) Get() *ConsolidationResponse {
return v.value
}
func (v *NullableConsolidationResponse) Set(val *ConsolidationResponse) {
v.value = val
v.isSet = true
}
func (v NullableConsolidationResponse) IsSet() bool {
return v.isSet
}
func (v *NullableConsolidationResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableConsolidationResponse(val *ConsolidationResponse) *NullableConsolidationResponse {
return &NullableConsolidationResponse{value: val, isSet: true}
}
func (v NullableConsolidationResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableConsolidationResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,274 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the CreateBankRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateBankRequest{}
// CreateBankRequest Request model for creating/updating a bank.
type CreateBankRequest struct {
Name NullableString `json:"name,omitempty"`
Disposition NullableDispositionTraits `json:"disposition,omitempty"`
Mission NullableString `json:"mission,omitempty"`
Background NullableString `json:"background,omitempty"`
}
// NewCreateBankRequest instantiates a new CreateBankRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateBankRequest() *CreateBankRequest {
this := CreateBankRequest{}
return &this
}
// NewCreateBankRequestWithDefaults instantiates a new CreateBankRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateBankRequestWithDefaults() *CreateBankRequest {
this := CreateBankRequest{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateBankRequest) GetName() string {
if o == nil || IsNil(o.Name.Get()) {
var ret string
return ret
}
return *o.Name.Get()
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateBankRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Name.Get(), o.Name.IsSet()
}
// HasName returns a boolean if a field has been set.
func (o *CreateBankRequest) HasName() bool {
if o != nil && o.Name.IsSet() {
return true
}
return false
}
// SetName gets a reference to the given NullableString and assigns it to the Name field.
func (o *CreateBankRequest) SetName(v string) {
o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *CreateBankRequest) SetNameNil() {
o.Name.Set(nil)
}
// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *CreateBankRequest) UnsetName() {
o.Name.Unset()
}
// GetDisposition returns the Disposition field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateBankRequest) GetDisposition() DispositionTraits {
if o == nil || IsNil(o.Disposition.Get()) {
var ret DispositionTraits
return ret
}
return *o.Disposition.Get()
}
// GetDispositionOk returns a tuple with the Disposition field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateBankRequest) GetDispositionOk() (*DispositionTraits, bool) {
if o == nil {
return nil, false
}
return o.Disposition.Get(), o.Disposition.IsSet()
}
// HasDisposition returns a boolean if a field has been set.
func (o *CreateBankRequest) HasDisposition() bool {
if o != nil && o.Disposition.IsSet() {
return true
}
return false
}
// SetDisposition gets a reference to the given NullableDispositionTraits and assigns it to the Disposition field.
func (o *CreateBankRequest) SetDisposition(v DispositionTraits) {
o.Disposition.Set(&v)
}
// SetDispositionNil sets the value for Disposition to be an explicit nil
func (o *CreateBankRequest) SetDispositionNil() {
o.Disposition.Set(nil)
}
// UnsetDisposition ensures that no value is present for Disposition, not even an explicit nil
func (o *CreateBankRequest) UnsetDisposition() {
o.Disposition.Unset()
}
// GetMission returns the Mission field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateBankRequest) GetMission() string {
if o == nil || IsNil(o.Mission.Get()) {
var ret string
return ret
}
return *o.Mission.Get()
}
// GetMissionOk returns a tuple with the Mission field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateBankRequest) GetMissionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Mission.Get(), o.Mission.IsSet()
}
// HasMission returns a boolean if a field has been set.
func (o *CreateBankRequest) HasMission() bool {
if o != nil && o.Mission.IsSet() {
return true
}
return false
}
// SetMission gets a reference to the given NullableString and assigns it to the Mission field.
func (o *CreateBankRequest) SetMission(v string) {
o.Mission.Set(&v)
}
// SetMissionNil sets the value for Mission to be an explicit nil
func (o *CreateBankRequest) SetMissionNil() {
o.Mission.Set(nil)
}
// UnsetMission ensures that no value is present for Mission, not even an explicit nil
func (o *CreateBankRequest) UnsetMission() {
o.Mission.Unset()
}
// GetBackground returns the Background field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateBankRequest) GetBackground() string {
if o == nil || IsNil(o.Background.Get()) {
var ret string
return ret
}
return *o.Background.Get()
}
// GetBackgroundOk returns a tuple with the Background field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateBankRequest) GetBackgroundOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Background.Get(), o.Background.IsSet()
}
// HasBackground returns a boolean if a field has been set.
func (o *CreateBankRequest) HasBackground() bool {
if o != nil && o.Background.IsSet() {
return true
}
return false
}
// SetBackground gets a reference to the given NullableString and assigns it to the Background field.
func (o *CreateBankRequest) SetBackground(v string) {
o.Background.Set(&v)
}
// SetBackgroundNil sets the value for Background to be an explicit nil
func (o *CreateBankRequest) SetBackgroundNil() {
o.Background.Set(nil)
}
// UnsetBackground ensures that no value is present for Background, not even an explicit nil
func (o *CreateBankRequest) UnsetBackground() {
o.Background.Unset()
}
func (o CreateBankRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateBankRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Name.IsSet() {
toSerialize["name"] = o.Name.Get()
}
if o.Disposition.IsSet() {
toSerialize["disposition"] = o.Disposition.Get()
}
if o.Mission.IsSet() {
toSerialize["mission"] = o.Mission.Get()
}
if o.Background.IsSet() {
toSerialize["background"] = o.Background.Get()
}
return toSerialize, nil
}
type NullableCreateBankRequest struct {
value *CreateBankRequest
isSet bool
}
func (v NullableCreateBankRequest) Get() *CreateBankRequest {
return v.value
}
func (v *NullableCreateBankRequest) Set(val *CreateBankRequest) {
v.value = val
v.isSet = true
}
func (v NullableCreateBankRequest) IsSet() bool {
return v.isSet
}
func (v *NullableCreateBankRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateBankRequest(val *CreateBankRequest) *NullableCreateBankRequest {
return &NullableCreateBankRequest{value: val, isSet: true}
}
func (v NullableCreateBankRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateBankRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,307 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the CreateDirectiveRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateDirectiveRequest{}
// CreateDirectiveRequest Request model for creating a directive.
type CreateDirectiveRequest struct {
// Human-readable name for the directive
Name string `json:"name"`
// The directive text to inject into prompts
Content string `json:"content"`
// Higher priority directives are injected first
Priority *int32 `json:"priority,omitempty"`
// Whether this directive is active
IsActive *bool `json:"is_active,omitempty"`
// Tags for filtering
Tags []string `json:"tags,omitempty"`
}
type _CreateDirectiveRequest CreateDirectiveRequest
// NewCreateDirectiveRequest instantiates a new CreateDirectiveRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateDirectiveRequest(name string, content string) *CreateDirectiveRequest {
this := CreateDirectiveRequest{}
this.Name = name
this.Content = content
var priority int32 = 0
this.Priority = &priority
var isActive bool = true
this.IsActive = &isActive
return &this
}
// NewCreateDirectiveRequestWithDefaults instantiates a new CreateDirectiveRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateDirectiveRequestWithDefaults() *CreateDirectiveRequest {
this := CreateDirectiveRequest{}
var priority int32 = 0
this.Priority = &priority
var isActive bool = true
this.IsActive = &isActive
return &this
}
// GetName returns the Name field value
func (o *CreateDirectiveRequest) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *CreateDirectiveRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *CreateDirectiveRequest) SetName(v string) {
o.Name = v
}
// GetContent returns the Content field value
func (o *CreateDirectiveRequest) GetContent() string {
if o == nil {
var ret string
return ret
}
return o.Content
}
// GetContentOk returns a tuple with the Content field value
// and a boolean to check if the value has been set.
func (o *CreateDirectiveRequest) GetContentOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Content, true
}
// SetContent sets field value
func (o *CreateDirectiveRequest) SetContent(v string) {
o.Content = v
}
// GetPriority returns the Priority field value if set, zero value otherwise.
func (o *CreateDirectiveRequest) GetPriority() int32 {
if o == nil || IsNil(o.Priority) {
var ret int32
return ret
}
return *o.Priority
}
// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateDirectiveRequest) GetPriorityOk() (*int32, bool) {
if o == nil || IsNil(o.Priority) {
return nil, false
}
return o.Priority, true
}
// HasPriority returns a boolean if a field has been set.
func (o *CreateDirectiveRequest) HasPriority() bool {
if o != nil && !IsNil(o.Priority) {
return true
}
return false
}
// SetPriority gets a reference to the given int32 and assigns it to the Priority field.
func (o *CreateDirectiveRequest) SetPriority(v int32) {
o.Priority = &v
}
// GetIsActive returns the IsActive field value if set, zero value otherwise.
func (o *CreateDirectiveRequest) GetIsActive() bool {
if o == nil || IsNil(o.IsActive) {
var ret bool
return ret
}
return *o.IsActive
}
// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateDirectiveRequest) GetIsActiveOk() (*bool, bool) {
if o == nil || IsNil(o.IsActive) {
return nil, false
}
return o.IsActive, true
}
// HasIsActive returns a boolean if a field has been set.
func (o *CreateDirectiveRequest) HasIsActive() bool {
if o != nil && !IsNil(o.IsActive) {
return true
}
return false
}
// SetIsActive gets a reference to the given bool and assigns it to the IsActive field.
func (o *CreateDirectiveRequest) SetIsActive(v bool) {
o.IsActive = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *CreateDirectiveRequest) GetTags() []string {
if o == nil || IsNil(o.Tags) {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateDirectiveRequest) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *CreateDirectiveRequest) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *CreateDirectiveRequest) SetTags(v []string) {
o.Tags = v
}
func (o CreateDirectiveRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateDirectiveRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["name"] = o.Name
toSerialize["content"] = o.Content
if !IsNil(o.Priority) {
toSerialize["priority"] = o.Priority
}
if !IsNil(o.IsActive) {
toSerialize["is_active"] = o.IsActive
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
return toSerialize, nil
}
func (o *CreateDirectiveRequest) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"name",
"content",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCreateDirectiveRequest := _CreateDirectiveRequest{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varCreateDirectiveRequest)
if err != nil {
return err
}
*o = CreateDirectiveRequest(varCreateDirectiveRequest)
return err
}
type NullableCreateDirectiveRequest struct {
value *CreateDirectiveRequest
isSet bool
}
func (v NullableCreateDirectiveRequest) Get() *CreateDirectiveRequest {
return v.value
}
func (v *NullableCreateDirectiveRequest) Set(val *CreateDirectiveRequest) {
v.value = val
v.isSet = true
}
func (v NullableCreateDirectiveRequest) IsSet() bool {
return v.isSet
}
func (v *NullableCreateDirectiveRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateDirectiveRequest(val *CreateDirectiveRequest) *NullableCreateDirectiveRequest {
return &NullableCreateDirectiveRequest{value: val, isSet: true}
}
func (v NullableCreateDirectiveRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateDirectiveRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,349 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the CreateMentalModelRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateMentalModelRequest{}
// CreateMentalModelRequest Request model for creating a mental model.
type CreateMentalModelRequest struct {
Id NullableString `json:"id,omitempty"`
// Human-readable name for the mental model
Name string `json:"name"`
// The query to run to generate content
SourceQuery string `json:"source_query"`
// Tags for scoped visibility
Tags []string `json:"tags,omitempty"`
// Maximum tokens for generated content
MaxTokens *int32 `json:"max_tokens,omitempty"`
// Trigger settings
Trigger *MentalModelTrigger `json:"trigger,omitempty"`
}
type _CreateMentalModelRequest CreateMentalModelRequest
// NewCreateMentalModelRequest instantiates a new CreateMentalModelRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateMentalModelRequest(name string, sourceQuery string) *CreateMentalModelRequest {
this := CreateMentalModelRequest{}
this.Name = name
this.SourceQuery = sourceQuery
var maxTokens int32 = 2048
this.MaxTokens = &maxTokens
return &this
}
// NewCreateMentalModelRequestWithDefaults instantiates a new CreateMentalModelRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateMentalModelRequestWithDefaults() *CreateMentalModelRequest {
this := CreateMentalModelRequest{}
var maxTokens int32 = 2048
this.MaxTokens = &maxTokens
return &this
}
// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateMentalModelRequest) GetId() string {
if o == nil || IsNil(o.Id.Get()) {
var ret string
return ret
}
return *o.Id.Get()
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateMentalModelRequest) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Id.Get(), o.Id.IsSet()
}
// HasId returns a boolean if a field has been set.
func (o *CreateMentalModelRequest) HasId() bool {
if o != nil && o.Id.IsSet() {
return true
}
return false
}
// SetId gets a reference to the given NullableString and assigns it to the Id field.
func (o *CreateMentalModelRequest) SetId(v string) {
o.Id.Set(&v)
}
// SetIdNil sets the value for Id to be an explicit nil
func (o *CreateMentalModelRequest) SetIdNil() {
o.Id.Set(nil)
}
// UnsetId ensures that no value is present for Id, not even an explicit nil
func (o *CreateMentalModelRequest) UnsetId() {
o.Id.Unset()
}
// GetName returns the Name field value
func (o *CreateMentalModelRequest) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *CreateMentalModelRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *CreateMentalModelRequest) SetName(v string) {
o.Name = v
}
// GetSourceQuery returns the SourceQuery field value
func (o *CreateMentalModelRequest) GetSourceQuery() string {
if o == nil {
var ret string
return ret
}
return o.SourceQuery
}
// GetSourceQueryOk returns a tuple with the SourceQuery field value
// and a boolean to check if the value has been set.
func (o *CreateMentalModelRequest) GetSourceQueryOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.SourceQuery, true
}
// SetSourceQuery sets field value
func (o *CreateMentalModelRequest) SetSourceQuery(v string) {
o.SourceQuery = v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *CreateMentalModelRequest) GetTags() []string {
if o == nil || IsNil(o.Tags) {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateMentalModelRequest) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *CreateMentalModelRequest) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *CreateMentalModelRequest) SetTags(v []string) {
o.Tags = v
}
// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise.
func (o *CreateMentalModelRequest) GetMaxTokens() int32 {
if o == nil || IsNil(o.MaxTokens) {
var ret int32
return ret
}
return *o.MaxTokens
}
// GetMaxTokensOk returns a tuple with the MaxTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateMentalModelRequest) GetMaxTokensOk() (*int32, bool) {
if o == nil || IsNil(o.MaxTokens) {
return nil, false
}
return o.MaxTokens, true
}
// HasMaxTokens returns a boolean if a field has been set.
func (o *CreateMentalModelRequest) HasMaxTokens() bool {
if o != nil && !IsNil(o.MaxTokens) {
return true
}
return false
}
// SetMaxTokens gets a reference to the given int32 and assigns it to the MaxTokens field.
func (o *CreateMentalModelRequest) SetMaxTokens(v int32) {
o.MaxTokens = &v
}
// GetTrigger returns the Trigger field value if set, zero value otherwise.
func (o *CreateMentalModelRequest) GetTrigger() MentalModelTrigger {
if o == nil || IsNil(o.Trigger) {
var ret MentalModelTrigger
return ret
}
return *o.Trigger
}
// GetTriggerOk returns a tuple with the Trigger field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateMentalModelRequest) GetTriggerOk() (*MentalModelTrigger, bool) {
if o == nil || IsNil(o.Trigger) {
return nil, false
}
return o.Trigger, true
}
// HasTrigger returns a boolean if a field has been set.
func (o *CreateMentalModelRequest) HasTrigger() bool {
if o != nil && !IsNil(o.Trigger) {
return true
}
return false
}
// SetTrigger gets a reference to the given MentalModelTrigger and assigns it to the Trigger field.
func (o *CreateMentalModelRequest) SetTrigger(v MentalModelTrigger) {
o.Trigger = &v
}
func (o CreateMentalModelRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateMentalModelRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Id.IsSet() {
toSerialize["id"] = o.Id.Get()
}
toSerialize["name"] = o.Name
toSerialize["source_query"] = o.SourceQuery
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
if !IsNil(o.MaxTokens) {
toSerialize["max_tokens"] = o.MaxTokens
}
if !IsNil(o.Trigger) {
toSerialize["trigger"] = o.Trigger
}
return toSerialize, nil
}
func (o *CreateMentalModelRequest) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"name",
"source_query",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCreateMentalModelRequest := _CreateMentalModelRequest{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varCreateMentalModelRequest)
if err != nil {
return err
}
*o = CreateMentalModelRequest(varCreateMentalModelRequest)
return err
}
type NullableCreateMentalModelRequest struct {
value *CreateMentalModelRequest
isSet bool
}
func (v NullableCreateMentalModelRequest) Get() *CreateMentalModelRequest {
return v.value
}
func (v *NullableCreateMentalModelRequest) Set(val *CreateMentalModelRequest) {
v.value = val
v.isSet = true
}
func (v NullableCreateMentalModelRequest) IsSet() bool {
return v.isSet
}
func (v *NullableCreateMentalModelRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateMentalModelRequest(val *CreateMentalModelRequest) *NullableCreateMentalModelRequest {
return &NullableCreateMentalModelRequest{value: val, isSet: true}
}
func (v NullableCreateMentalModelRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateMentalModelRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,205 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the CreateMentalModelResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateMentalModelResponse{}
// CreateMentalModelResponse Response model for mental model creation.
type CreateMentalModelResponse struct {
MentalModelId NullableString `json:"mental_model_id,omitempty"`
// Operation ID to track refresh progress
OperationId string `json:"operation_id"`
}
type _CreateMentalModelResponse CreateMentalModelResponse
// NewCreateMentalModelResponse instantiates a new CreateMentalModelResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateMentalModelResponse(operationId string) *CreateMentalModelResponse {
this := CreateMentalModelResponse{}
this.OperationId = operationId
return &this
}
// NewCreateMentalModelResponseWithDefaults instantiates a new CreateMentalModelResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateMentalModelResponseWithDefaults() *CreateMentalModelResponse {
this := CreateMentalModelResponse{}
return &this
}
// GetMentalModelId returns the MentalModelId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateMentalModelResponse) GetMentalModelId() string {
if o == nil || IsNil(o.MentalModelId.Get()) {
var ret string
return ret
}
return *o.MentalModelId.Get()
}
// GetMentalModelIdOk returns a tuple with the MentalModelId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateMentalModelResponse) GetMentalModelIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.MentalModelId.Get(), o.MentalModelId.IsSet()
}
// HasMentalModelId returns a boolean if a field has been set.
func (o *CreateMentalModelResponse) HasMentalModelId() bool {
if o != nil && o.MentalModelId.IsSet() {
return true
}
return false
}
// SetMentalModelId gets a reference to the given NullableString and assigns it to the MentalModelId field.
func (o *CreateMentalModelResponse) SetMentalModelId(v string) {
o.MentalModelId.Set(&v)
}
// SetMentalModelIdNil sets the value for MentalModelId to be an explicit nil
func (o *CreateMentalModelResponse) SetMentalModelIdNil() {
o.MentalModelId.Set(nil)
}
// UnsetMentalModelId ensures that no value is present for MentalModelId, not even an explicit nil
func (o *CreateMentalModelResponse) UnsetMentalModelId() {
o.MentalModelId.Unset()
}
// GetOperationId returns the OperationId field value
func (o *CreateMentalModelResponse) GetOperationId() string {
if o == nil {
var ret string
return ret
}
return o.OperationId
}
// GetOperationIdOk returns a tuple with the OperationId field value
// and a boolean to check if the value has been set.
func (o *CreateMentalModelResponse) GetOperationIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OperationId, true
}
// SetOperationId sets field value
func (o *CreateMentalModelResponse) SetOperationId(v string) {
o.OperationId = v
}
func (o CreateMentalModelResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateMentalModelResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.MentalModelId.IsSet() {
toSerialize["mental_model_id"] = o.MentalModelId.Get()
}
toSerialize["operation_id"] = o.OperationId
return toSerialize, nil
}
func (o *CreateMentalModelResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"operation_id",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCreateMentalModelResponse := _CreateMentalModelResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varCreateMentalModelResponse)
if err != nil {
return err
}
*o = CreateMentalModelResponse(varCreateMentalModelResponse)
return err
}
type NullableCreateMentalModelResponse struct {
value *CreateMentalModelResponse
isSet bool
}
func (v NullableCreateMentalModelResponse) Get() *CreateMentalModelResponse {
return v.value
}
func (v *NullableCreateMentalModelResponse) Set(val *CreateMentalModelResponse) {
v.value = val
v.isSet = true
}
func (v NullableCreateMentalModelResponse) IsSet() bool {
return v.isSet
}
func (v *NullableCreateMentalModelResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateMentalModelResponse(val *CreateMentalModelResponse) *NullableCreateMentalModelResponse {
return &NullableCreateMentalModelResponse{value: val, isSet: true}
}
func (v NullableCreateMentalModelResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateMentalModelResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,242 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the DeleteDocumentResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DeleteDocumentResponse{}
// DeleteDocumentResponse Response model for delete document endpoint.
type DeleteDocumentResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
DocumentId string `json:"document_id"`
MemoryUnitsDeleted int32 `json:"memory_units_deleted"`
}
type _DeleteDocumentResponse DeleteDocumentResponse
// NewDeleteDocumentResponse instantiates a new DeleteDocumentResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDeleteDocumentResponse(success bool, message string, documentId string, memoryUnitsDeleted int32) *DeleteDocumentResponse {
this := DeleteDocumentResponse{}
this.Success = success
this.Message = message
this.DocumentId = documentId
this.MemoryUnitsDeleted = memoryUnitsDeleted
return &this
}
// NewDeleteDocumentResponseWithDefaults instantiates a new DeleteDocumentResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDeleteDocumentResponseWithDefaults() *DeleteDocumentResponse {
this := DeleteDocumentResponse{}
return &this
}
// GetSuccess returns the Success field value
func (o *DeleteDocumentResponse) GetSuccess() bool {
if o == nil {
var ret bool
return ret
}
return o.Success
}
// GetSuccessOk returns a tuple with the Success field value
// and a boolean to check if the value has been set.
func (o *DeleteDocumentResponse) GetSuccessOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Success, true
}
// SetSuccess sets field value
func (o *DeleteDocumentResponse) SetSuccess(v bool) {
o.Success = v
}
// GetMessage returns the Message field value
func (o *DeleteDocumentResponse) GetMessage() string {
if o == nil {
var ret string
return ret
}
return o.Message
}
// GetMessageOk returns a tuple with the Message field value
// and a boolean to check if the value has been set.
func (o *DeleteDocumentResponse) GetMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Message, true
}
// SetMessage sets field value
func (o *DeleteDocumentResponse) SetMessage(v string) {
o.Message = v
}
// GetDocumentId returns the DocumentId field value
func (o *DeleteDocumentResponse) GetDocumentId() string {
if o == nil {
var ret string
return ret
}
return o.DocumentId
}
// GetDocumentIdOk returns a tuple with the DocumentId field value
// and a boolean to check if the value has been set.
func (o *DeleteDocumentResponse) GetDocumentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DocumentId, true
}
// SetDocumentId sets field value
func (o *DeleteDocumentResponse) SetDocumentId(v string) {
o.DocumentId = v
}
// GetMemoryUnitsDeleted returns the MemoryUnitsDeleted field value
func (o *DeleteDocumentResponse) GetMemoryUnitsDeleted() int32 {
if o == nil {
var ret int32
return ret
}
return o.MemoryUnitsDeleted
}
// GetMemoryUnitsDeletedOk returns a tuple with the MemoryUnitsDeleted field value
// and a boolean to check if the value has been set.
func (o *DeleteDocumentResponse) GetMemoryUnitsDeletedOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.MemoryUnitsDeleted, true
}
// SetMemoryUnitsDeleted sets field value
func (o *DeleteDocumentResponse) SetMemoryUnitsDeleted(v int32) {
o.MemoryUnitsDeleted = v
}
func (o DeleteDocumentResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DeleteDocumentResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["success"] = o.Success
toSerialize["message"] = o.Message
toSerialize["document_id"] = o.DocumentId
toSerialize["memory_units_deleted"] = o.MemoryUnitsDeleted
return toSerialize, nil
}
func (o *DeleteDocumentResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"success",
"message",
"document_id",
"memory_units_deleted",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varDeleteDocumentResponse := _DeleteDocumentResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varDeleteDocumentResponse)
if err != nil {
return err
}
*o = DeleteDocumentResponse(varDeleteDocumentResponse)
return err
}
type NullableDeleteDocumentResponse struct {
value *DeleteDocumentResponse
isSet bool
}
func (v NullableDeleteDocumentResponse) Get() *DeleteDocumentResponse {
return v.value
}
func (v *NullableDeleteDocumentResponse) Set(val *DeleteDocumentResponse) {
v.value = val
v.isSet = true
}
func (v NullableDeleteDocumentResponse) IsSet() bool {
return v.isSet
}
func (v *NullableDeleteDocumentResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeleteDocumentResponse(val *DeleteDocumentResponse) *NullableDeleteDocumentResponse {
return &NullableDeleteDocumentResponse{value: val, isSet: true}
}
func (v NullableDeleteDocumentResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeleteDocumentResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,250 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the DeleteResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DeleteResponse{}
// DeleteResponse Response model for delete operations.
type DeleteResponse struct {
Success bool `json:"success"`
Message NullableString `json:"message,omitempty"`
DeletedCount NullableInt32 `json:"deleted_count,omitempty"`
}
type _DeleteResponse DeleteResponse
// NewDeleteResponse instantiates a new DeleteResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDeleteResponse(success bool) *DeleteResponse {
this := DeleteResponse{}
this.Success = success
return &this
}
// NewDeleteResponseWithDefaults instantiates a new DeleteResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDeleteResponseWithDefaults() *DeleteResponse {
this := DeleteResponse{}
return &this
}
// GetSuccess returns the Success field value
func (o *DeleteResponse) GetSuccess() bool {
if o == nil {
var ret bool
return ret
}
return o.Success
}
// GetSuccessOk returns a tuple with the Success field value
// and a boolean to check if the value has been set.
func (o *DeleteResponse) GetSuccessOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Success, true
}
// SetSuccess sets field value
func (o *DeleteResponse) SetSuccess(v bool) {
o.Success = v
}
// GetMessage returns the Message field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DeleteResponse) GetMessage() string {
if o == nil || IsNil(o.Message.Get()) {
var ret string
return ret
}
return *o.Message.Get()
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *DeleteResponse) GetMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Message.Get(), o.Message.IsSet()
}
// HasMessage returns a boolean if a field has been set.
func (o *DeleteResponse) HasMessage() bool {
if o != nil && o.Message.IsSet() {
return true
}
return false
}
// SetMessage gets a reference to the given NullableString and assigns it to the Message field.
func (o *DeleteResponse) SetMessage(v string) {
o.Message.Set(&v)
}
// SetMessageNil sets the value for Message to be an explicit nil
func (o *DeleteResponse) SetMessageNil() {
o.Message.Set(nil)
}
// UnsetMessage ensures that no value is present for Message, not even an explicit nil
func (o *DeleteResponse) UnsetMessage() {
o.Message.Unset()
}
// GetDeletedCount returns the DeletedCount field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DeleteResponse) GetDeletedCount() int32 {
if o == nil || IsNil(o.DeletedCount.Get()) {
var ret int32
return ret
}
return *o.DeletedCount.Get()
}
// GetDeletedCountOk returns a tuple with the DeletedCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *DeleteResponse) GetDeletedCountOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.DeletedCount.Get(), o.DeletedCount.IsSet()
}
// HasDeletedCount returns a boolean if a field has been set.
func (o *DeleteResponse) HasDeletedCount() bool {
if o != nil && o.DeletedCount.IsSet() {
return true
}
return false
}
// SetDeletedCount gets a reference to the given NullableInt32 and assigns it to the DeletedCount field.
func (o *DeleteResponse) SetDeletedCount(v int32) {
o.DeletedCount.Set(&v)
}
// SetDeletedCountNil sets the value for DeletedCount to be an explicit nil
func (o *DeleteResponse) SetDeletedCountNil() {
o.DeletedCount.Set(nil)
}
// UnsetDeletedCount ensures that no value is present for DeletedCount, not even an explicit nil
func (o *DeleteResponse) UnsetDeletedCount() {
o.DeletedCount.Unset()
}
func (o DeleteResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DeleteResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["success"] = o.Success
if o.Message.IsSet() {
toSerialize["message"] = o.Message.Get()
}
if o.DeletedCount.IsSet() {
toSerialize["deleted_count"] = o.DeletedCount.Get()
}
return toSerialize, nil
}
func (o *DeleteResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"success",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varDeleteResponse := _DeleteResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varDeleteResponse)
if err != nil {
return err
}
*o = DeleteResponse(varDeleteResponse)
return err
}
type NullableDeleteResponse struct {
value *DeleteResponse
isSet bool
}
func (v NullableDeleteResponse) Get() *DeleteResponse {
return v.value
}
func (v *NullableDeleteResponse) Set(val *DeleteResponse) {
v.value = val
v.isSet = true
}
func (v NullableDeleteResponse) IsSet() bool {
return v.isSet
}
func (v *NullableDeleteResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeleteResponse(val *DeleteResponse) *NullableDeleteResponse {
return &NullableDeleteResponse{value: val, isSet: true}
}
func (v NullableDeleteResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeleteResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,158 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the DirectiveListResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DirectiveListResponse{}
// DirectiveListResponse Response model for listing directives.
type DirectiveListResponse struct {
Items []DirectiveResponse `json:"items"`
}
type _DirectiveListResponse DirectiveListResponse
// NewDirectiveListResponse instantiates a new DirectiveListResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDirectiveListResponse(items []DirectiveResponse) *DirectiveListResponse {
this := DirectiveListResponse{}
this.Items = items
return &this
}
// NewDirectiveListResponseWithDefaults instantiates a new DirectiveListResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDirectiveListResponseWithDefaults() *DirectiveListResponse {
this := DirectiveListResponse{}
return &this
}
// GetItems returns the Items field value
func (o *DirectiveListResponse) GetItems() []DirectiveResponse {
if o == nil {
var ret []DirectiveResponse
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *DirectiveListResponse) GetItemsOk() ([]DirectiveResponse, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *DirectiveListResponse) SetItems(v []DirectiveResponse) {
o.Items = v
}
func (o DirectiveListResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DirectiveListResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["items"] = o.Items
return toSerialize, nil
}
func (o *DirectiveListResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"items",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varDirectiveListResponse := _DirectiveListResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varDirectiveListResponse)
if err != nil {
return err
}
*o = DirectiveListResponse(varDirectiveListResponse)
return err
}
type NullableDirectiveListResponse struct {
value *DirectiveListResponse
isSet bool
}
func (v NullableDirectiveListResponse) Get() *DirectiveListResponse {
return v.value
}
func (v *NullableDirectiveListResponse) Set(val *DirectiveListResponse) {
v.value = val
v.isSet = true
}
func (v NullableDirectiveListResponse) IsSet() bool {
return v.isSet
}
func (v *NullableDirectiveListResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDirectiveListResponse(val *DirectiveListResponse) *NullableDirectiveListResponse {
return &NullableDirectiveListResponse{value: val, isSet: true}
}
func (v NullableDirectiveListResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDirectiveListResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,450 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the DirectiveResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DirectiveResponse{}
// DirectiveResponse Response model for a directive.
type DirectiveResponse struct {
Id string `json:"id"`
BankId string `json:"bank_id"`
Name string `json:"name"`
Content string `json:"content"`
Priority *int32 `json:"priority,omitempty"`
IsActive *bool `json:"is_active,omitempty"`
Tags []string `json:"tags,omitempty"`
CreatedAt NullableString `json:"created_at,omitempty"`
UpdatedAt NullableString `json:"updated_at,omitempty"`
}
type _DirectiveResponse DirectiveResponse
// NewDirectiveResponse instantiates a new DirectiveResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDirectiveResponse(id string, bankId string, name string, content string) *DirectiveResponse {
this := DirectiveResponse{}
this.Id = id
this.BankId = bankId
this.Name = name
this.Content = content
var priority int32 = 0
this.Priority = &priority
var isActive bool = true
this.IsActive = &isActive
return &this
}
// NewDirectiveResponseWithDefaults instantiates a new DirectiveResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDirectiveResponseWithDefaults() *DirectiveResponse {
this := DirectiveResponse{}
var priority int32 = 0
this.Priority = &priority
var isActive bool = true
this.IsActive = &isActive
return &this
}
// GetId returns the Id field value
func (o *DirectiveResponse) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *DirectiveResponse) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *DirectiveResponse) SetId(v string) {
o.Id = v
}
// GetBankId returns the BankId field value
func (o *DirectiveResponse) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *DirectiveResponse) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *DirectiveResponse) SetBankId(v string) {
o.BankId = v
}
// GetName returns the Name field value
func (o *DirectiveResponse) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *DirectiveResponse) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *DirectiveResponse) SetName(v string) {
o.Name = v
}
// GetContent returns the Content field value
func (o *DirectiveResponse) GetContent() string {
if o == nil {
var ret string
return ret
}
return o.Content
}
// GetContentOk returns a tuple with the Content field value
// and a boolean to check if the value has been set.
func (o *DirectiveResponse) GetContentOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Content, true
}
// SetContent sets field value
func (o *DirectiveResponse) SetContent(v string) {
o.Content = v
}
// GetPriority returns the Priority field value if set, zero value otherwise.
func (o *DirectiveResponse) GetPriority() int32 {
if o == nil || IsNil(o.Priority) {
var ret int32
return ret
}
return *o.Priority
}
// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DirectiveResponse) GetPriorityOk() (*int32, bool) {
if o == nil || IsNil(o.Priority) {
return nil, false
}
return o.Priority, true
}
// HasPriority returns a boolean if a field has been set.
func (o *DirectiveResponse) HasPriority() bool {
if o != nil && !IsNil(o.Priority) {
return true
}
return false
}
// SetPriority gets a reference to the given int32 and assigns it to the Priority field.
func (o *DirectiveResponse) SetPriority(v int32) {
o.Priority = &v
}
// GetIsActive returns the IsActive field value if set, zero value otherwise.
func (o *DirectiveResponse) GetIsActive() bool {
if o == nil || IsNil(o.IsActive) {
var ret bool
return ret
}
return *o.IsActive
}
// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DirectiveResponse) GetIsActiveOk() (*bool, bool) {
if o == nil || IsNil(o.IsActive) {
return nil, false
}
return o.IsActive, true
}
// HasIsActive returns a boolean if a field has been set.
func (o *DirectiveResponse) HasIsActive() bool {
if o != nil && !IsNil(o.IsActive) {
return true
}
return false
}
// SetIsActive gets a reference to the given bool and assigns it to the IsActive field.
func (o *DirectiveResponse) SetIsActive(v bool) {
o.IsActive = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *DirectiveResponse) GetTags() []string {
if o == nil || IsNil(o.Tags) {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DirectiveResponse) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *DirectiveResponse) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *DirectiveResponse) SetTags(v []string) {
o.Tags = v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DirectiveResponse) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt.Get()) {
var ret string
return ret
}
return *o.CreatedAt.Get()
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *DirectiveResponse) GetCreatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CreatedAt.Get(), o.CreatedAt.IsSet()
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *DirectiveResponse) HasCreatedAt() bool {
if o != nil && o.CreatedAt.IsSet() {
return true
}
return false
}
// SetCreatedAt gets a reference to the given NullableString and assigns it to the CreatedAt field.
func (o *DirectiveResponse) SetCreatedAt(v string) {
o.CreatedAt.Set(&v)
}
// SetCreatedAtNil sets the value for CreatedAt to be an explicit nil
func (o *DirectiveResponse) SetCreatedAtNil() {
o.CreatedAt.Set(nil)
}
// UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil
func (o *DirectiveResponse) UnsetCreatedAt() {
o.CreatedAt.Unset()
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DirectiveResponse) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt.Get()) {
var ret string
return ret
}
return *o.UpdatedAt.Get()
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *DirectiveResponse) GetUpdatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.UpdatedAt.Get(), o.UpdatedAt.IsSet()
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *DirectiveResponse) HasUpdatedAt() bool {
if o != nil && o.UpdatedAt.IsSet() {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given NullableString and assigns it to the UpdatedAt field.
func (o *DirectiveResponse) SetUpdatedAt(v string) {
o.UpdatedAt.Set(&v)
}
// SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil
func (o *DirectiveResponse) SetUpdatedAtNil() {
o.UpdatedAt.Set(nil)
}
// UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil
func (o *DirectiveResponse) UnsetUpdatedAt() {
o.UpdatedAt.Unset()
}
func (o DirectiveResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DirectiveResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["bank_id"] = o.BankId
toSerialize["name"] = o.Name
toSerialize["content"] = o.Content
if !IsNil(o.Priority) {
toSerialize["priority"] = o.Priority
}
if !IsNil(o.IsActive) {
toSerialize["is_active"] = o.IsActive
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
if o.CreatedAt.IsSet() {
toSerialize["created_at"] = o.CreatedAt.Get()
}
if o.UpdatedAt.IsSet() {
toSerialize["updated_at"] = o.UpdatedAt.Get()
}
return toSerialize, nil
}
func (o *DirectiveResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"bank_id",
"name",
"content",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varDirectiveResponse := _DirectiveResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varDirectiveResponse)
if err != nil {
return err
}
*o = DirectiveResponse(varDirectiveResponse)
return err
}
type NullableDirectiveResponse struct {
value *DirectiveResponse
isSet bool
}
func (v NullableDirectiveResponse) Get() *DirectiveResponse {
return v.value
}
func (v *NullableDirectiveResponse) Set(val *DirectiveResponse) {
v.value = val
v.isSet = true
}
func (v NullableDirectiveResponse) IsSet() bool {
return v.isSet
}
func (v *NullableDirectiveResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDirectiveResponse(val *DirectiveResponse) *NullableDirectiveResponse {
return &NullableDirectiveResponse{value: val, isSet: true}
}
func (v NullableDirectiveResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDirectiveResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,217 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the DispositionTraits type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DispositionTraits{}
// DispositionTraits Disposition traits that influence how memories are formed and interpreted.
type DispositionTraits struct {
// How skeptical vs trusting (1=trusting, 5=skeptical)
Skepticism int32 `json:"skepticism"`
// How literally to interpret information (1=flexible, 5=literal)
Literalism int32 `json:"literalism"`
// How much to consider emotional context (1=detached, 5=empathetic)
Empathy int32 `json:"empathy"`
}
type _DispositionTraits DispositionTraits
// NewDispositionTraits instantiates a new DispositionTraits object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDispositionTraits(skepticism int32, literalism int32, empathy int32) *DispositionTraits {
this := DispositionTraits{}
this.Skepticism = skepticism
this.Literalism = literalism
this.Empathy = empathy
return &this
}
// NewDispositionTraitsWithDefaults instantiates a new DispositionTraits object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDispositionTraitsWithDefaults() *DispositionTraits {
this := DispositionTraits{}
return &this
}
// GetSkepticism returns the Skepticism field value
func (o *DispositionTraits) GetSkepticism() int32 {
if o == nil {
var ret int32
return ret
}
return o.Skepticism
}
// GetSkepticismOk returns a tuple with the Skepticism field value
// and a boolean to check if the value has been set.
func (o *DispositionTraits) GetSkepticismOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Skepticism, true
}
// SetSkepticism sets field value
func (o *DispositionTraits) SetSkepticism(v int32) {
o.Skepticism = v
}
// GetLiteralism returns the Literalism field value
func (o *DispositionTraits) GetLiteralism() int32 {
if o == nil {
var ret int32
return ret
}
return o.Literalism
}
// GetLiteralismOk returns a tuple with the Literalism field value
// and a boolean to check if the value has been set.
func (o *DispositionTraits) GetLiteralismOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Literalism, true
}
// SetLiteralism sets field value
func (o *DispositionTraits) SetLiteralism(v int32) {
o.Literalism = v
}
// GetEmpathy returns the Empathy field value
func (o *DispositionTraits) GetEmpathy() int32 {
if o == nil {
var ret int32
return ret
}
return o.Empathy
}
// GetEmpathyOk returns a tuple with the Empathy field value
// and a boolean to check if the value has been set.
func (o *DispositionTraits) GetEmpathyOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Empathy, true
}
// SetEmpathy sets field value
func (o *DispositionTraits) SetEmpathy(v int32) {
o.Empathy = v
}
func (o DispositionTraits) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DispositionTraits) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["skepticism"] = o.Skepticism
toSerialize["literalism"] = o.Literalism
toSerialize["empathy"] = o.Empathy
return toSerialize, nil
}
func (o *DispositionTraits) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"skepticism",
"literalism",
"empathy",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varDispositionTraits := _DispositionTraits{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varDispositionTraits)
if err != nil {
return err
}
*o = DispositionTraits(varDispositionTraits)
return err
}
type NullableDispositionTraits struct {
value *DispositionTraits
isSet bool
}
func (v NullableDispositionTraits) Get() *DispositionTraits {
return v.value
}
func (v *NullableDispositionTraits) Set(val *DispositionTraits) {
v.value = val
v.isSet = true
}
func (v NullableDispositionTraits) IsSet() bool {
return v.isSet
}
func (v *NullableDispositionTraits) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDispositionTraits(val *DispositionTraits) *NullableDispositionTraits {
return &NullableDispositionTraits{value: val, isSet: true}
}
func (v NullableDispositionTraits) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDispositionTraits) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,365 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the DocumentResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DocumentResponse{}
// DocumentResponse Response model for get document endpoint.
type DocumentResponse struct {
Id string `json:"id"`
BankId string `json:"bank_id"`
OriginalText string `json:"original_text"`
ContentHash NullableString `json:"content_hash"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
MemoryUnitCount int32 `json:"memory_unit_count"`
// Tags associated with this document
Tags []string `json:"tags,omitempty"`
}
type _DocumentResponse DocumentResponse
// NewDocumentResponse instantiates a new DocumentResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDocumentResponse(id string, bankId string, originalText string, contentHash NullableString, createdAt string, updatedAt string, memoryUnitCount int32) *DocumentResponse {
this := DocumentResponse{}
this.Id = id
this.BankId = bankId
this.OriginalText = originalText
this.ContentHash = contentHash
this.CreatedAt = createdAt
this.UpdatedAt = updatedAt
this.MemoryUnitCount = memoryUnitCount
return &this
}
// NewDocumentResponseWithDefaults instantiates a new DocumentResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDocumentResponseWithDefaults() *DocumentResponse {
this := DocumentResponse{}
return &this
}
// GetId returns the Id field value
func (o *DocumentResponse) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *DocumentResponse) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *DocumentResponse) SetId(v string) {
o.Id = v
}
// GetBankId returns the BankId field value
func (o *DocumentResponse) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *DocumentResponse) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *DocumentResponse) SetBankId(v string) {
o.BankId = v
}
// GetOriginalText returns the OriginalText field value
func (o *DocumentResponse) GetOriginalText() string {
if o == nil {
var ret string
return ret
}
return o.OriginalText
}
// GetOriginalTextOk returns a tuple with the OriginalText field value
// and a boolean to check if the value has been set.
func (o *DocumentResponse) GetOriginalTextOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OriginalText, true
}
// SetOriginalText sets field value
func (o *DocumentResponse) SetOriginalText(v string) {
o.OriginalText = v
}
// GetContentHash returns the ContentHash field value
// If the value is explicit nil, the zero value for string will be returned
func (o *DocumentResponse) GetContentHash() string {
if o == nil || o.ContentHash.Get() == nil {
var ret string
return ret
}
return *o.ContentHash.Get()
}
// GetContentHashOk returns a tuple with the ContentHash field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *DocumentResponse) GetContentHashOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ContentHash.Get(), o.ContentHash.IsSet()
}
// SetContentHash sets field value
func (o *DocumentResponse) SetContentHash(v string) {
o.ContentHash.Set(&v)
}
// GetCreatedAt returns the CreatedAt field value
func (o *DocumentResponse) GetCreatedAt() string {
if o == nil {
var ret string
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *DocumentResponse) GetCreatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *DocumentResponse) SetCreatedAt(v string) {
o.CreatedAt = v
}
// GetUpdatedAt returns the UpdatedAt field value
func (o *DocumentResponse) GetUpdatedAt() string {
if o == nil {
var ret string
return ret
}
return o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
// and a boolean to check if the value has been set.
func (o *DocumentResponse) GetUpdatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.UpdatedAt, true
}
// SetUpdatedAt sets field value
func (o *DocumentResponse) SetUpdatedAt(v string) {
o.UpdatedAt = v
}
// GetMemoryUnitCount returns the MemoryUnitCount field value
func (o *DocumentResponse) GetMemoryUnitCount() int32 {
if o == nil {
var ret int32
return ret
}
return o.MemoryUnitCount
}
// GetMemoryUnitCountOk returns a tuple with the MemoryUnitCount field value
// and a boolean to check if the value has been set.
func (o *DocumentResponse) GetMemoryUnitCountOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.MemoryUnitCount, true
}
// SetMemoryUnitCount sets field value
func (o *DocumentResponse) SetMemoryUnitCount(v int32) {
o.MemoryUnitCount = v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *DocumentResponse) GetTags() []string {
if o == nil || IsNil(o.Tags) {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DocumentResponse) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *DocumentResponse) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *DocumentResponse) SetTags(v []string) {
o.Tags = v
}
func (o DocumentResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DocumentResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["bank_id"] = o.BankId
toSerialize["original_text"] = o.OriginalText
toSerialize["content_hash"] = o.ContentHash.Get()
toSerialize["created_at"] = o.CreatedAt
toSerialize["updated_at"] = o.UpdatedAt
toSerialize["memory_unit_count"] = o.MemoryUnitCount
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
return toSerialize, nil
}
func (o *DocumentResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"bank_id",
"original_text",
"content_hash",
"created_at",
"updated_at",
"memory_unit_count",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varDocumentResponse := _DocumentResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varDocumentResponse)
if err != nil {
return err
}
*o = DocumentResponse(varDocumentResponse)
return err
}
type NullableDocumentResponse struct {
value *DocumentResponse
isSet bool
}
func (v NullableDocumentResponse) Get() *DocumentResponse {
return v.value
}
func (v *NullableDocumentResponse) Set(val *DocumentResponse) {
v.value = val
v.isSet = true
}
func (v NullableDocumentResponse) IsSet() bool {
return v.isSet
}
func (v *NullableDocumentResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDocumentResponse(val *DocumentResponse) *NullableDocumentResponse {
return &NullableDocumentResponse{value: val, isSet: true}
}
func (v NullableDocumentResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDocumentResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,371 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the EntityDetailResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EntityDetailResponse{}
// EntityDetailResponse Response model for entity detail endpoint.
type EntityDetailResponse struct {
Id string `json:"id"`
CanonicalName string `json:"canonical_name"`
MentionCount int32 `json:"mention_count"`
FirstSeen NullableString `json:"first_seen,omitempty"`
LastSeen NullableString `json:"last_seen,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
Observations []EntityObservationResponse `json:"observations"`
}
type _EntityDetailResponse EntityDetailResponse
// NewEntityDetailResponse instantiates a new EntityDetailResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewEntityDetailResponse(id string, canonicalName string, mentionCount int32, observations []EntityObservationResponse) *EntityDetailResponse {
this := EntityDetailResponse{}
this.Id = id
this.CanonicalName = canonicalName
this.MentionCount = mentionCount
this.Observations = observations
return &this
}
// NewEntityDetailResponseWithDefaults instantiates a new EntityDetailResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEntityDetailResponseWithDefaults() *EntityDetailResponse {
this := EntityDetailResponse{}
return &this
}
// GetId returns the Id field value
func (o *EntityDetailResponse) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *EntityDetailResponse) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *EntityDetailResponse) SetId(v string) {
o.Id = v
}
// GetCanonicalName returns the CanonicalName field value
func (o *EntityDetailResponse) GetCanonicalName() string {
if o == nil {
var ret string
return ret
}
return o.CanonicalName
}
// GetCanonicalNameOk returns a tuple with the CanonicalName field value
// and a boolean to check if the value has been set.
func (o *EntityDetailResponse) GetCanonicalNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CanonicalName, true
}
// SetCanonicalName sets field value
func (o *EntityDetailResponse) SetCanonicalName(v string) {
o.CanonicalName = v
}
// GetMentionCount returns the MentionCount field value
func (o *EntityDetailResponse) GetMentionCount() int32 {
if o == nil {
var ret int32
return ret
}
return o.MentionCount
}
// GetMentionCountOk returns a tuple with the MentionCount field value
// and a boolean to check if the value has been set.
func (o *EntityDetailResponse) GetMentionCountOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.MentionCount, true
}
// SetMentionCount sets field value
func (o *EntityDetailResponse) SetMentionCount(v int32) {
o.MentionCount = v
}
// GetFirstSeen returns the FirstSeen field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EntityDetailResponse) GetFirstSeen() string {
if o == nil || IsNil(o.FirstSeen.Get()) {
var ret string
return ret
}
return *o.FirstSeen.Get()
}
// GetFirstSeenOk returns a tuple with the FirstSeen field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EntityDetailResponse) GetFirstSeenOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.FirstSeen.Get(), o.FirstSeen.IsSet()
}
// HasFirstSeen returns a boolean if a field has been set.
func (o *EntityDetailResponse) HasFirstSeen() bool {
if o != nil && o.FirstSeen.IsSet() {
return true
}
return false
}
// SetFirstSeen gets a reference to the given NullableString and assigns it to the FirstSeen field.
func (o *EntityDetailResponse) SetFirstSeen(v string) {
o.FirstSeen.Set(&v)
}
// SetFirstSeenNil sets the value for FirstSeen to be an explicit nil
func (o *EntityDetailResponse) SetFirstSeenNil() {
o.FirstSeen.Set(nil)
}
// UnsetFirstSeen ensures that no value is present for FirstSeen, not even an explicit nil
func (o *EntityDetailResponse) UnsetFirstSeen() {
o.FirstSeen.Unset()
}
// GetLastSeen returns the LastSeen field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EntityDetailResponse) GetLastSeen() string {
if o == nil || IsNil(o.LastSeen.Get()) {
var ret string
return ret
}
return *o.LastSeen.Get()
}
// GetLastSeenOk returns a tuple with the LastSeen field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EntityDetailResponse) GetLastSeenOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.LastSeen.Get(), o.LastSeen.IsSet()
}
// HasLastSeen returns a boolean if a field has been set.
func (o *EntityDetailResponse) HasLastSeen() bool {
if o != nil && o.LastSeen.IsSet() {
return true
}
return false
}
// SetLastSeen gets a reference to the given NullableString and assigns it to the LastSeen field.
func (o *EntityDetailResponse) SetLastSeen(v string) {
o.LastSeen.Set(&v)
}
// SetLastSeenNil sets the value for LastSeen to be an explicit nil
func (o *EntityDetailResponse) SetLastSeenNil() {
o.LastSeen.Set(nil)
}
// UnsetLastSeen ensures that no value is present for LastSeen, not even an explicit nil
func (o *EntityDetailResponse) UnsetLastSeen() {
o.LastSeen.Unset()
}
// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EntityDetailResponse) GetMetadata() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EntityDetailResponse) GetMetadataOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Metadata) {
return map[string]interface{}{}, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *EntityDetailResponse) HasMetadata() bool {
if o != nil && !IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field.
func (o *EntityDetailResponse) SetMetadata(v map[string]interface{}) {
o.Metadata = v
}
// GetObservations returns the Observations field value
func (o *EntityDetailResponse) GetObservations() []EntityObservationResponse {
if o == nil {
var ret []EntityObservationResponse
return ret
}
return o.Observations
}
// GetObservationsOk returns a tuple with the Observations field value
// and a boolean to check if the value has been set.
func (o *EntityDetailResponse) GetObservationsOk() ([]EntityObservationResponse, bool) {
if o == nil {
return nil, false
}
return o.Observations, true
}
// SetObservations sets field value
func (o *EntityDetailResponse) SetObservations(v []EntityObservationResponse) {
o.Observations = v
}
func (o EntityDetailResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EntityDetailResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["canonical_name"] = o.CanonicalName
toSerialize["mention_count"] = o.MentionCount
if o.FirstSeen.IsSet() {
toSerialize["first_seen"] = o.FirstSeen.Get()
}
if o.LastSeen.IsSet() {
toSerialize["last_seen"] = o.LastSeen.Get()
}
if o.Metadata != nil {
toSerialize["metadata"] = o.Metadata
}
toSerialize["observations"] = o.Observations
return toSerialize, nil
}
func (o *EntityDetailResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"canonical_name",
"mention_count",
"observations",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varEntityDetailResponse := _EntityDetailResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varEntityDetailResponse)
if err != nil {
return err
}
*o = EntityDetailResponse(varEntityDetailResponse)
return err
}
type NullableEntityDetailResponse struct {
value *EntityDetailResponse
isSet bool
}
func (v NullableEntityDetailResponse) Get() *EntityDetailResponse {
return v.value
}
func (v *NullableEntityDetailResponse) Set(val *EntityDetailResponse) {
v.value = val
v.isSet = true
}
func (v NullableEntityDetailResponse) IsSet() bool {
return v.isSet
}
func (v *NullableEntityDetailResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEntityDetailResponse(val *EntityDetailResponse) *NullableEntityDetailResponse {
return &NullableEntityDetailResponse{value: val, isSet: true}
}
func (v NullableEntityDetailResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEntityDetailResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,131 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the EntityIncludeOptions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EntityIncludeOptions{}
// EntityIncludeOptions Options for including entity observations in recall results.
type EntityIncludeOptions struct {
// Maximum tokens for entity observations
MaxTokens *int32 `json:"max_tokens,omitempty"`
}
// NewEntityIncludeOptions instantiates a new EntityIncludeOptions object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewEntityIncludeOptions() *EntityIncludeOptions {
this := EntityIncludeOptions{}
var maxTokens int32 = 500
this.MaxTokens = &maxTokens
return &this
}
// NewEntityIncludeOptionsWithDefaults instantiates a new EntityIncludeOptions object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEntityIncludeOptionsWithDefaults() *EntityIncludeOptions {
this := EntityIncludeOptions{}
var maxTokens int32 = 500
this.MaxTokens = &maxTokens
return &this
}
// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise.
func (o *EntityIncludeOptions) GetMaxTokens() int32 {
if o == nil || IsNil(o.MaxTokens) {
var ret int32
return ret
}
return *o.MaxTokens
}
// GetMaxTokensOk returns a tuple with the MaxTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EntityIncludeOptions) GetMaxTokensOk() (*int32, bool) {
if o == nil || IsNil(o.MaxTokens) {
return nil, false
}
return o.MaxTokens, true
}
// HasMaxTokens returns a boolean if a field has been set.
func (o *EntityIncludeOptions) HasMaxTokens() bool {
if o != nil && !IsNil(o.MaxTokens) {
return true
}
return false
}
// SetMaxTokens gets a reference to the given int32 and assigns it to the MaxTokens field.
func (o *EntityIncludeOptions) SetMaxTokens(v int32) {
o.MaxTokens = &v
}
func (o EntityIncludeOptions) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EntityIncludeOptions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.MaxTokens) {
toSerialize["max_tokens"] = o.MaxTokens
}
return toSerialize, nil
}
type NullableEntityIncludeOptions struct {
value *EntityIncludeOptions
isSet bool
}
func (v NullableEntityIncludeOptions) Get() *EntityIncludeOptions {
return v.value
}
func (v *NullableEntityIncludeOptions) Set(val *EntityIncludeOptions) {
v.value = val
v.isSet = true
}
func (v NullableEntityIncludeOptions) IsSet() bool {
return v.isSet
}
func (v *NullableEntityIncludeOptions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEntityIncludeOptions(val *EntityIncludeOptions) *NullableEntityIncludeOptions {
return &NullableEntityIncludeOptions{value: val, isSet: true}
}
func (v NullableEntityIncludeOptions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEntityIncludeOptions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,205 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the EntityInput type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EntityInput{}
// EntityInput Entity to associate with retained content.
type EntityInput struct {
// The entity name/text
Text string `json:"text"`
Type NullableString `json:"type,omitempty"`
}
type _EntityInput EntityInput
// NewEntityInput instantiates a new EntityInput object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewEntityInput(text string) *EntityInput {
this := EntityInput{}
this.Text = text
return &this
}
// NewEntityInputWithDefaults instantiates a new EntityInput object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEntityInputWithDefaults() *EntityInput {
this := EntityInput{}
return &this
}
// GetText returns the Text field value
func (o *EntityInput) GetText() string {
if o == nil {
var ret string
return ret
}
return o.Text
}
// GetTextOk returns a tuple with the Text field value
// and a boolean to check if the value has been set.
func (o *EntityInput) GetTextOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Text, true
}
// SetText sets field value
func (o *EntityInput) SetText(v string) {
o.Text = v
}
// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EntityInput) GetType() string {
if o == nil || IsNil(o.Type.Get()) {
var ret string
return ret
}
return *o.Type.Get()
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EntityInput) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Type.Get(), o.Type.IsSet()
}
// HasType returns a boolean if a field has been set.
func (o *EntityInput) HasType() bool {
if o != nil && o.Type.IsSet() {
return true
}
return false
}
// SetType gets a reference to the given NullableString and assigns it to the Type field.
func (o *EntityInput) SetType(v string) {
o.Type.Set(&v)
}
// SetTypeNil sets the value for Type to be an explicit nil
func (o *EntityInput) SetTypeNil() {
o.Type.Set(nil)
}
// UnsetType ensures that no value is present for Type, not even an explicit nil
func (o *EntityInput) UnsetType() {
o.Type.Unset()
}
func (o EntityInput) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EntityInput) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["text"] = o.Text
if o.Type.IsSet() {
toSerialize["type"] = o.Type.Get()
}
return toSerialize, nil
}
func (o *EntityInput) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"text",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varEntityInput := _EntityInput{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varEntityInput)
if err != nil {
return err
}
*o = EntityInput(varEntityInput)
return err
}
type NullableEntityInput struct {
value *EntityInput
isSet bool
}
func (v NullableEntityInput) Get() *EntityInput {
return v.value
}
func (v *NullableEntityInput) Set(val *EntityInput) {
v.value = val
v.isSet = true
}
func (v NullableEntityInput) IsSet() bool {
return v.isSet
}
func (v *NullableEntityInput) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEntityInput(val *EntityInput) *NullableEntityInput {
return &NullableEntityInput{value: val, isSet: true}
}
func (v NullableEntityInput) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEntityInput) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,343 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the EntityListItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EntityListItem{}
// EntityListItem Entity list item with summary.
type EntityListItem struct {
Id string `json:"id"`
CanonicalName string `json:"canonical_name"`
MentionCount int32 `json:"mention_count"`
FirstSeen NullableString `json:"first_seen,omitempty"`
LastSeen NullableString `json:"last_seen,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
type _EntityListItem EntityListItem
// NewEntityListItem instantiates a new EntityListItem object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewEntityListItem(id string, canonicalName string, mentionCount int32) *EntityListItem {
this := EntityListItem{}
this.Id = id
this.CanonicalName = canonicalName
this.MentionCount = mentionCount
return &this
}
// NewEntityListItemWithDefaults instantiates a new EntityListItem object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEntityListItemWithDefaults() *EntityListItem {
this := EntityListItem{}
return &this
}
// GetId returns the Id field value
func (o *EntityListItem) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *EntityListItem) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *EntityListItem) SetId(v string) {
o.Id = v
}
// GetCanonicalName returns the CanonicalName field value
func (o *EntityListItem) GetCanonicalName() string {
if o == nil {
var ret string
return ret
}
return o.CanonicalName
}
// GetCanonicalNameOk returns a tuple with the CanonicalName field value
// and a boolean to check if the value has been set.
func (o *EntityListItem) GetCanonicalNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CanonicalName, true
}
// SetCanonicalName sets field value
func (o *EntityListItem) SetCanonicalName(v string) {
o.CanonicalName = v
}
// GetMentionCount returns the MentionCount field value
func (o *EntityListItem) GetMentionCount() int32 {
if o == nil {
var ret int32
return ret
}
return o.MentionCount
}
// GetMentionCountOk returns a tuple with the MentionCount field value
// and a boolean to check if the value has been set.
func (o *EntityListItem) GetMentionCountOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.MentionCount, true
}
// SetMentionCount sets field value
func (o *EntityListItem) SetMentionCount(v int32) {
o.MentionCount = v
}
// GetFirstSeen returns the FirstSeen field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EntityListItem) GetFirstSeen() string {
if o == nil || IsNil(o.FirstSeen.Get()) {
var ret string
return ret
}
return *o.FirstSeen.Get()
}
// GetFirstSeenOk returns a tuple with the FirstSeen field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EntityListItem) GetFirstSeenOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.FirstSeen.Get(), o.FirstSeen.IsSet()
}
// HasFirstSeen returns a boolean if a field has been set.
func (o *EntityListItem) HasFirstSeen() bool {
if o != nil && o.FirstSeen.IsSet() {
return true
}
return false
}
// SetFirstSeen gets a reference to the given NullableString and assigns it to the FirstSeen field.
func (o *EntityListItem) SetFirstSeen(v string) {
o.FirstSeen.Set(&v)
}
// SetFirstSeenNil sets the value for FirstSeen to be an explicit nil
func (o *EntityListItem) SetFirstSeenNil() {
o.FirstSeen.Set(nil)
}
// UnsetFirstSeen ensures that no value is present for FirstSeen, not even an explicit nil
func (o *EntityListItem) UnsetFirstSeen() {
o.FirstSeen.Unset()
}
// GetLastSeen returns the LastSeen field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EntityListItem) GetLastSeen() string {
if o == nil || IsNil(o.LastSeen.Get()) {
var ret string
return ret
}
return *o.LastSeen.Get()
}
// GetLastSeenOk returns a tuple with the LastSeen field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EntityListItem) GetLastSeenOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.LastSeen.Get(), o.LastSeen.IsSet()
}
// HasLastSeen returns a boolean if a field has been set.
func (o *EntityListItem) HasLastSeen() bool {
if o != nil && o.LastSeen.IsSet() {
return true
}
return false
}
// SetLastSeen gets a reference to the given NullableString and assigns it to the LastSeen field.
func (o *EntityListItem) SetLastSeen(v string) {
o.LastSeen.Set(&v)
}
// SetLastSeenNil sets the value for LastSeen to be an explicit nil
func (o *EntityListItem) SetLastSeenNil() {
o.LastSeen.Set(nil)
}
// UnsetLastSeen ensures that no value is present for LastSeen, not even an explicit nil
func (o *EntityListItem) UnsetLastSeen() {
o.LastSeen.Unset()
}
// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EntityListItem) GetMetadata() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EntityListItem) GetMetadataOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Metadata) {
return map[string]interface{}{}, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *EntityListItem) HasMetadata() bool {
if o != nil && !IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field.
func (o *EntityListItem) SetMetadata(v map[string]interface{}) {
o.Metadata = v
}
func (o EntityListItem) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EntityListItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["canonical_name"] = o.CanonicalName
toSerialize["mention_count"] = o.MentionCount
if o.FirstSeen.IsSet() {
toSerialize["first_seen"] = o.FirstSeen.Get()
}
if o.LastSeen.IsSet() {
toSerialize["last_seen"] = o.LastSeen.Get()
}
if o.Metadata != nil {
toSerialize["metadata"] = o.Metadata
}
return toSerialize, nil
}
func (o *EntityListItem) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"canonical_name",
"mention_count",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varEntityListItem := _EntityListItem{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varEntityListItem)
if err != nil {
return err
}
*o = EntityListItem(varEntityListItem)
return err
}
type NullableEntityListItem struct {
value *EntityListItem
isSet bool
}
func (v NullableEntityListItem) Get() *EntityListItem {
return v.value
}
func (v *NullableEntityListItem) Set(val *EntityListItem) {
v.value = val
v.isSet = true
}
func (v NullableEntityListItem) IsSet() bool {
return v.isSet
}
func (v *NullableEntityListItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEntityListItem(val *EntityListItem) *NullableEntityListItem {
return &NullableEntityListItem{value: val, isSet: true}
}
func (v NullableEntityListItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEntityListItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,242 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the EntityListResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EntityListResponse{}
// EntityListResponse Response model for entity list endpoint.
type EntityListResponse struct {
Items []EntityListItem `json:"items"`
Total int32 `json:"total"`
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
}
type _EntityListResponse EntityListResponse
// NewEntityListResponse instantiates a new EntityListResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewEntityListResponse(items []EntityListItem, total int32, limit int32, offset int32) *EntityListResponse {
this := EntityListResponse{}
this.Items = items
this.Total = total
this.Limit = limit
this.Offset = offset
return &this
}
// NewEntityListResponseWithDefaults instantiates a new EntityListResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEntityListResponseWithDefaults() *EntityListResponse {
this := EntityListResponse{}
return &this
}
// GetItems returns the Items field value
func (o *EntityListResponse) GetItems() []EntityListItem {
if o == nil {
var ret []EntityListItem
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *EntityListResponse) GetItemsOk() ([]EntityListItem, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *EntityListResponse) SetItems(v []EntityListItem) {
o.Items = v
}
// GetTotal returns the Total field value
func (o *EntityListResponse) GetTotal() int32 {
if o == nil {
var ret int32
return ret
}
return o.Total
}
// GetTotalOk returns a tuple with the Total field value
// and a boolean to check if the value has been set.
func (o *EntityListResponse) GetTotalOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Total, true
}
// SetTotal sets field value
func (o *EntityListResponse) SetTotal(v int32) {
o.Total = v
}
// GetLimit returns the Limit field value
func (o *EntityListResponse) GetLimit() int32 {
if o == nil {
var ret int32
return ret
}
return o.Limit
}
// GetLimitOk returns a tuple with the Limit field value
// and a boolean to check if the value has been set.
func (o *EntityListResponse) GetLimitOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Limit, true
}
// SetLimit sets field value
func (o *EntityListResponse) SetLimit(v int32) {
o.Limit = v
}
// GetOffset returns the Offset field value
func (o *EntityListResponse) GetOffset() int32 {
if o == nil {
var ret int32
return ret
}
return o.Offset
}
// GetOffsetOk returns a tuple with the Offset field value
// and a boolean to check if the value has been set.
func (o *EntityListResponse) GetOffsetOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Offset, true
}
// SetOffset sets field value
func (o *EntityListResponse) SetOffset(v int32) {
o.Offset = v
}
func (o EntityListResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EntityListResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["items"] = o.Items
toSerialize["total"] = o.Total
toSerialize["limit"] = o.Limit
toSerialize["offset"] = o.Offset
return toSerialize, nil
}
func (o *EntityListResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"items",
"total",
"limit",
"offset",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varEntityListResponse := _EntityListResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varEntityListResponse)
if err != nil {
return err
}
*o = EntityListResponse(varEntityListResponse)
return err
}
type NullableEntityListResponse struct {
value *EntityListResponse
isSet bool
}
func (v NullableEntityListResponse) Get() *EntityListResponse {
return v.value
}
func (v *NullableEntityListResponse) Set(val *EntityListResponse) {
v.value = val
v.isSet = true
}
func (v NullableEntityListResponse) IsSet() bool {
return v.isSet
}
func (v *NullableEntityListResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEntityListResponse(val *EntityListResponse) *NullableEntityListResponse {
return &NullableEntityListResponse{value: val, isSet: true}
}
func (v NullableEntityListResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEntityListResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,204 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the EntityObservationResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EntityObservationResponse{}
// EntityObservationResponse An observation about an entity.
type EntityObservationResponse struct {
Text string `json:"text"`
MentionedAt NullableString `json:"mentioned_at,omitempty"`
}
type _EntityObservationResponse EntityObservationResponse
// NewEntityObservationResponse instantiates a new EntityObservationResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewEntityObservationResponse(text string) *EntityObservationResponse {
this := EntityObservationResponse{}
this.Text = text
return &this
}
// NewEntityObservationResponseWithDefaults instantiates a new EntityObservationResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEntityObservationResponseWithDefaults() *EntityObservationResponse {
this := EntityObservationResponse{}
return &this
}
// GetText returns the Text field value
func (o *EntityObservationResponse) GetText() string {
if o == nil {
var ret string
return ret
}
return o.Text
}
// GetTextOk returns a tuple with the Text field value
// and a boolean to check if the value has been set.
func (o *EntityObservationResponse) GetTextOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Text, true
}
// SetText sets field value
func (o *EntityObservationResponse) SetText(v string) {
o.Text = v
}
// GetMentionedAt returns the MentionedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EntityObservationResponse) GetMentionedAt() string {
if o == nil || IsNil(o.MentionedAt.Get()) {
var ret string
return ret
}
return *o.MentionedAt.Get()
}
// GetMentionedAtOk returns a tuple with the MentionedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EntityObservationResponse) GetMentionedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.MentionedAt.Get(), o.MentionedAt.IsSet()
}
// HasMentionedAt returns a boolean if a field has been set.
func (o *EntityObservationResponse) HasMentionedAt() bool {
if o != nil && o.MentionedAt.IsSet() {
return true
}
return false
}
// SetMentionedAt gets a reference to the given NullableString and assigns it to the MentionedAt field.
func (o *EntityObservationResponse) SetMentionedAt(v string) {
o.MentionedAt.Set(&v)
}
// SetMentionedAtNil sets the value for MentionedAt to be an explicit nil
func (o *EntityObservationResponse) SetMentionedAtNil() {
o.MentionedAt.Set(nil)
}
// UnsetMentionedAt ensures that no value is present for MentionedAt, not even an explicit nil
func (o *EntityObservationResponse) UnsetMentionedAt() {
o.MentionedAt.Unset()
}
func (o EntityObservationResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EntityObservationResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["text"] = o.Text
if o.MentionedAt.IsSet() {
toSerialize["mentioned_at"] = o.MentionedAt.Get()
}
return toSerialize, nil
}
func (o *EntityObservationResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"text",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varEntityObservationResponse := _EntityObservationResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varEntityObservationResponse)
if err != nil {
return err
}
*o = EntityObservationResponse(varEntityObservationResponse)
return err
}
type NullableEntityObservationResponse struct {
value *EntityObservationResponse
isSet bool
}
func (v NullableEntityObservationResponse) Get() *EntityObservationResponse {
return v.value
}
func (v *NullableEntityObservationResponse) Set(val *EntityObservationResponse) {
v.value = val
v.isSet = true
}
func (v NullableEntityObservationResponse) IsSet() bool {
return v.isSet
}
func (v *NullableEntityObservationResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEntityObservationResponse(val *EntityObservationResponse) *NullableEntityObservationResponse {
return &NullableEntityObservationResponse{value: val, isSet: true}
}
func (v NullableEntityObservationResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEntityObservationResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,214 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the EntityStateResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EntityStateResponse{}
// EntityStateResponse Current mental model of an entity.
type EntityStateResponse struct {
EntityId string `json:"entity_id"`
CanonicalName string `json:"canonical_name"`
Observations []EntityObservationResponse `json:"observations"`
}
type _EntityStateResponse EntityStateResponse
// NewEntityStateResponse instantiates a new EntityStateResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewEntityStateResponse(entityId string, canonicalName string, observations []EntityObservationResponse) *EntityStateResponse {
this := EntityStateResponse{}
this.EntityId = entityId
this.CanonicalName = canonicalName
this.Observations = observations
return &this
}
// NewEntityStateResponseWithDefaults instantiates a new EntityStateResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewEntityStateResponseWithDefaults() *EntityStateResponse {
this := EntityStateResponse{}
return &this
}
// GetEntityId returns the EntityId field value
func (o *EntityStateResponse) GetEntityId() string {
if o == nil {
var ret string
return ret
}
return o.EntityId
}
// GetEntityIdOk returns a tuple with the EntityId field value
// and a boolean to check if the value has been set.
func (o *EntityStateResponse) GetEntityIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.EntityId, true
}
// SetEntityId sets field value
func (o *EntityStateResponse) SetEntityId(v string) {
o.EntityId = v
}
// GetCanonicalName returns the CanonicalName field value
func (o *EntityStateResponse) GetCanonicalName() string {
if o == nil {
var ret string
return ret
}
return o.CanonicalName
}
// GetCanonicalNameOk returns a tuple with the CanonicalName field value
// and a boolean to check if the value has been set.
func (o *EntityStateResponse) GetCanonicalNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CanonicalName, true
}
// SetCanonicalName sets field value
func (o *EntityStateResponse) SetCanonicalName(v string) {
o.CanonicalName = v
}
// GetObservations returns the Observations field value
func (o *EntityStateResponse) GetObservations() []EntityObservationResponse {
if o == nil {
var ret []EntityObservationResponse
return ret
}
return o.Observations
}
// GetObservationsOk returns a tuple with the Observations field value
// and a boolean to check if the value has been set.
func (o *EntityStateResponse) GetObservationsOk() ([]EntityObservationResponse, bool) {
if o == nil {
return nil, false
}
return o.Observations, true
}
// SetObservations sets field value
func (o *EntityStateResponse) SetObservations(v []EntityObservationResponse) {
o.Observations = v
}
func (o EntityStateResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EntityStateResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["entity_id"] = o.EntityId
toSerialize["canonical_name"] = o.CanonicalName
toSerialize["observations"] = o.Observations
return toSerialize, nil
}
func (o *EntityStateResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"entity_id",
"canonical_name",
"observations",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varEntityStateResponse := _EntityStateResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varEntityStateResponse)
if err != nil {
return err
}
*o = EntityStateResponse(varEntityStateResponse)
return err
}
type NullableEntityStateResponse struct {
value *EntityStateResponse
isSet bool
}
func (v NullableEntityStateResponse) Get() *EntityStateResponse {
return v.value
}
func (v *NullableEntityStateResponse) Set(val *EntityStateResponse) {
v.value = val
v.isSet = true
}
func (v NullableEntityStateResponse) IsSet() bool {
return v.isSet
}
func (v *NullableEntityStateResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEntityStateResponse(val *EntityStateResponse) *NullableEntityStateResponse {
return &NullableEntityStateResponse{value: val, isSet: true}
}
func (v NullableEntityStateResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEntityStateResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,246 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the FeaturesInfo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FeaturesInfo{}
// FeaturesInfo Feature flags indicating which capabilities are enabled.
type FeaturesInfo struct {
// Whether observations (auto-consolidation) are enabled
Observations bool `json:"observations"`
// Whether MCP (Model Context Protocol) server is enabled
Mcp bool `json:"mcp"`
// Whether the background worker is enabled
Worker bool `json:"worker"`
// Whether per-bank configuration API is enabled
BankConfigApi bool `json:"bank_config_api"`
}
type _FeaturesInfo FeaturesInfo
// NewFeaturesInfo instantiates a new FeaturesInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewFeaturesInfo(observations bool, mcp bool, worker bool, bankConfigApi bool) *FeaturesInfo {
this := FeaturesInfo{}
this.Observations = observations
this.Mcp = mcp
this.Worker = worker
this.BankConfigApi = bankConfigApi
return &this
}
// NewFeaturesInfoWithDefaults instantiates a new FeaturesInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewFeaturesInfoWithDefaults() *FeaturesInfo {
this := FeaturesInfo{}
return &this
}
// GetObservations returns the Observations field value
func (o *FeaturesInfo) GetObservations() bool {
if o == nil {
var ret bool
return ret
}
return o.Observations
}
// GetObservationsOk returns a tuple with the Observations field value
// and a boolean to check if the value has been set.
func (o *FeaturesInfo) GetObservationsOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Observations, true
}
// SetObservations sets field value
func (o *FeaturesInfo) SetObservations(v bool) {
o.Observations = v
}
// GetMcp returns the Mcp field value
func (o *FeaturesInfo) GetMcp() bool {
if o == nil {
var ret bool
return ret
}
return o.Mcp
}
// GetMcpOk returns a tuple with the Mcp field value
// and a boolean to check if the value has been set.
func (o *FeaturesInfo) GetMcpOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Mcp, true
}
// SetMcp sets field value
func (o *FeaturesInfo) SetMcp(v bool) {
o.Mcp = v
}
// GetWorker returns the Worker field value
func (o *FeaturesInfo) GetWorker() bool {
if o == nil {
var ret bool
return ret
}
return o.Worker
}
// GetWorkerOk returns a tuple with the Worker field value
// and a boolean to check if the value has been set.
func (o *FeaturesInfo) GetWorkerOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Worker, true
}
// SetWorker sets field value
func (o *FeaturesInfo) SetWorker(v bool) {
o.Worker = v
}
// GetBankConfigApi returns the BankConfigApi field value
func (o *FeaturesInfo) GetBankConfigApi() bool {
if o == nil {
var ret bool
return ret
}
return o.BankConfigApi
}
// GetBankConfigApiOk returns a tuple with the BankConfigApi field value
// and a boolean to check if the value has been set.
func (o *FeaturesInfo) GetBankConfigApiOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.BankConfigApi, true
}
// SetBankConfigApi sets field value
func (o *FeaturesInfo) SetBankConfigApi(v bool) {
o.BankConfigApi = v
}
func (o FeaturesInfo) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FeaturesInfo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["observations"] = o.Observations
toSerialize["mcp"] = o.Mcp
toSerialize["worker"] = o.Worker
toSerialize["bank_config_api"] = o.BankConfigApi
return toSerialize, nil
}
func (o *FeaturesInfo) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"observations",
"mcp",
"worker",
"bank_config_api",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varFeaturesInfo := _FeaturesInfo{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varFeaturesInfo)
if err != nil {
return err
}
*o = FeaturesInfo(varFeaturesInfo)
return err
}
type NullableFeaturesInfo struct {
value *FeaturesInfo
isSet bool
}
func (v NullableFeaturesInfo) Get() *FeaturesInfo {
return v.value
}
func (v *NullableFeaturesInfo) Set(val *FeaturesInfo) {
v.value = val
v.isSet = true
}
func (v NullableFeaturesInfo) IsSet() bool {
return v.isSet
}
func (v *NullableFeaturesInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFeaturesInfo(val *FeaturesInfo) *NullableFeaturesInfo {
return &NullableFeaturesInfo{value: val, isSet: true}
}
func (v NullableFeaturesInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFeaturesInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,270 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the GraphDataResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphDataResponse{}
// GraphDataResponse Response model for graph data endpoint.
type GraphDataResponse struct {
Nodes []map[string]interface{} `json:"nodes"`
Edges []map[string]interface{} `json:"edges"`
TableRows []map[string]interface{} `json:"table_rows"`
TotalUnits int32 `json:"total_units"`
Limit int32 `json:"limit"`
}
type _GraphDataResponse GraphDataResponse
// NewGraphDataResponse instantiates a new GraphDataResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewGraphDataResponse(nodes []map[string]interface{}, edges []map[string]interface{}, tableRows []map[string]interface{}, totalUnits int32, limit int32) *GraphDataResponse {
this := GraphDataResponse{}
this.Nodes = nodes
this.Edges = edges
this.TableRows = tableRows
this.TotalUnits = totalUnits
this.Limit = limit
return &this
}
// NewGraphDataResponseWithDefaults instantiates a new GraphDataResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewGraphDataResponseWithDefaults() *GraphDataResponse {
this := GraphDataResponse{}
return &this
}
// GetNodes returns the Nodes field value
func (o *GraphDataResponse) GetNodes() []map[string]interface{} {
if o == nil {
var ret []map[string]interface{}
return ret
}
return o.Nodes
}
// GetNodesOk returns a tuple with the Nodes field value
// and a boolean to check if the value has been set.
func (o *GraphDataResponse) GetNodesOk() ([]map[string]interface{}, bool) {
if o == nil {
return nil, false
}
return o.Nodes, true
}
// SetNodes sets field value
func (o *GraphDataResponse) SetNodes(v []map[string]interface{}) {
o.Nodes = v
}
// GetEdges returns the Edges field value
func (o *GraphDataResponse) GetEdges() []map[string]interface{} {
if o == nil {
var ret []map[string]interface{}
return ret
}
return o.Edges
}
// GetEdgesOk returns a tuple with the Edges field value
// and a boolean to check if the value has been set.
func (o *GraphDataResponse) GetEdgesOk() ([]map[string]interface{}, bool) {
if o == nil {
return nil, false
}
return o.Edges, true
}
// SetEdges sets field value
func (o *GraphDataResponse) SetEdges(v []map[string]interface{}) {
o.Edges = v
}
// GetTableRows returns the TableRows field value
func (o *GraphDataResponse) GetTableRows() []map[string]interface{} {
if o == nil {
var ret []map[string]interface{}
return ret
}
return o.TableRows
}
// GetTableRowsOk returns a tuple with the TableRows field value
// and a boolean to check if the value has been set.
func (o *GraphDataResponse) GetTableRowsOk() ([]map[string]interface{}, bool) {
if o == nil {
return nil, false
}
return o.TableRows, true
}
// SetTableRows sets field value
func (o *GraphDataResponse) SetTableRows(v []map[string]interface{}) {
o.TableRows = v
}
// GetTotalUnits returns the TotalUnits field value
func (o *GraphDataResponse) GetTotalUnits() int32 {
if o == nil {
var ret int32
return ret
}
return o.TotalUnits
}
// GetTotalUnitsOk returns a tuple with the TotalUnits field value
// and a boolean to check if the value has been set.
func (o *GraphDataResponse) GetTotalUnitsOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.TotalUnits, true
}
// SetTotalUnits sets field value
func (o *GraphDataResponse) SetTotalUnits(v int32) {
o.TotalUnits = v
}
// GetLimit returns the Limit field value
func (o *GraphDataResponse) GetLimit() int32 {
if o == nil {
var ret int32
return ret
}
return o.Limit
}
// GetLimitOk returns a tuple with the Limit field value
// and a boolean to check if the value has been set.
func (o *GraphDataResponse) GetLimitOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Limit, true
}
// SetLimit sets field value
func (o *GraphDataResponse) SetLimit(v int32) {
o.Limit = v
}
func (o GraphDataResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphDataResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["nodes"] = o.Nodes
toSerialize["edges"] = o.Edges
toSerialize["table_rows"] = o.TableRows
toSerialize["total_units"] = o.TotalUnits
toSerialize["limit"] = o.Limit
return toSerialize, nil
}
func (o *GraphDataResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"nodes",
"edges",
"table_rows",
"total_units",
"limit",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varGraphDataResponse := _GraphDataResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varGraphDataResponse)
if err != nil {
return err
}
*o = GraphDataResponse(varGraphDataResponse)
return err
}
type NullableGraphDataResponse struct {
value *GraphDataResponse
isSet bool
}
func (v NullableGraphDataResponse) Get() *GraphDataResponse {
return v.value
}
func (v *NullableGraphDataResponse) Set(val *GraphDataResponse) {
v.value = val
v.isSet = true
}
func (v NullableGraphDataResponse) IsSet() bool {
return v.isSet
}
func (v *NullableGraphDataResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphDataResponse(val *GraphDataResponse) *NullableGraphDataResponse {
return &NullableGraphDataResponse{value: val, isSet: true}
}
func (v NullableGraphDataResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphDataResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,126 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the HTTPValidationError type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &HTTPValidationError{}
// HTTPValidationError struct for HTTPValidationError
type HTTPValidationError struct {
Detail []ValidationError `json:"detail,omitempty"`
}
// NewHTTPValidationError instantiates a new HTTPValidationError object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewHTTPValidationError() *HTTPValidationError {
this := HTTPValidationError{}
return &this
}
// NewHTTPValidationErrorWithDefaults instantiates a new HTTPValidationError object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewHTTPValidationErrorWithDefaults() *HTTPValidationError {
this := HTTPValidationError{}
return &this
}
// GetDetail returns the Detail field value if set, zero value otherwise.
func (o *HTTPValidationError) GetDetail() []ValidationError {
if o == nil || IsNil(o.Detail) {
var ret []ValidationError
return ret
}
return o.Detail
}
// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HTTPValidationError) GetDetailOk() ([]ValidationError, bool) {
if o == nil || IsNil(o.Detail) {
return nil, false
}
return o.Detail, true
}
// HasDetail returns a boolean if a field has been set.
func (o *HTTPValidationError) HasDetail() bool {
if o != nil && !IsNil(o.Detail) {
return true
}
return false
}
// SetDetail gets a reference to the given []ValidationError and assigns it to the Detail field.
func (o *HTTPValidationError) SetDetail(v []ValidationError) {
o.Detail = v
}
func (o HTTPValidationError) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o HTTPValidationError) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Detail) {
toSerialize["detail"] = o.Detail
}
return toSerialize, nil
}
type NullableHTTPValidationError struct {
value *HTTPValidationError
isSet bool
}
func (v NullableHTTPValidationError) Get() *HTTPValidationError {
return v.value
}
func (v *NullableHTTPValidationError) Set(val *HTTPValidationError) {
v.value = val
v.isSet = true
}
func (v NullableHTTPValidationError) IsSet() bool {
return v.isSet
}
func (v *NullableHTTPValidationError) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableHTTPValidationError(val *HTTPValidationError) *NullableHTTPValidationError {
return &NullableHTTPValidationError{value: val, isSet: true}
}
func (v NullableHTTPValidationError) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableHTTPValidationError) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,182 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the IncludeOptions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IncludeOptions{}
// IncludeOptions Options for including additional data in recall results.
type IncludeOptions struct {
Entities NullableEntityIncludeOptions `json:"entities,omitempty"`
Chunks NullableChunkIncludeOptions `json:"chunks,omitempty"`
}
// NewIncludeOptions instantiates a new IncludeOptions object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewIncludeOptions() *IncludeOptions {
this := IncludeOptions{}
return &this
}
// NewIncludeOptionsWithDefaults instantiates a new IncludeOptions object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewIncludeOptionsWithDefaults() *IncludeOptions {
this := IncludeOptions{}
return &this
}
// GetEntities returns the Entities field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *IncludeOptions) GetEntities() EntityIncludeOptions {
if o == nil || IsNil(o.Entities.Get()) {
var ret EntityIncludeOptions
return ret
}
return *o.Entities.Get()
}
// GetEntitiesOk returns a tuple with the Entities field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *IncludeOptions) GetEntitiesOk() (*EntityIncludeOptions, bool) {
if o == nil {
return nil, false
}
return o.Entities.Get(), o.Entities.IsSet()
}
// HasEntities returns a boolean if a field has been set.
func (o *IncludeOptions) HasEntities() bool {
if o != nil && o.Entities.IsSet() {
return true
}
return false
}
// SetEntities gets a reference to the given NullableEntityIncludeOptions and assigns it to the Entities field.
func (o *IncludeOptions) SetEntities(v EntityIncludeOptions) {
o.Entities.Set(&v)
}
// SetEntitiesNil sets the value for Entities to be an explicit nil
func (o *IncludeOptions) SetEntitiesNil() {
o.Entities.Set(nil)
}
// UnsetEntities ensures that no value is present for Entities, not even an explicit nil
func (o *IncludeOptions) UnsetEntities() {
o.Entities.Unset()
}
// GetChunks returns the Chunks field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *IncludeOptions) GetChunks() ChunkIncludeOptions {
if o == nil || IsNil(o.Chunks.Get()) {
var ret ChunkIncludeOptions
return ret
}
return *o.Chunks.Get()
}
// GetChunksOk returns a tuple with the Chunks field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *IncludeOptions) GetChunksOk() (*ChunkIncludeOptions, bool) {
if o == nil {
return nil, false
}
return o.Chunks.Get(), o.Chunks.IsSet()
}
// HasChunks returns a boolean if a field has been set.
func (o *IncludeOptions) HasChunks() bool {
if o != nil && o.Chunks.IsSet() {
return true
}
return false
}
// SetChunks gets a reference to the given NullableChunkIncludeOptions and assigns it to the Chunks field.
func (o *IncludeOptions) SetChunks(v ChunkIncludeOptions) {
o.Chunks.Set(&v)
}
// SetChunksNil sets the value for Chunks to be an explicit nil
func (o *IncludeOptions) SetChunksNil() {
o.Chunks.Set(nil)
}
// UnsetChunks ensures that no value is present for Chunks, not even an explicit nil
func (o *IncludeOptions) UnsetChunks() {
o.Chunks.Unset()
}
func (o IncludeOptions) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IncludeOptions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Entities.IsSet() {
toSerialize["entities"] = o.Entities.Get()
}
if o.Chunks.IsSet() {
toSerialize["chunks"] = o.Chunks.Get()
}
return toSerialize, nil
}
type NullableIncludeOptions struct {
value *IncludeOptions
isSet bool
}
func (v NullableIncludeOptions) Get() *IncludeOptions {
return v.value
}
func (v *NullableIncludeOptions) Set(val *IncludeOptions) {
v.value = val
v.isSet = true
}
func (v NullableIncludeOptions) IsSet() bool {
return v.isSet
}
func (v *NullableIncludeOptions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIncludeOptions(val *IncludeOptions) *NullableIncludeOptions {
return &NullableIncludeOptions{value: val, isSet: true}
}
func (v NullableIncludeOptions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIncludeOptions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,242 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ListDocumentsResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ListDocumentsResponse{}
// ListDocumentsResponse Response model for list documents endpoint.
type ListDocumentsResponse struct {
Items []map[string]interface{} `json:"items"`
Total int32 `json:"total"`
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
}
type _ListDocumentsResponse ListDocumentsResponse
// NewListDocumentsResponse instantiates a new ListDocumentsResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewListDocumentsResponse(items []map[string]interface{}, total int32, limit int32, offset int32) *ListDocumentsResponse {
this := ListDocumentsResponse{}
this.Items = items
this.Total = total
this.Limit = limit
this.Offset = offset
return &this
}
// NewListDocumentsResponseWithDefaults instantiates a new ListDocumentsResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewListDocumentsResponseWithDefaults() *ListDocumentsResponse {
this := ListDocumentsResponse{}
return &this
}
// GetItems returns the Items field value
func (o *ListDocumentsResponse) GetItems() []map[string]interface{} {
if o == nil {
var ret []map[string]interface{}
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ListDocumentsResponse) GetItemsOk() ([]map[string]interface{}, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ListDocumentsResponse) SetItems(v []map[string]interface{}) {
o.Items = v
}
// GetTotal returns the Total field value
func (o *ListDocumentsResponse) GetTotal() int32 {
if o == nil {
var ret int32
return ret
}
return o.Total
}
// GetTotalOk returns a tuple with the Total field value
// and a boolean to check if the value has been set.
func (o *ListDocumentsResponse) GetTotalOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Total, true
}
// SetTotal sets field value
func (o *ListDocumentsResponse) SetTotal(v int32) {
o.Total = v
}
// GetLimit returns the Limit field value
func (o *ListDocumentsResponse) GetLimit() int32 {
if o == nil {
var ret int32
return ret
}
return o.Limit
}
// GetLimitOk returns a tuple with the Limit field value
// and a boolean to check if the value has been set.
func (o *ListDocumentsResponse) GetLimitOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Limit, true
}
// SetLimit sets field value
func (o *ListDocumentsResponse) SetLimit(v int32) {
o.Limit = v
}
// GetOffset returns the Offset field value
func (o *ListDocumentsResponse) GetOffset() int32 {
if o == nil {
var ret int32
return ret
}
return o.Offset
}
// GetOffsetOk returns a tuple with the Offset field value
// and a boolean to check if the value has been set.
func (o *ListDocumentsResponse) GetOffsetOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Offset, true
}
// SetOffset sets field value
func (o *ListDocumentsResponse) SetOffset(v int32) {
o.Offset = v
}
func (o ListDocumentsResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ListDocumentsResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["items"] = o.Items
toSerialize["total"] = o.Total
toSerialize["limit"] = o.Limit
toSerialize["offset"] = o.Offset
return toSerialize, nil
}
func (o *ListDocumentsResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"items",
"total",
"limit",
"offset",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varListDocumentsResponse := _ListDocumentsResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varListDocumentsResponse)
if err != nil {
return err
}
*o = ListDocumentsResponse(varListDocumentsResponse)
return err
}
type NullableListDocumentsResponse struct {
value *ListDocumentsResponse
isSet bool
}
func (v NullableListDocumentsResponse) Get() *ListDocumentsResponse {
return v.value
}
func (v *NullableListDocumentsResponse) Set(val *ListDocumentsResponse) {
v.value = val
v.isSet = true
}
func (v NullableListDocumentsResponse) IsSet() bool {
return v.isSet
}
func (v *NullableListDocumentsResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableListDocumentsResponse(val *ListDocumentsResponse) *NullableListDocumentsResponse {
return &NullableListDocumentsResponse{value: val, isSet: true}
}
func (v NullableListDocumentsResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableListDocumentsResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,242 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ListMemoryUnitsResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ListMemoryUnitsResponse{}
// ListMemoryUnitsResponse Response model for list memory units endpoint.
type ListMemoryUnitsResponse struct {
Items []map[string]interface{} `json:"items"`
Total int32 `json:"total"`
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
}
type _ListMemoryUnitsResponse ListMemoryUnitsResponse
// NewListMemoryUnitsResponse instantiates a new ListMemoryUnitsResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewListMemoryUnitsResponse(items []map[string]interface{}, total int32, limit int32, offset int32) *ListMemoryUnitsResponse {
this := ListMemoryUnitsResponse{}
this.Items = items
this.Total = total
this.Limit = limit
this.Offset = offset
return &this
}
// NewListMemoryUnitsResponseWithDefaults instantiates a new ListMemoryUnitsResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewListMemoryUnitsResponseWithDefaults() *ListMemoryUnitsResponse {
this := ListMemoryUnitsResponse{}
return &this
}
// GetItems returns the Items field value
func (o *ListMemoryUnitsResponse) GetItems() []map[string]interface{} {
if o == nil {
var ret []map[string]interface{}
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ListMemoryUnitsResponse) GetItemsOk() ([]map[string]interface{}, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ListMemoryUnitsResponse) SetItems(v []map[string]interface{}) {
o.Items = v
}
// GetTotal returns the Total field value
func (o *ListMemoryUnitsResponse) GetTotal() int32 {
if o == nil {
var ret int32
return ret
}
return o.Total
}
// GetTotalOk returns a tuple with the Total field value
// and a boolean to check if the value has been set.
func (o *ListMemoryUnitsResponse) GetTotalOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Total, true
}
// SetTotal sets field value
func (o *ListMemoryUnitsResponse) SetTotal(v int32) {
o.Total = v
}
// GetLimit returns the Limit field value
func (o *ListMemoryUnitsResponse) GetLimit() int32 {
if o == nil {
var ret int32
return ret
}
return o.Limit
}
// GetLimitOk returns a tuple with the Limit field value
// and a boolean to check if the value has been set.
func (o *ListMemoryUnitsResponse) GetLimitOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Limit, true
}
// SetLimit sets field value
func (o *ListMemoryUnitsResponse) SetLimit(v int32) {
o.Limit = v
}
// GetOffset returns the Offset field value
func (o *ListMemoryUnitsResponse) GetOffset() int32 {
if o == nil {
var ret int32
return ret
}
return o.Offset
}
// GetOffsetOk returns a tuple with the Offset field value
// and a boolean to check if the value has been set.
func (o *ListMemoryUnitsResponse) GetOffsetOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Offset, true
}
// SetOffset sets field value
func (o *ListMemoryUnitsResponse) SetOffset(v int32) {
o.Offset = v
}
func (o ListMemoryUnitsResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ListMemoryUnitsResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["items"] = o.Items
toSerialize["total"] = o.Total
toSerialize["limit"] = o.Limit
toSerialize["offset"] = o.Offset
return toSerialize, nil
}
func (o *ListMemoryUnitsResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"items",
"total",
"limit",
"offset",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varListMemoryUnitsResponse := _ListMemoryUnitsResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varListMemoryUnitsResponse)
if err != nil {
return err
}
*o = ListMemoryUnitsResponse(varListMemoryUnitsResponse)
return err
}
type NullableListMemoryUnitsResponse struct {
value *ListMemoryUnitsResponse
isSet bool
}
func (v NullableListMemoryUnitsResponse) Get() *ListMemoryUnitsResponse {
return v.value
}
func (v *NullableListMemoryUnitsResponse) Set(val *ListMemoryUnitsResponse) {
v.value = val
v.isSet = true
}
func (v NullableListMemoryUnitsResponse) IsSet() bool {
return v.isSet
}
func (v *NullableListMemoryUnitsResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableListMemoryUnitsResponse(val *ListMemoryUnitsResponse) *NullableListMemoryUnitsResponse {
return &NullableListMemoryUnitsResponse{value: val, isSet: true}
}
func (v NullableListMemoryUnitsResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableListMemoryUnitsResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,242 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ListTagsResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ListTagsResponse{}
// ListTagsResponse Response model for list tags endpoint.
type ListTagsResponse struct {
Items []TagItem `json:"items"`
Total int32 `json:"total"`
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
}
type _ListTagsResponse ListTagsResponse
// NewListTagsResponse instantiates a new ListTagsResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewListTagsResponse(items []TagItem, total int32, limit int32, offset int32) *ListTagsResponse {
this := ListTagsResponse{}
this.Items = items
this.Total = total
this.Limit = limit
this.Offset = offset
return &this
}
// NewListTagsResponseWithDefaults instantiates a new ListTagsResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewListTagsResponseWithDefaults() *ListTagsResponse {
this := ListTagsResponse{}
return &this
}
// GetItems returns the Items field value
func (o *ListTagsResponse) GetItems() []TagItem {
if o == nil {
var ret []TagItem
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *ListTagsResponse) GetItemsOk() ([]TagItem, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *ListTagsResponse) SetItems(v []TagItem) {
o.Items = v
}
// GetTotal returns the Total field value
func (o *ListTagsResponse) GetTotal() int32 {
if o == nil {
var ret int32
return ret
}
return o.Total
}
// GetTotalOk returns a tuple with the Total field value
// and a boolean to check if the value has been set.
func (o *ListTagsResponse) GetTotalOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Total, true
}
// SetTotal sets field value
func (o *ListTagsResponse) SetTotal(v int32) {
o.Total = v
}
// GetLimit returns the Limit field value
func (o *ListTagsResponse) GetLimit() int32 {
if o == nil {
var ret int32
return ret
}
return o.Limit
}
// GetLimitOk returns a tuple with the Limit field value
// and a boolean to check if the value has been set.
func (o *ListTagsResponse) GetLimitOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Limit, true
}
// SetLimit sets field value
func (o *ListTagsResponse) SetLimit(v int32) {
o.Limit = v
}
// GetOffset returns the Offset field value
func (o *ListTagsResponse) GetOffset() int32 {
if o == nil {
var ret int32
return ret
}
return o.Offset
}
// GetOffsetOk returns a tuple with the Offset field value
// and a boolean to check if the value has been set.
func (o *ListTagsResponse) GetOffsetOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Offset, true
}
// SetOffset sets field value
func (o *ListTagsResponse) SetOffset(v int32) {
o.Offset = v
}
func (o ListTagsResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ListTagsResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["items"] = o.Items
toSerialize["total"] = o.Total
toSerialize["limit"] = o.Limit
toSerialize["offset"] = o.Offset
return toSerialize, nil
}
func (o *ListTagsResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"items",
"total",
"limit",
"offset",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varListTagsResponse := _ListTagsResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varListTagsResponse)
if err != nil {
return err
}
*o = ListTagsResponse(varListTagsResponse)
return err
}
type NullableListTagsResponse struct {
value *ListTagsResponse
isSet bool
}
func (v NullableListTagsResponse) Get() *ListTagsResponse {
return v.value
}
func (v *NullableListTagsResponse) Set(val *ListTagsResponse) {
v.value = val
v.isSet = true
}
func (v NullableListTagsResponse) IsSet() bool {
return v.isSet
}
func (v *NullableListTagsResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableListTagsResponse(val *ListTagsResponse) *NullableListTagsResponse {
return &NullableListTagsResponse{value: val, isSet: true}
}
func (v NullableListTagsResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableListTagsResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,408 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"time"
"bytes"
"fmt"
)
// checks if the MemoryItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MemoryItem{}
// MemoryItem Single memory item for retain.
type MemoryItem struct {
Content string `json:"content"`
Timestamp NullableTime `json:"timestamp,omitempty"`
Context NullableString `json:"context,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
DocumentId NullableString `json:"document_id,omitempty"`
Entities []EntityInput `json:"entities,omitempty"`
Tags []string `json:"tags,omitempty"`
}
type _MemoryItem MemoryItem
// NewMemoryItem instantiates a new MemoryItem object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewMemoryItem(content string) *MemoryItem {
this := MemoryItem{}
this.Content = content
return &this
}
// NewMemoryItemWithDefaults instantiates a new MemoryItem object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewMemoryItemWithDefaults() *MemoryItem {
this := MemoryItem{}
return &this
}
// GetContent returns the Content field value
func (o *MemoryItem) GetContent() string {
if o == nil {
var ret string
return ret
}
return o.Content
}
// GetContentOk returns a tuple with the Content field value
// and a boolean to check if the value has been set.
func (o *MemoryItem) GetContentOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Content, true
}
// SetContent sets field value
func (o *MemoryItem) SetContent(v string) {
o.Content = v
}
// GetTimestamp returns the Timestamp field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MemoryItem) GetTimestamp() time.Time {
if o == nil || IsNil(o.Timestamp.Get()) {
var ret time.Time
return ret
}
return *o.Timestamp.Get()
}
// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MemoryItem) GetTimestampOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.Timestamp.Get(), o.Timestamp.IsSet()
}
// HasTimestamp returns a boolean if a field has been set.
func (o *MemoryItem) HasTimestamp() bool {
if o != nil && o.Timestamp.IsSet() {
return true
}
return false
}
// SetTimestamp gets a reference to the given NullableTime and assigns it to the Timestamp field.
func (o *MemoryItem) SetTimestamp(v time.Time) {
o.Timestamp.Set(&v)
}
// SetTimestampNil sets the value for Timestamp to be an explicit nil
func (o *MemoryItem) SetTimestampNil() {
o.Timestamp.Set(nil)
}
// UnsetTimestamp ensures that no value is present for Timestamp, not even an explicit nil
func (o *MemoryItem) UnsetTimestamp() {
o.Timestamp.Unset()
}
// GetContext returns the Context field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MemoryItem) GetContext() string {
if o == nil || IsNil(o.Context.Get()) {
var ret string
return ret
}
return *o.Context.Get()
}
// GetContextOk returns a tuple with the Context field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MemoryItem) GetContextOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Context.Get(), o.Context.IsSet()
}
// HasContext returns a boolean if a field has been set.
func (o *MemoryItem) HasContext() bool {
if o != nil && o.Context.IsSet() {
return true
}
return false
}
// SetContext gets a reference to the given NullableString and assigns it to the Context field.
func (o *MemoryItem) SetContext(v string) {
o.Context.Set(&v)
}
// SetContextNil sets the value for Context to be an explicit nil
func (o *MemoryItem) SetContextNil() {
o.Context.Set(nil)
}
// UnsetContext ensures that no value is present for Context, not even an explicit nil
func (o *MemoryItem) UnsetContext() {
o.Context.Unset()
}
// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MemoryItem) GetMetadata() map[string]string {
if o == nil {
var ret map[string]string
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MemoryItem) GetMetadataOk() (map[string]string, bool) {
if o == nil || IsNil(o.Metadata) {
return map[string]string{}, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *MemoryItem) HasMetadata() bool {
if o != nil && !IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field.
func (o *MemoryItem) SetMetadata(v map[string]string) {
o.Metadata = v
}
// GetDocumentId returns the DocumentId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MemoryItem) GetDocumentId() string {
if o == nil || IsNil(o.DocumentId.Get()) {
var ret string
return ret
}
return *o.DocumentId.Get()
}
// GetDocumentIdOk returns a tuple with the DocumentId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MemoryItem) GetDocumentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.DocumentId.Get(), o.DocumentId.IsSet()
}
// HasDocumentId returns a boolean if a field has been set.
func (o *MemoryItem) HasDocumentId() bool {
if o != nil && o.DocumentId.IsSet() {
return true
}
return false
}
// SetDocumentId gets a reference to the given NullableString and assigns it to the DocumentId field.
func (o *MemoryItem) SetDocumentId(v string) {
o.DocumentId.Set(&v)
}
// SetDocumentIdNil sets the value for DocumentId to be an explicit nil
func (o *MemoryItem) SetDocumentIdNil() {
o.DocumentId.Set(nil)
}
// UnsetDocumentId ensures that no value is present for DocumentId, not even an explicit nil
func (o *MemoryItem) UnsetDocumentId() {
o.DocumentId.Unset()
}
// GetEntities returns the Entities field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MemoryItem) GetEntities() []EntityInput {
if o == nil {
var ret []EntityInput
return ret
}
return o.Entities
}
// GetEntitiesOk returns a tuple with the Entities field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MemoryItem) GetEntitiesOk() ([]EntityInput, bool) {
if o == nil || IsNil(o.Entities) {
return nil, false
}
return o.Entities, true
}
// HasEntities returns a boolean if a field has been set.
func (o *MemoryItem) HasEntities() bool {
if o != nil && !IsNil(o.Entities) {
return true
}
return false
}
// SetEntities gets a reference to the given []EntityInput and assigns it to the Entities field.
func (o *MemoryItem) SetEntities(v []EntityInput) {
o.Entities = v
}
// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MemoryItem) GetTags() []string {
if o == nil {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MemoryItem) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *MemoryItem) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *MemoryItem) SetTags(v []string) {
o.Tags = v
}
func (o MemoryItem) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MemoryItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["content"] = o.Content
if o.Timestamp.IsSet() {
toSerialize["timestamp"] = o.Timestamp.Get()
}
if o.Context.IsSet() {
toSerialize["context"] = o.Context.Get()
}
if o.Metadata != nil {
toSerialize["metadata"] = o.Metadata
}
if o.DocumentId.IsSet() {
toSerialize["document_id"] = o.DocumentId.Get()
}
if o.Entities != nil {
toSerialize["entities"] = o.Entities
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
return toSerialize, nil
}
func (o *MemoryItem) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"content",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varMemoryItem := _MemoryItem{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varMemoryItem)
if err != nil {
return err
}
*o = MemoryItem(varMemoryItem)
return err
}
type NullableMemoryItem struct {
value *MemoryItem
isSet bool
}
func (v NullableMemoryItem) Get() *MemoryItem {
return v.value
}
func (v *NullableMemoryItem) Set(val *MemoryItem) {
v.value = val
v.isSet = true
}
func (v NullableMemoryItem) IsSet() bool {
return v.isSet
}
func (v *NullableMemoryItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMemoryItem(val *MemoryItem) *NullableMemoryItem {
return &NullableMemoryItem{value: val, isSet: true}
}
func (v NullableMemoryItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMemoryItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,158 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the MentalModelListResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MentalModelListResponse{}
// MentalModelListResponse Response model for listing mental models.
type MentalModelListResponse struct {
Items []MentalModelResponse `json:"items"`
}
type _MentalModelListResponse MentalModelListResponse
// NewMentalModelListResponse instantiates a new MentalModelListResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewMentalModelListResponse(items []MentalModelResponse) *MentalModelListResponse {
this := MentalModelListResponse{}
this.Items = items
return &this
}
// NewMentalModelListResponseWithDefaults instantiates a new MentalModelListResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewMentalModelListResponseWithDefaults() *MentalModelListResponse {
this := MentalModelListResponse{}
return &this
}
// GetItems returns the Items field value
func (o *MentalModelListResponse) GetItems() []MentalModelResponse {
if o == nil {
var ret []MentalModelResponse
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *MentalModelListResponse) GetItemsOk() ([]MentalModelResponse, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *MentalModelListResponse) SetItems(v []MentalModelResponse) {
o.Items = v
}
func (o MentalModelListResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MentalModelListResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["items"] = o.Items
return toSerialize, nil
}
func (o *MentalModelListResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"items",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varMentalModelListResponse := _MentalModelListResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varMentalModelListResponse)
if err != nil {
return err
}
*o = MentalModelListResponse(varMentalModelListResponse)
return err
}
type NullableMentalModelListResponse struct {
value *MentalModelListResponse
isSet bool
}
func (v NullableMentalModelListResponse) Get() *MentalModelListResponse {
return v.value
}
func (v *NullableMentalModelListResponse) Set(val *MentalModelListResponse) {
v.value = val
v.isSet = true
}
func (v NullableMentalModelListResponse) IsSet() bool {
return v.isSet
}
func (v *NullableMentalModelListResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMentalModelListResponse(val *MentalModelListResponse) *NullableMentalModelListResponse {
return &NullableMentalModelListResponse{value: val, isSet: true}
}
func (v NullableMentalModelListResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMentalModelListResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,512 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the MentalModelResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MentalModelResponse{}
// MentalModelResponse Response model for a mental model (stored reflect response).
type MentalModelResponse struct {
Id string `json:"id"`
BankId string `json:"bank_id"`
Name string `json:"name"`
SourceQuery string `json:"source_query"`
// The mental model content as well-formatted markdown (auto-generated from reflect endpoint)
Content string `json:"content"`
Tags []string `json:"tags,omitempty"`
MaxTokens *int32 `json:"max_tokens,omitempty"`
Trigger *MentalModelTrigger `json:"trigger,omitempty"`
LastRefreshedAt NullableString `json:"last_refreshed_at,omitempty"`
CreatedAt NullableString `json:"created_at,omitempty"`
ReflectResponse map[string]interface{} `json:"reflect_response,omitempty"`
}
type _MentalModelResponse MentalModelResponse
// NewMentalModelResponse instantiates a new MentalModelResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewMentalModelResponse(id string, bankId string, name string, sourceQuery string, content string) *MentalModelResponse {
this := MentalModelResponse{}
this.Id = id
this.BankId = bankId
this.Name = name
this.SourceQuery = sourceQuery
this.Content = content
var maxTokens int32 = 2048
this.MaxTokens = &maxTokens
return &this
}
// NewMentalModelResponseWithDefaults instantiates a new MentalModelResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewMentalModelResponseWithDefaults() *MentalModelResponse {
this := MentalModelResponse{}
var maxTokens int32 = 2048
this.MaxTokens = &maxTokens
return &this
}
// GetId returns the Id field value
func (o *MentalModelResponse) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *MentalModelResponse) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *MentalModelResponse) SetId(v string) {
o.Id = v
}
// GetBankId returns the BankId field value
func (o *MentalModelResponse) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *MentalModelResponse) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *MentalModelResponse) SetBankId(v string) {
o.BankId = v
}
// GetName returns the Name field value
func (o *MentalModelResponse) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *MentalModelResponse) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *MentalModelResponse) SetName(v string) {
o.Name = v
}
// GetSourceQuery returns the SourceQuery field value
func (o *MentalModelResponse) GetSourceQuery() string {
if o == nil {
var ret string
return ret
}
return o.SourceQuery
}
// GetSourceQueryOk returns a tuple with the SourceQuery field value
// and a boolean to check if the value has been set.
func (o *MentalModelResponse) GetSourceQueryOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.SourceQuery, true
}
// SetSourceQuery sets field value
func (o *MentalModelResponse) SetSourceQuery(v string) {
o.SourceQuery = v
}
// GetContent returns the Content field value
func (o *MentalModelResponse) GetContent() string {
if o == nil {
var ret string
return ret
}
return o.Content
}
// GetContentOk returns a tuple with the Content field value
// and a boolean to check if the value has been set.
func (o *MentalModelResponse) GetContentOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Content, true
}
// SetContent sets field value
func (o *MentalModelResponse) SetContent(v string) {
o.Content = v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *MentalModelResponse) GetTags() []string {
if o == nil || IsNil(o.Tags) {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MentalModelResponse) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *MentalModelResponse) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *MentalModelResponse) SetTags(v []string) {
o.Tags = v
}
// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise.
func (o *MentalModelResponse) GetMaxTokens() int32 {
if o == nil || IsNil(o.MaxTokens) {
var ret int32
return ret
}
return *o.MaxTokens
}
// GetMaxTokensOk returns a tuple with the MaxTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MentalModelResponse) GetMaxTokensOk() (*int32, bool) {
if o == nil || IsNil(o.MaxTokens) {
return nil, false
}
return o.MaxTokens, true
}
// HasMaxTokens returns a boolean if a field has been set.
func (o *MentalModelResponse) HasMaxTokens() bool {
if o != nil && !IsNil(o.MaxTokens) {
return true
}
return false
}
// SetMaxTokens gets a reference to the given int32 and assigns it to the MaxTokens field.
func (o *MentalModelResponse) SetMaxTokens(v int32) {
o.MaxTokens = &v
}
// GetTrigger returns the Trigger field value if set, zero value otherwise.
func (o *MentalModelResponse) GetTrigger() MentalModelTrigger {
if o == nil || IsNil(o.Trigger) {
var ret MentalModelTrigger
return ret
}
return *o.Trigger
}
// GetTriggerOk returns a tuple with the Trigger field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MentalModelResponse) GetTriggerOk() (*MentalModelTrigger, bool) {
if o == nil || IsNil(o.Trigger) {
return nil, false
}
return o.Trigger, true
}
// HasTrigger returns a boolean if a field has been set.
func (o *MentalModelResponse) HasTrigger() bool {
if o != nil && !IsNil(o.Trigger) {
return true
}
return false
}
// SetTrigger gets a reference to the given MentalModelTrigger and assigns it to the Trigger field.
func (o *MentalModelResponse) SetTrigger(v MentalModelTrigger) {
o.Trigger = &v
}
// GetLastRefreshedAt returns the LastRefreshedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelResponse) GetLastRefreshedAt() string {
if o == nil || IsNil(o.LastRefreshedAt.Get()) {
var ret string
return ret
}
return *o.LastRefreshedAt.Get()
}
// GetLastRefreshedAtOk returns a tuple with the LastRefreshedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelResponse) GetLastRefreshedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.LastRefreshedAt.Get(), o.LastRefreshedAt.IsSet()
}
// HasLastRefreshedAt returns a boolean if a field has been set.
func (o *MentalModelResponse) HasLastRefreshedAt() bool {
if o != nil && o.LastRefreshedAt.IsSet() {
return true
}
return false
}
// SetLastRefreshedAt gets a reference to the given NullableString and assigns it to the LastRefreshedAt field.
func (o *MentalModelResponse) SetLastRefreshedAt(v string) {
o.LastRefreshedAt.Set(&v)
}
// SetLastRefreshedAtNil sets the value for LastRefreshedAt to be an explicit nil
func (o *MentalModelResponse) SetLastRefreshedAtNil() {
o.LastRefreshedAt.Set(nil)
}
// UnsetLastRefreshedAt ensures that no value is present for LastRefreshedAt, not even an explicit nil
func (o *MentalModelResponse) UnsetLastRefreshedAt() {
o.LastRefreshedAt.Unset()
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelResponse) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt.Get()) {
var ret string
return ret
}
return *o.CreatedAt.Get()
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelResponse) GetCreatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CreatedAt.Get(), o.CreatedAt.IsSet()
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *MentalModelResponse) HasCreatedAt() bool {
if o != nil && o.CreatedAt.IsSet() {
return true
}
return false
}
// SetCreatedAt gets a reference to the given NullableString and assigns it to the CreatedAt field.
func (o *MentalModelResponse) SetCreatedAt(v string) {
o.CreatedAt.Set(&v)
}
// SetCreatedAtNil sets the value for CreatedAt to be an explicit nil
func (o *MentalModelResponse) SetCreatedAtNil() {
o.CreatedAt.Set(nil)
}
// UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil
func (o *MentalModelResponse) UnsetCreatedAt() {
o.CreatedAt.Unset()
}
// GetReflectResponse returns the ReflectResponse field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MentalModelResponse) GetReflectResponse() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.ReflectResponse
}
// GetReflectResponseOk returns a tuple with the ReflectResponse field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MentalModelResponse) GetReflectResponseOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.ReflectResponse) {
return map[string]interface{}{}, false
}
return o.ReflectResponse, true
}
// HasReflectResponse returns a boolean if a field has been set.
func (o *MentalModelResponse) HasReflectResponse() bool {
if o != nil && !IsNil(o.ReflectResponse) {
return true
}
return false
}
// SetReflectResponse gets a reference to the given map[string]interface{} and assigns it to the ReflectResponse field.
func (o *MentalModelResponse) SetReflectResponse(v map[string]interface{}) {
o.ReflectResponse = v
}
func (o MentalModelResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MentalModelResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["bank_id"] = o.BankId
toSerialize["name"] = o.Name
toSerialize["source_query"] = o.SourceQuery
toSerialize["content"] = o.Content
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
if !IsNil(o.MaxTokens) {
toSerialize["max_tokens"] = o.MaxTokens
}
if !IsNil(o.Trigger) {
toSerialize["trigger"] = o.Trigger
}
if o.LastRefreshedAt.IsSet() {
toSerialize["last_refreshed_at"] = o.LastRefreshedAt.Get()
}
if o.CreatedAt.IsSet() {
toSerialize["created_at"] = o.CreatedAt.Get()
}
if o.ReflectResponse != nil {
toSerialize["reflect_response"] = o.ReflectResponse
}
return toSerialize, nil
}
func (o *MentalModelResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"bank_id",
"name",
"source_query",
"content",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varMentalModelResponse := _MentalModelResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varMentalModelResponse)
if err != nil {
return err
}
*o = MentalModelResponse(varMentalModelResponse)
return err
}
type NullableMentalModelResponse struct {
value *MentalModelResponse
isSet bool
}
func (v NullableMentalModelResponse) Get() *MentalModelResponse {
return v.value
}
func (v *NullableMentalModelResponse) Set(val *MentalModelResponse) {
v.value = val
v.isSet = true
}
func (v NullableMentalModelResponse) IsSet() bool {
return v.isSet
}
func (v *NullableMentalModelResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMentalModelResponse(val *MentalModelResponse) *NullableMentalModelResponse {
return &NullableMentalModelResponse{value: val, isSet: true}
}
func (v NullableMentalModelResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMentalModelResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,131 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the MentalModelTrigger type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MentalModelTrigger{}
// MentalModelTrigger Trigger settings for a mental model.
type MentalModelTrigger struct {
// If true, refresh this mental model after observations consolidation (real-time mode)
RefreshAfterConsolidation *bool `json:"refresh_after_consolidation,omitempty"`
}
// NewMentalModelTrigger instantiates a new MentalModelTrigger object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewMentalModelTrigger() *MentalModelTrigger {
this := MentalModelTrigger{}
var refreshAfterConsolidation bool = false
this.RefreshAfterConsolidation = &refreshAfterConsolidation
return &this
}
// NewMentalModelTriggerWithDefaults instantiates a new MentalModelTrigger object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewMentalModelTriggerWithDefaults() *MentalModelTrigger {
this := MentalModelTrigger{}
var refreshAfterConsolidation bool = false
this.RefreshAfterConsolidation = &refreshAfterConsolidation
return &this
}
// GetRefreshAfterConsolidation returns the RefreshAfterConsolidation field value if set, zero value otherwise.
func (o *MentalModelTrigger) GetRefreshAfterConsolidation() bool {
if o == nil || IsNil(o.RefreshAfterConsolidation) {
var ret bool
return ret
}
return *o.RefreshAfterConsolidation
}
// GetRefreshAfterConsolidationOk returns a tuple with the RefreshAfterConsolidation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MentalModelTrigger) GetRefreshAfterConsolidationOk() (*bool, bool) {
if o == nil || IsNil(o.RefreshAfterConsolidation) {
return nil, false
}
return o.RefreshAfterConsolidation, true
}
// HasRefreshAfterConsolidation returns a boolean if a field has been set.
func (o *MentalModelTrigger) HasRefreshAfterConsolidation() bool {
if o != nil && !IsNil(o.RefreshAfterConsolidation) {
return true
}
return false
}
// SetRefreshAfterConsolidation gets a reference to the given bool and assigns it to the RefreshAfterConsolidation field.
func (o *MentalModelTrigger) SetRefreshAfterConsolidation(v bool) {
o.RefreshAfterConsolidation = &v
}
func (o MentalModelTrigger) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MentalModelTrigger) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.RefreshAfterConsolidation) {
toSerialize["refresh_after_consolidation"] = o.RefreshAfterConsolidation
}
return toSerialize, nil
}
type NullableMentalModelTrigger struct {
value *MentalModelTrigger
isSet bool
}
func (v NullableMentalModelTrigger) Get() *MentalModelTrigger {
return v.value
}
func (v *NullableMentalModelTrigger) Set(val *MentalModelTrigger) {
v.value = val
v.isSet = true
}
func (v NullableMentalModelTrigger) IsSet() bool {
return v.isSet
}
func (v *NullableMentalModelTrigger) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMentalModelTrigger(val *MentalModelTrigger) *NullableMentalModelTrigger {
return &NullableMentalModelTrigger{value: val, isSet: true}
}
func (v NullableMentalModelTrigger) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMentalModelTrigger) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,346 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the OperationResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OperationResponse{}
// OperationResponse Response model for a single async operation.
type OperationResponse struct {
Id string `json:"id"`
TaskType string `json:"task_type"`
ItemsCount int32 `json:"items_count"`
DocumentId NullableString `json:"document_id,omitempty"`
CreatedAt string `json:"created_at"`
Status string `json:"status"`
ErrorMessage NullableString `json:"error_message"`
}
type _OperationResponse OperationResponse
// NewOperationResponse instantiates a new OperationResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewOperationResponse(id string, taskType string, itemsCount int32, createdAt string, status string, errorMessage NullableString) *OperationResponse {
this := OperationResponse{}
this.Id = id
this.TaskType = taskType
this.ItemsCount = itemsCount
this.CreatedAt = createdAt
this.Status = status
this.ErrorMessage = errorMessage
return &this
}
// NewOperationResponseWithDefaults instantiates a new OperationResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewOperationResponseWithDefaults() *OperationResponse {
this := OperationResponse{}
return &this
}
// GetId returns the Id field value
func (o *OperationResponse) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *OperationResponse) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *OperationResponse) SetId(v string) {
o.Id = v
}
// GetTaskType returns the TaskType field value
func (o *OperationResponse) GetTaskType() string {
if o == nil {
var ret string
return ret
}
return o.TaskType
}
// GetTaskTypeOk returns a tuple with the TaskType field value
// and a boolean to check if the value has been set.
func (o *OperationResponse) GetTaskTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TaskType, true
}
// SetTaskType sets field value
func (o *OperationResponse) SetTaskType(v string) {
o.TaskType = v
}
// GetItemsCount returns the ItemsCount field value
func (o *OperationResponse) GetItemsCount() int32 {
if o == nil {
var ret int32
return ret
}
return o.ItemsCount
}
// GetItemsCountOk returns a tuple with the ItemsCount field value
// and a boolean to check if the value has been set.
func (o *OperationResponse) GetItemsCountOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.ItemsCount, true
}
// SetItemsCount sets field value
func (o *OperationResponse) SetItemsCount(v int32) {
o.ItemsCount = v
}
// GetDocumentId returns the DocumentId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OperationResponse) GetDocumentId() string {
if o == nil || IsNil(o.DocumentId.Get()) {
var ret string
return ret
}
return *o.DocumentId.Get()
}
// GetDocumentIdOk returns a tuple with the DocumentId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OperationResponse) GetDocumentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.DocumentId.Get(), o.DocumentId.IsSet()
}
// HasDocumentId returns a boolean if a field has been set.
func (o *OperationResponse) HasDocumentId() bool {
if o != nil && o.DocumentId.IsSet() {
return true
}
return false
}
// SetDocumentId gets a reference to the given NullableString and assigns it to the DocumentId field.
func (o *OperationResponse) SetDocumentId(v string) {
o.DocumentId.Set(&v)
}
// SetDocumentIdNil sets the value for DocumentId to be an explicit nil
func (o *OperationResponse) SetDocumentIdNil() {
o.DocumentId.Set(nil)
}
// UnsetDocumentId ensures that no value is present for DocumentId, not even an explicit nil
func (o *OperationResponse) UnsetDocumentId() {
o.DocumentId.Unset()
}
// GetCreatedAt returns the CreatedAt field value
func (o *OperationResponse) GetCreatedAt() string {
if o == nil {
var ret string
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *OperationResponse) GetCreatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *OperationResponse) SetCreatedAt(v string) {
o.CreatedAt = v
}
// GetStatus returns the Status field value
func (o *OperationResponse) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *OperationResponse) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *OperationResponse) SetStatus(v string) {
o.Status = v
}
// GetErrorMessage returns the ErrorMessage field value
// If the value is explicit nil, the zero value for string will be returned
func (o *OperationResponse) GetErrorMessage() string {
if o == nil || o.ErrorMessage.Get() == nil {
var ret string
return ret
}
return *o.ErrorMessage.Get()
}
// GetErrorMessageOk returns a tuple with the ErrorMessage field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OperationResponse) GetErrorMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ErrorMessage.Get(), o.ErrorMessage.IsSet()
}
// SetErrorMessage sets field value
func (o *OperationResponse) SetErrorMessage(v string) {
o.ErrorMessage.Set(&v)
}
func (o OperationResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OperationResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["task_type"] = o.TaskType
toSerialize["items_count"] = o.ItemsCount
if o.DocumentId.IsSet() {
toSerialize["document_id"] = o.DocumentId.Get()
}
toSerialize["created_at"] = o.CreatedAt
toSerialize["status"] = o.Status
toSerialize["error_message"] = o.ErrorMessage.Get()
return toSerialize, nil
}
func (o *OperationResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"task_type",
"items_count",
"created_at",
"status",
"error_message",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varOperationResponse := _OperationResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varOperationResponse)
if err != nil {
return err
}
*o = OperationResponse(varOperationResponse)
return err
}
type NullableOperationResponse struct {
value *OperationResponse
isSet bool
}
func (v NullableOperationResponse) Get() *OperationResponse {
return v.value
}
func (v *NullableOperationResponse) Set(val *OperationResponse) {
v.value = val
v.isSet = true
}
func (v NullableOperationResponse) IsSet() bool {
return v.isSet
}
func (v *NullableOperationResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOperationResponse(val *OperationResponse) *NullableOperationResponse {
return &NullableOperationResponse{value: val, isSet: true}
}
func (v NullableOperationResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOperationResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,490 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the OperationStatusResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OperationStatusResponse{}
// OperationStatusResponse Response model for getting a single operation status.
type OperationStatusResponse struct {
OperationId string `json:"operation_id"`
Status string `json:"status"`
OperationType NullableString `json:"operation_type,omitempty"`
CreatedAt NullableString `json:"created_at,omitempty"`
UpdatedAt NullableString `json:"updated_at,omitempty"`
CompletedAt NullableString `json:"completed_at,omitempty"`
ErrorMessage NullableString `json:"error_message,omitempty"`
ResultMetadata map[string]interface{} `json:"result_metadata,omitempty"`
ChildOperations []ChildOperationStatus `json:"child_operations,omitempty"`
}
type _OperationStatusResponse OperationStatusResponse
// NewOperationStatusResponse instantiates a new OperationStatusResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewOperationStatusResponse(operationId string, status string) *OperationStatusResponse {
this := OperationStatusResponse{}
this.OperationId = operationId
this.Status = status
return &this
}
// NewOperationStatusResponseWithDefaults instantiates a new OperationStatusResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewOperationStatusResponseWithDefaults() *OperationStatusResponse {
this := OperationStatusResponse{}
return &this
}
// GetOperationId returns the OperationId field value
func (o *OperationStatusResponse) GetOperationId() string {
if o == nil {
var ret string
return ret
}
return o.OperationId
}
// GetOperationIdOk returns a tuple with the OperationId field value
// and a boolean to check if the value has been set.
func (o *OperationStatusResponse) GetOperationIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OperationId, true
}
// SetOperationId sets field value
func (o *OperationStatusResponse) SetOperationId(v string) {
o.OperationId = v
}
// GetStatus returns the Status field value
func (o *OperationStatusResponse) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *OperationStatusResponse) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *OperationStatusResponse) SetStatus(v string) {
o.Status = v
}
// GetOperationType returns the OperationType field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OperationStatusResponse) GetOperationType() string {
if o == nil || IsNil(o.OperationType.Get()) {
var ret string
return ret
}
return *o.OperationType.Get()
}
// GetOperationTypeOk returns a tuple with the OperationType field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OperationStatusResponse) GetOperationTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.OperationType.Get(), o.OperationType.IsSet()
}
// HasOperationType returns a boolean if a field has been set.
func (o *OperationStatusResponse) HasOperationType() bool {
if o != nil && o.OperationType.IsSet() {
return true
}
return false
}
// SetOperationType gets a reference to the given NullableString and assigns it to the OperationType field.
func (o *OperationStatusResponse) SetOperationType(v string) {
o.OperationType.Set(&v)
}
// SetOperationTypeNil sets the value for OperationType to be an explicit nil
func (o *OperationStatusResponse) SetOperationTypeNil() {
o.OperationType.Set(nil)
}
// UnsetOperationType ensures that no value is present for OperationType, not even an explicit nil
func (o *OperationStatusResponse) UnsetOperationType() {
o.OperationType.Unset()
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OperationStatusResponse) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt.Get()) {
var ret string
return ret
}
return *o.CreatedAt.Get()
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OperationStatusResponse) GetCreatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CreatedAt.Get(), o.CreatedAt.IsSet()
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *OperationStatusResponse) HasCreatedAt() bool {
if o != nil && o.CreatedAt.IsSet() {
return true
}
return false
}
// SetCreatedAt gets a reference to the given NullableString and assigns it to the CreatedAt field.
func (o *OperationStatusResponse) SetCreatedAt(v string) {
o.CreatedAt.Set(&v)
}
// SetCreatedAtNil sets the value for CreatedAt to be an explicit nil
func (o *OperationStatusResponse) SetCreatedAtNil() {
o.CreatedAt.Set(nil)
}
// UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil
func (o *OperationStatusResponse) UnsetCreatedAt() {
o.CreatedAt.Unset()
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OperationStatusResponse) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt.Get()) {
var ret string
return ret
}
return *o.UpdatedAt.Get()
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OperationStatusResponse) GetUpdatedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.UpdatedAt.Get(), o.UpdatedAt.IsSet()
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *OperationStatusResponse) HasUpdatedAt() bool {
if o != nil && o.UpdatedAt.IsSet() {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given NullableString and assigns it to the UpdatedAt field.
func (o *OperationStatusResponse) SetUpdatedAt(v string) {
o.UpdatedAt.Set(&v)
}
// SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil
func (o *OperationStatusResponse) SetUpdatedAtNil() {
o.UpdatedAt.Set(nil)
}
// UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil
func (o *OperationStatusResponse) UnsetUpdatedAt() {
o.UpdatedAt.Unset()
}
// GetCompletedAt returns the CompletedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OperationStatusResponse) GetCompletedAt() string {
if o == nil || IsNil(o.CompletedAt.Get()) {
var ret string
return ret
}
return *o.CompletedAt.Get()
}
// GetCompletedAtOk returns a tuple with the CompletedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OperationStatusResponse) GetCompletedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CompletedAt.Get(), o.CompletedAt.IsSet()
}
// HasCompletedAt returns a boolean if a field has been set.
func (o *OperationStatusResponse) HasCompletedAt() bool {
if o != nil && o.CompletedAt.IsSet() {
return true
}
return false
}
// SetCompletedAt gets a reference to the given NullableString and assigns it to the CompletedAt field.
func (o *OperationStatusResponse) SetCompletedAt(v string) {
o.CompletedAt.Set(&v)
}
// SetCompletedAtNil sets the value for CompletedAt to be an explicit nil
func (o *OperationStatusResponse) SetCompletedAtNil() {
o.CompletedAt.Set(nil)
}
// UnsetCompletedAt ensures that no value is present for CompletedAt, not even an explicit nil
func (o *OperationStatusResponse) UnsetCompletedAt() {
o.CompletedAt.Unset()
}
// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OperationStatusResponse) GetErrorMessage() string {
if o == nil || IsNil(o.ErrorMessage.Get()) {
var ret string
return ret
}
return *o.ErrorMessage.Get()
}
// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OperationStatusResponse) GetErrorMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ErrorMessage.Get(), o.ErrorMessage.IsSet()
}
// HasErrorMessage returns a boolean if a field has been set.
func (o *OperationStatusResponse) HasErrorMessage() bool {
if o != nil && o.ErrorMessage.IsSet() {
return true
}
return false
}
// SetErrorMessage gets a reference to the given NullableString and assigns it to the ErrorMessage field.
func (o *OperationStatusResponse) SetErrorMessage(v string) {
o.ErrorMessage.Set(&v)
}
// SetErrorMessageNil sets the value for ErrorMessage to be an explicit nil
func (o *OperationStatusResponse) SetErrorMessageNil() {
o.ErrorMessage.Set(nil)
}
// UnsetErrorMessage ensures that no value is present for ErrorMessage, not even an explicit nil
func (o *OperationStatusResponse) UnsetErrorMessage() {
o.ErrorMessage.Unset()
}
// GetResultMetadata returns the ResultMetadata field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OperationStatusResponse) GetResultMetadata() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.ResultMetadata
}
// GetResultMetadataOk returns a tuple with the ResultMetadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OperationStatusResponse) GetResultMetadataOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.ResultMetadata) {
return map[string]interface{}{}, false
}
return o.ResultMetadata, true
}
// HasResultMetadata returns a boolean if a field has been set.
func (o *OperationStatusResponse) HasResultMetadata() bool {
if o != nil && !IsNil(o.ResultMetadata) {
return true
}
return false
}
// SetResultMetadata gets a reference to the given map[string]interface{} and assigns it to the ResultMetadata field.
func (o *OperationStatusResponse) SetResultMetadata(v map[string]interface{}) {
o.ResultMetadata = v
}
// GetChildOperations returns the ChildOperations field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *OperationStatusResponse) GetChildOperations() []ChildOperationStatus {
if o == nil {
var ret []ChildOperationStatus
return ret
}
return o.ChildOperations
}
// GetChildOperationsOk returns a tuple with the ChildOperations field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *OperationStatusResponse) GetChildOperationsOk() ([]ChildOperationStatus, bool) {
if o == nil || IsNil(o.ChildOperations) {
return nil, false
}
return o.ChildOperations, true
}
// HasChildOperations returns a boolean if a field has been set.
func (o *OperationStatusResponse) HasChildOperations() bool {
if o != nil && !IsNil(o.ChildOperations) {
return true
}
return false
}
// SetChildOperations gets a reference to the given []ChildOperationStatus and assigns it to the ChildOperations field.
func (o *OperationStatusResponse) SetChildOperations(v []ChildOperationStatus) {
o.ChildOperations = v
}
func (o OperationStatusResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OperationStatusResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["operation_id"] = o.OperationId
toSerialize["status"] = o.Status
if o.OperationType.IsSet() {
toSerialize["operation_type"] = o.OperationType.Get()
}
if o.CreatedAt.IsSet() {
toSerialize["created_at"] = o.CreatedAt.Get()
}
if o.UpdatedAt.IsSet() {
toSerialize["updated_at"] = o.UpdatedAt.Get()
}
if o.CompletedAt.IsSet() {
toSerialize["completed_at"] = o.CompletedAt.Get()
}
if o.ErrorMessage.IsSet() {
toSerialize["error_message"] = o.ErrorMessage.Get()
}
if o.ResultMetadata != nil {
toSerialize["result_metadata"] = o.ResultMetadata
}
if o.ChildOperations != nil {
toSerialize["child_operations"] = o.ChildOperations
}
return toSerialize, nil
}
func (o *OperationStatusResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"operation_id",
"status",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varOperationStatusResponse := _OperationStatusResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varOperationStatusResponse)
if err != nil {
return err
}
*o = OperationStatusResponse(varOperationStatusResponse)
return err
}
type NullableOperationStatusResponse struct {
value *OperationStatusResponse
isSet bool
}
func (v NullableOperationStatusResponse) Get() *OperationStatusResponse {
return v.value
}
func (v *NullableOperationStatusResponse) Set(val *OperationStatusResponse) {
v.value = val
v.isSet = true
}
func (v NullableOperationStatusResponse) IsSet() bool {
return v.isSet
}
func (v *NullableOperationStatusResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOperationStatusResponse(val *OperationStatusResponse) *NullableOperationStatusResponse {
return &NullableOperationStatusResponse{value: val, isSet: true}
}
func (v NullableOperationStatusResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOperationStatusResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,270 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the OperationsListResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OperationsListResponse{}
// OperationsListResponse Response model for list operations endpoint.
type OperationsListResponse struct {
BankId string `json:"bank_id"`
Total int32 `json:"total"`
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
Operations []OperationResponse `json:"operations"`
}
type _OperationsListResponse OperationsListResponse
// NewOperationsListResponse instantiates a new OperationsListResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewOperationsListResponse(bankId string, total int32, limit int32, offset int32, operations []OperationResponse) *OperationsListResponse {
this := OperationsListResponse{}
this.BankId = bankId
this.Total = total
this.Limit = limit
this.Offset = offset
this.Operations = operations
return &this
}
// NewOperationsListResponseWithDefaults instantiates a new OperationsListResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewOperationsListResponseWithDefaults() *OperationsListResponse {
this := OperationsListResponse{}
return &this
}
// GetBankId returns the BankId field value
func (o *OperationsListResponse) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *OperationsListResponse) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *OperationsListResponse) SetBankId(v string) {
o.BankId = v
}
// GetTotal returns the Total field value
func (o *OperationsListResponse) GetTotal() int32 {
if o == nil {
var ret int32
return ret
}
return o.Total
}
// GetTotalOk returns a tuple with the Total field value
// and a boolean to check if the value has been set.
func (o *OperationsListResponse) GetTotalOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Total, true
}
// SetTotal sets field value
func (o *OperationsListResponse) SetTotal(v int32) {
o.Total = v
}
// GetLimit returns the Limit field value
func (o *OperationsListResponse) GetLimit() int32 {
if o == nil {
var ret int32
return ret
}
return o.Limit
}
// GetLimitOk returns a tuple with the Limit field value
// and a boolean to check if the value has been set.
func (o *OperationsListResponse) GetLimitOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Limit, true
}
// SetLimit sets field value
func (o *OperationsListResponse) SetLimit(v int32) {
o.Limit = v
}
// GetOffset returns the Offset field value
func (o *OperationsListResponse) GetOffset() int32 {
if o == nil {
var ret int32
return ret
}
return o.Offset
}
// GetOffsetOk returns a tuple with the Offset field value
// and a boolean to check if the value has been set.
func (o *OperationsListResponse) GetOffsetOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Offset, true
}
// SetOffset sets field value
func (o *OperationsListResponse) SetOffset(v int32) {
o.Offset = v
}
// GetOperations returns the Operations field value
func (o *OperationsListResponse) GetOperations() []OperationResponse {
if o == nil {
var ret []OperationResponse
return ret
}
return o.Operations
}
// GetOperationsOk returns a tuple with the Operations field value
// and a boolean to check if the value has been set.
func (o *OperationsListResponse) GetOperationsOk() ([]OperationResponse, bool) {
if o == nil {
return nil, false
}
return o.Operations, true
}
// SetOperations sets field value
func (o *OperationsListResponse) SetOperations(v []OperationResponse) {
o.Operations = v
}
func (o OperationsListResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OperationsListResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["bank_id"] = o.BankId
toSerialize["total"] = o.Total
toSerialize["limit"] = o.Limit
toSerialize["offset"] = o.Offset
toSerialize["operations"] = o.Operations
return toSerialize, nil
}
func (o *OperationsListResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"bank_id",
"total",
"limit",
"offset",
"operations",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varOperationsListResponse := _OperationsListResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varOperationsListResponse)
if err != nil {
return err
}
*o = OperationsListResponse(varOperationsListResponse)
return err
}
type NullableOperationsListResponse struct {
value *OperationsListResponse
isSet bool
}
func (v NullableOperationsListResponse) Get() *OperationsListResponse {
return v.value
}
func (v *NullableOperationsListResponse) Set(val *OperationsListResponse) {
v.value = val
v.isSet = true
}
func (v NullableOperationsListResponse) IsSet() bool {
return v.isSet
}
func (v *NullableOperationsListResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOperationsListResponse(val *OperationsListResponse) *NullableOperationsListResponse {
return &NullableOperationsListResponse{value: val, isSet: true}
}
func (v NullableOperationsListResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOperationsListResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,472 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the RecallRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RecallRequest{}
// RecallRequest Request model for recall endpoint.
type RecallRequest struct {
Query string `json:"query"`
Types []string `json:"types,omitempty"`
Budget *Budget `json:"budget,omitempty"`
MaxTokens *int32 `json:"max_tokens,omitempty"`
Trace *bool `json:"trace,omitempty"`
QueryTimestamp NullableString `json:"query_timestamp,omitempty"`
// Options for including additional data (entities are included by default)
Include *IncludeOptions `json:"include,omitempty"`
Tags []string `json:"tags,omitempty"`
// How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).
TagsMatch *string `json:"tags_match,omitempty"`
}
type _RecallRequest RecallRequest
// NewRecallRequest instantiates a new RecallRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewRecallRequest(query string) *RecallRequest {
this := RecallRequest{}
this.Query = query
var maxTokens int32 = 4096
this.MaxTokens = &maxTokens
var trace bool = false
this.Trace = &trace
var tagsMatch string = "any"
this.TagsMatch = &tagsMatch
return &this
}
// NewRecallRequestWithDefaults instantiates a new RecallRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewRecallRequestWithDefaults() *RecallRequest {
this := RecallRequest{}
var maxTokens int32 = 4096
this.MaxTokens = &maxTokens
var trace bool = false
this.Trace = &trace
var tagsMatch string = "any"
this.TagsMatch = &tagsMatch
return &this
}
// GetQuery returns the Query field value
func (o *RecallRequest) GetQuery() string {
if o == nil {
var ret string
return ret
}
return o.Query
}
// GetQueryOk returns a tuple with the Query field value
// and a boolean to check if the value has been set.
func (o *RecallRequest) GetQueryOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Query, true
}
// SetQuery sets field value
func (o *RecallRequest) SetQuery(v string) {
o.Query = v
}
// GetTypes returns the Types field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallRequest) GetTypes() []string {
if o == nil {
var ret []string
return ret
}
return o.Types
}
// GetTypesOk returns a tuple with the Types field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallRequest) GetTypesOk() ([]string, bool) {
if o == nil || IsNil(o.Types) {
return nil, false
}
return o.Types, true
}
// HasTypes returns a boolean if a field has been set.
func (o *RecallRequest) HasTypes() bool {
if o != nil && !IsNil(o.Types) {
return true
}
return false
}
// SetTypes gets a reference to the given []string and assigns it to the Types field.
func (o *RecallRequest) SetTypes(v []string) {
o.Types = v
}
// GetBudget returns the Budget field value if set, zero value otherwise.
func (o *RecallRequest) GetBudget() Budget {
if o == nil || IsNil(o.Budget) {
var ret Budget
return ret
}
return *o.Budget
}
// GetBudgetOk returns a tuple with the Budget field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecallRequest) GetBudgetOk() (*Budget, bool) {
if o == nil || IsNil(o.Budget) {
return nil, false
}
return o.Budget, true
}
// HasBudget returns a boolean if a field has been set.
func (o *RecallRequest) HasBudget() bool {
if o != nil && !IsNil(o.Budget) {
return true
}
return false
}
// SetBudget gets a reference to the given Budget and assigns it to the Budget field.
func (o *RecallRequest) SetBudget(v Budget) {
o.Budget = &v
}
// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise.
func (o *RecallRequest) GetMaxTokens() int32 {
if o == nil || IsNil(o.MaxTokens) {
var ret int32
return ret
}
return *o.MaxTokens
}
// GetMaxTokensOk returns a tuple with the MaxTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecallRequest) GetMaxTokensOk() (*int32, bool) {
if o == nil || IsNil(o.MaxTokens) {
return nil, false
}
return o.MaxTokens, true
}
// HasMaxTokens returns a boolean if a field has been set.
func (o *RecallRequest) HasMaxTokens() bool {
if o != nil && !IsNil(o.MaxTokens) {
return true
}
return false
}
// SetMaxTokens gets a reference to the given int32 and assigns it to the MaxTokens field.
func (o *RecallRequest) SetMaxTokens(v int32) {
o.MaxTokens = &v
}
// GetTrace returns the Trace field value if set, zero value otherwise.
func (o *RecallRequest) GetTrace() bool {
if o == nil || IsNil(o.Trace) {
var ret bool
return ret
}
return *o.Trace
}
// GetTraceOk returns a tuple with the Trace field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecallRequest) GetTraceOk() (*bool, bool) {
if o == nil || IsNil(o.Trace) {
return nil, false
}
return o.Trace, true
}
// HasTrace returns a boolean if a field has been set.
func (o *RecallRequest) HasTrace() bool {
if o != nil && !IsNil(o.Trace) {
return true
}
return false
}
// SetTrace gets a reference to the given bool and assigns it to the Trace field.
func (o *RecallRequest) SetTrace(v bool) {
o.Trace = &v
}
// GetQueryTimestamp returns the QueryTimestamp field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallRequest) GetQueryTimestamp() string {
if o == nil || IsNil(o.QueryTimestamp.Get()) {
var ret string
return ret
}
return *o.QueryTimestamp.Get()
}
// GetQueryTimestampOk returns a tuple with the QueryTimestamp field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallRequest) GetQueryTimestampOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.QueryTimestamp.Get(), o.QueryTimestamp.IsSet()
}
// HasQueryTimestamp returns a boolean if a field has been set.
func (o *RecallRequest) HasQueryTimestamp() bool {
if o != nil && o.QueryTimestamp.IsSet() {
return true
}
return false
}
// SetQueryTimestamp gets a reference to the given NullableString and assigns it to the QueryTimestamp field.
func (o *RecallRequest) SetQueryTimestamp(v string) {
o.QueryTimestamp.Set(&v)
}
// SetQueryTimestampNil sets the value for QueryTimestamp to be an explicit nil
func (o *RecallRequest) SetQueryTimestampNil() {
o.QueryTimestamp.Set(nil)
}
// UnsetQueryTimestamp ensures that no value is present for QueryTimestamp, not even an explicit nil
func (o *RecallRequest) UnsetQueryTimestamp() {
o.QueryTimestamp.Unset()
}
// GetInclude returns the Include field value if set, zero value otherwise.
func (o *RecallRequest) GetInclude() IncludeOptions {
if o == nil || IsNil(o.Include) {
var ret IncludeOptions
return ret
}
return *o.Include
}
// GetIncludeOk returns a tuple with the Include field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecallRequest) GetIncludeOk() (*IncludeOptions, bool) {
if o == nil || IsNil(o.Include) {
return nil, false
}
return o.Include, true
}
// HasInclude returns a boolean if a field has been set.
func (o *RecallRequest) HasInclude() bool {
if o != nil && !IsNil(o.Include) {
return true
}
return false
}
// SetInclude gets a reference to the given IncludeOptions and assigns it to the Include field.
func (o *RecallRequest) SetInclude(v IncludeOptions) {
o.Include = &v
}
// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallRequest) GetTags() []string {
if o == nil {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallRequest) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *RecallRequest) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *RecallRequest) SetTags(v []string) {
o.Tags = v
}
// GetTagsMatch returns the TagsMatch field value if set, zero value otherwise.
func (o *RecallRequest) GetTagsMatch() string {
if o == nil || IsNil(o.TagsMatch) {
var ret string
return ret
}
return *o.TagsMatch
}
// GetTagsMatchOk returns a tuple with the TagsMatch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecallRequest) GetTagsMatchOk() (*string, bool) {
if o == nil || IsNil(o.TagsMatch) {
return nil, false
}
return o.TagsMatch, true
}
// HasTagsMatch returns a boolean if a field has been set.
func (o *RecallRequest) HasTagsMatch() bool {
if o != nil && !IsNil(o.TagsMatch) {
return true
}
return false
}
// SetTagsMatch gets a reference to the given string and assigns it to the TagsMatch field.
func (o *RecallRequest) SetTagsMatch(v string) {
o.TagsMatch = &v
}
func (o RecallRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RecallRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["query"] = o.Query
if o.Types != nil {
toSerialize["types"] = o.Types
}
if !IsNil(o.Budget) {
toSerialize["budget"] = o.Budget
}
if !IsNil(o.MaxTokens) {
toSerialize["max_tokens"] = o.MaxTokens
}
if !IsNil(o.Trace) {
toSerialize["trace"] = o.Trace
}
if o.QueryTimestamp.IsSet() {
toSerialize["query_timestamp"] = o.QueryTimestamp.Get()
}
if !IsNil(o.Include) {
toSerialize["include"] = o.Include
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
if !IsNil(o.TagsMatch) {
toSerialize["tags_match"] = o.TagsMatch
}
return toSerialize, nil
}
func (o *RecallRequest) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"query",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varRecallRequest := _RecallRequest{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varRecallRequest)
if err != nil {
return err
}
*o = RecallRequest(varRecallRequest)
return err
}
type NullableRecallRequest struct {
value *RecallRequest
isSet bool
}
func (v NullableRecallRequest) Get() *RecallRequest {
return v.value
}
func (v *NullableRecallRequest) Set(val *RecallRequest) {
v.value = val
v.isSet = true
}
func (v NullableRecallRequest) IsSet() bool {
return v.isSet
}
func (v *NullableRecallRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRecallRequest(val *RecallRequest) *NullableRecallRequest {
return &NullableRecallRequest{value: val, isSet: true}
}
func (v NullableRecallRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRecallRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,269 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the RecallResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RecallResponse{}
// RecallResponse Response model for recall endpoints.
type RecallResponse struct {
Results []RecallResult `json:"results"`
Trace map[string]interface{} `json:"trace,omitempty"`
Entities map[string]EntityStateResponse `json:"entities,omitempty"`
Chunks map[string]ChunkData `json:"chunks,omitempty"`
}
type _RecallResponse RecallResponse
// NewRecallResponse instantiates a new RecallResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewRecallResponse(results []RecallResult) *RecallResponse {
this := RecallResponse{}
this.Results = results
return &this
}
// NewRecallResponseWithDefaults instantiates a new RecallResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewRecallResponseWithDefaults() *RecallResponse {
this := RecallResponse{}
return &this
}
// GetResults returns the Results field value
func (o *RecallResponse) GetResults() []RecallResult {
if o == nil {
var ret []RecallResult
return ret
}
return o.Results
}
// GetResultsOk returns a tuple with the Results field value
// and a boolean to check if the value has been set.
func (o *RecallResponse) GetResultsOk() ([]RecallResult, bool) {
if o == nil {
return nil, false
}
return o.Results, true
}
// SetResults sets field value
func (o *RecallResponse) SetResults(v []RecallResult) {
o.Results = v
}
// GetTrace returns the Trace field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResponse) GetTrace() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Trace
}
// GetTraceOk returns a tuple with the Trace field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResponse) GetTraceOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Trace) {
return map[string]interface{}{}, false
}
return o.Trace, true
}
// HasTrace returns a boolean if a field has been set.
func (o *RecallResponse) HasTrace() bool {
if o != nil && !IsNil(o.Trace) {
return true
}
return false
}
// SetTrace gets a reference to the given map[string]interface{} and assigns it to the Trace field.
func (o *RecallResponse) SetTrace(v map[string]interface{}) {
o.Trace = v
}
// GetEntities returns the Entities field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResponse) GetEntities() map[string]EntityStateResponse {
if o == nil {
var ret map[string]EntityStateResponse
return ret
}
return o.Entities
}
// GetEntitiesOk returns a tuple with the Entities field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResponse) GetEntitiesOk() (map[string]EntityStateResponse, bool) {
if o == nil || IsNil(o.Entities) {
return map[string]EntityStateResponse{}, false
}
return o.Entities, true
}
// HasEntities returns a boolean if a field has been set.
func (o *RecallResponse) HasEntities() bool {
if o != nil && !IsNil(o.Entities) {
return true
}
return false
}
// SetEntities gets a reference to the given map[string]EntityStateResponse and assigns it to the Entities field.
func (o *RecallResponse) SetEntities(v map[string]EntityStateResponse) {
o.Entities = v
}
// GetChunks returns the Chunks field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResponse) GetChunks() map[string]ChunkData {
if o == nil {
var ret map[string]ChunkData
return ret
}
return o.Chunks
}
// GetChunksOk returns a tuple with the Chunks field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResponse) GetChunksOk() (map[string]ChunkData, bool) {
if o == nil || IsNil(o.Chunks) {
return map[string]ChunkData{}, false
}
return o.Chunks, true
}
// HasChunks returns a boolean if a field has been set.
func (o *RecallResponse) HasChunks() bool {
if o != nil && !IsNil(o.Chunks) {
return true
}
return false
}
// SetChunks gets a reference to the given map[string]ChunkData and assigns it to the Chunks field.
func (o *RecallResponse) SetChunks(v map[string]ChunkData) {
o.Chunks = v
}
func (o RecallResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RecallResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["results"] = o.Results
if o.Trace != nil {
toSerialize["trace"] = o.Trace
}
if o.Entities != nil {
toSerialize["entities"] = o.Entities
}
if o.Chunks != nil {
toSerialize["chunks"] = o.Chunks
}
return toSerialize, nil
}
func (o *RecallResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"results",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varRecallResponse := _RecallResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varRecallResponse)
if err != nil {
return err
}
*o = RecallResponse(varRecallResponse)
return err
}
type NullableRecallResponse struct {
value *RecallResponse
isSet bool
}
func (v NullableRecallResponse) Get() *RecallResponse {
return v.value
}
func (v *NullableRecallResponse) Set(val *RecallResponse) {
v.value = val
v.isSet = true
}
func (v NullableRecallResponse) IsSet() bool {
return v.isSet
}
func (v *NullableRecallResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRecallResponse(val *RecallResponse) *NullableRecallResponse {
return &NullableRecallResponse{value: val, isSet: true}
}
func (v NullableRecallResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRecallResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,619 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the RecallResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RecallResult{}
// RecallResult Single recall result item.
type RecallResult struct {
Id string `json:"id"`
Text string `json:"text"`
Type NullableString `json:"type,omitempty"`
Entities []string `json:"entities,omitempty"`
Context NullableString `json:"context,omitempty"`
OccurredStart NullableString `json:"occurred_start,omitempty"`
OccurredEnd NullableString `json:"occurred_end,omitempty"`
MentionedAt NullableString `json:"mentioned_at,omitempty"`
DocumentId NullableString `json:"document_id,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
ChunkId NullableString `json:"chunk_id,omitempty"`
Tags []string `json:"tags,omitempty"`
}
type _RecallResult RecallResult
// NewRecallResult instantiates a new RecallResult object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewRecallResult(id string, text string) *RecallResult {
this := RecallResult{}
this.Id = id
this.Text = text
return &this
}
// NewRecallResultWithDefaults instantiates a new RecallResult object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewRecallResultWithDefaults() *RecallResult {
this := RecallResult{}
return &this
}
// GetId returns the Id field value
func (o *RecallResult) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *RecallResult) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *RecallResult) SetId(v string) {
o.Id = v
}
// GetText returns the Text field value
func (o *RecallResult) GetText() string {
if o == nil {
var ret string
return ret
}
return o.Text
}
// GetTextOk returns a tuple with the Text field value
// and a boolean to check if the value has been set.
func (o *RecallResult) GetTextOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Text, true
}
// SetText sets field value
func (o *RecallResult) SetText(v string) {
o.Text = v
}
// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetType() string {
if o == nil || IsNil(o.Type.Get()) {
var ret string
return ret
}
return *o.Type.Get()
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Type.Get(), o.Type.IsSet()
}
// HasType returns a boolean if a field has been set.
func (o *RecallResult) HasType() bool {
if o != nil && o.Type.IsSet() {
return true
}
return false
}
// SetType gets a reference to the given NullableString and assigns it to the Type field.
func (o *RecallResult) SetType(v string) {
o.Type.Set(&v)
}
// SetTypeNil sets the value for Type to be an explicit nil
func (o *RecallResult) SetTypeNil() {
o.Type.Set(nil)
}
// UnsetType ensures that no value is present for Type, not even an explicit nil
func (o *RecallResult) UnsetType() {
o.Type.Unset()
}
// GetEntities returns the Entities field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetEntities() []string {
if o == nil {
var ret []string
return ret
}
return o.Entities
}
// GetEntitiesOk returns a tuple with the Entities field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetEntitiesOk() ([]string, bool) {
if o == nil || IsNil(o.Entities) {
return nil, false
}
return o.Entities, true
}
// HasEntities returns a boolean if a field has been set.
func (o *RecallResult) HasEntities() bool {
if o != nil && !IsNil(o.Entities) {
return true
}
return false
}
// SetEntities gets a reference to the given []string and assigns it to the Entities field.
func (o *RecallResult) SetEntities(v []string) {
o.Entities = v
}
// GetContext returns the Context field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetContext() string {
if o == nil || IsNil(o.Context.Get()) {
var ret string
return ret
}
return *o.Context.Get()
}
// GetContextOk returns a tuple with the Context field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetContextOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Context.Get(), o.Context.IsSet()
}
// HasContext returns a boolean if a field has been set.
func (o *RecallResult) HasContext() bool {
if o != nil && o.Context.IsSet() {
return true
}
return false
}
// SetContext gets a reference to the given NullableString and assigns it to the Context field.
func (o *RecallResult) SetContext(v string) {
o.Context.Set(&v)
}
// SetContextNil sets the value for Context to be an explicit nil
func (o *RecallResult) SetContextNil() {
o.Context.Set(nil)
}
// UnsetContext ensures that no value is present for Context, not even an explicit nil
func (o *RecallResult) UnsetContext() {
o.Context.Unset()
}
// GetOccurredStart returns the OccurredStart field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetOccurredStart() string {
if o == nil || IsNil(o.OccurredStart.Get()) {
var ret string
return ret
}
return *o.OccurredStart.Get()
}
// GetOccurredStartOk returns a tuple with the OccurredStart field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetOccurredStartOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.OccurredStart.Get(), o.OccurredStart.IsSet()
}
// HasOccurredStart returns a boolean if a field has been set.
func (o *RecallResult) HasOccurredStart() bool {
if o != nil && o.OccurredStart.IsSet() {
return true
}
return false
}
// SetOccurredStart gets a reference to the given NullableString and assigns it to the OccurredStart field.
func (o *RecallResult) SetOccurredStart(v string) {
o.OccurredStart.Set(&v)
}
// SetOccurredStartNil sets the value for OccurredStart to be an explicit nil
func (o *RecallResult) SetOccurredStartNil() {
o.OccurredStart.Set(nil)
}
// UnsetOccurredStart ensures that no value is present for OccurredStart, not even an explicit nil
func (o *RecallResult) UnsetOccurredStart() {
o.OccurredStart.Unset()
}
// GetOccurredEnd returns the OccurredEnd field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetOccurredEnd() string {
if o == nil || IsNil(o.OccurredEnd.Get()) {
var ret string
return ret
}
return *o.OccurredEnd.Get()
}
// GetOccurredEndOk returns a tuple with the OccurredEnd field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetOccurredEndOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.OccurredEnd.Get(), o.OccurredEnd.IsSet()
}
// HasOccurredEnd returns a boolean if a field has been set.
func (o *RecallResult) HasOccurredEnd() bool {
if o != nil && o.OccurredEnd.IsSet() {
return true
}
return false
}
// SetOccurredEnd gets a reference to the given NullableString and assigns it to the OccurredEnd field.
func (o *RecallResult) SetOccurredEnd(v string) {
o.OccurredEnd.Set(&v)
}
// SetOccurredEndNil sets the value for OccurredEnd to be an explicit nil
func (o *RecallResult) SetOccurredEndNil() {
o.OccurredEnd.Set(nil)
}
// UnsetOccurredEnd ensures that no value is present for OccurredEnd, not even an explicit nil
func (o *RecallResult) UnsetOccurredEnd() {
o.OccurredEnd.Unset()
}
// GetMentionedAt returns the MentionedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetMentionedAt() string {
if o == nil || IsNil(o.MentionedAt.Get()) {
var ret string
return ret
}
return *o.MentionedAt.Get()
}
// GetMentionedAtOk returns a tuple with the MentionedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetMentionedAtOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.MentionedAt.Get(), o.MentionedAt.IsSet()
}
// HasMentionedAt returns a boolean if a field has been set.
func (o *RecallResult) HasMentionedAt() bool {
if o != nil && o.MentionedAt.IsSet() {
return true
}
return false
}
// SetMentionedAt gets a reference to the given NullableString and assigns it to the MentionedAt field.
func (o *RecallResult) SetMentionedAt(v string) {
o.MentionedAt.Set(&v)
}
// SetMentionedAtNil sets the value for MentionedAt to be an explicit nil
func (o *RecallResult) SetMentionedAtNil() {
o.MentionedAt.Set(nil)
}
// UnsetMentionedAt ensures that no value is present for MentionedAt, not even an explicit nil
func (o *RecallResult) UnsetMentionedAt() {
o.MentionedAt.Unset()
}
// GetDocumentId returns the DocumentId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetDocumentId() string {
if o == nil || IsNil(o.DocumentId.Get()) {
var ret string
return ret
}
return *o.DocumentId.Get()
}
// GetDocumentIdOk returns a tuple with the DocumentId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetDocumentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.DocumentId.Get(), o.DocumentId.IsSet()
}
// HasDocumentId returns a boolean if a field has been set.
func (o *RecallResult) HasDocumentId() bool {
if o != nil && o.DocumentId.IsSet() {
return true
}
return false
}
// SetDocumentId gets a reference to the given NullableString and assigns it to the DocumentId field.
func (o *RecallResult) SetDocumentId(v string) {
o.DocumentId.Set(&v)
}
// SetDocumentIdNil sets the value for DocumentId to be an explicit nil
func (o *RecallResult) SetDocumentIdNil() {
o.DocumentId.Set(nil)
}
// UnsetDocumentId ensures that no value is present for DocumentId, not even an explicit nil
func (o *RecallResult) UnsetDocumentId() {
o.DocumentId.Unset()
}
// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetMetadata() map[string]string {
if o == nil {
var ret map[string]string
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetMetadataOk() (map[string]string, bool) {
if o == nil || IsNil(o.Metadata) {
return map[string]string{}, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *RecallResult) HasMetadata() bool {
if o != nil && !IsNil(o.Metadata) {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field.
func (o *RecallResult) SetMetadata(v map[string]string) {
o.Metadata = v
}
// GetChunkId returns the ChunkId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetChunkId() string {
if o == nil || IsNil(o.ChunkId.Get()) {
var ret string
return ret
}
return *o.ChunkId.Get()
}
// GetChunkIdOk returns a tuple with the ChunkId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetChunkIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ChunkId.Get(), o.ChunkId.IsSet()
}
// HasChunkId returns a boolean if a field has been set.
func (o *RecallResult) HasChunkId() bool {
if o != nil && o.ChunkId.IsSet() {
return true
}
return false
}
// SetChunkId gets a reference to the given NullableString and assigns it to the ChunkId field.
func (o *RecallResult) SetChunkId(v string) {
o.ChunkId.Set(&v)
}
// SetChunkIdNil sets the value for ChunkId to be an explicit nil
func (o *RecallResult) SetChunkIdNil() {
o.ChunkId.Set(nil)
}
// UnsetChunkId ensures that no value is present for ChunkId, not even an explicit nil
func (o *RecallResult) UnsetChunkId() {
o.ChunkId.Unset()
}
// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RecallResult) GetTags() []string {
if o == nil {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RecallResult) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *RecallResult) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *RecallResult) SetTags(v []string) {
o.Tags = v
}
func (o RecallResult) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RecallResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["text"] = o.Text
if o.Type.IsSet() {
toSerialize["type"] = o.Type.Get()
}
if o.Entities != nil {
toSerialize["entities"] = o.Entities
}
if o.Context.IsSet() {
toSerialize["context"] = o.Context.Get()
}
if o.OccurredStart.IsSet() {
toSerialize["occurred_start"] = o.OccurredStart.Get()
}
if o.OccurredEnd.IsSet() {
toSerialize["occurred_end"] = o.OccurredEnd.Get()
}
if o.MentionedAt.IsSet() {
toSerialize["mentioned_at"] = o.MentionedAt.Get()
}
if o.DocumentId.IsSet() {
toSerialize["document_id"] = o.DocumentId.Get()
}
if o.Metadata != nil {
toSerialize["metadata"] = o.Metadata
}
if o.ChunkId.IsSet() {
toSerialize["chunk_id"] = o.ChunkId.Get()
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
return toSerialize, nil
}
func (o *RecallResult) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"text",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varRecallResult := _RecallResult{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varRecallResult)
if err != nil {
return err
}
*o = RecallResult(varRecallResult)
return err
}
type NullableRecallResult struct {
value *RecallResult
isSet bool
}
func (v NullableRecallResult) Get() *RecallResult {
return v.value
}
func (v *NullableRecallResult) Set(val *RecallResult) {
v.value = val
v.isSet = true
}
func (v NullableRecallResult) IsSet() bool {
return v.isSet
}
func (v *NullableRecallResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRecallResult(val *RecallResult) *NullableRecallResult {
return &NullableRecallResult{value: val, isSet: true}
}
func (v NullableRecallResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRecallResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,201 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the ReflectBasedOn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectBasedOn{}
// ReflectBasedOn Evidence the response is based on: memories, mental models, and directives.
type ReflectBasedOn struct {
// Memory facts used to generate the response
Memories []ReflectFact `json:"memories,omitempty"`
// Mental models used during reflection
MentalModels []ReflectMentalModel `json:"mental_models,omitempty"`
// Directives applied during reflection
Directives []ReflectDirective `json:"directives,omitempty"`
}
// NewReflectBasedOn instantiates a new ReflectBasedOn object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectBasedOn() *ReflectBasedOn {
this := ReflectBasedOn{}
return &this
}
// NewReflectBasedOnWithDefaults instantiates a new ReflectBasedOn object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectBasedOnWithDefaults() *ReflectBasedOn {
this := ReflectBasedOn{}
return &this
}
// GetMemories returns the Memories field value if set, zero value otherwise.
func (o *ReflectBasedOn) GetMemories() []ReflectFact {
if o == nil || IsNil(o.Memories) {
var ret []ReflectFact
return ret
}
return o.Memories
}
// GetMemoriesOk returns a tuple with the Memories field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectBasedOn) GetMemoriesOk() ([]ReflectFact, bool) {
if o == nil || IsNil(o.Memories) {
return nil, false
}
return o.Memories, true
}
// HasMemories returns a boolean if a field has been set.
func (o *ReflectBasedOn) HasMemories() bool {
if o != nil && !IsNil(o.Memories) {
return true
}
return false
}
// SetMemories gets a reference to the given []ReflectFact and assigns it to the Memories field.
func (o *ReflectBasedOn) SetMemories(v []ReflectFact) {
o.Memories = v
}
// GetMentalModels returns the MentalModels field value if set, zero value otherwise.
func (o *ReflectBasedOn) GetMentalModels() []ReflectMentalModel {
if o == nil || IsNil(o.MentalModels) {
var ret []ReflectMentalModel
return ret
}
return o.MentalModels
}
// GetMentalModelsOk returns a tuple with the MentalModels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectBasedOn) GetMentalModelsOk() ([]ReflectMentalModel, bool) {
if o == nil || IsNil(o.MentalModels) {
return nil, false
}
return o.MentalModels, true
}
// HasMentalModels returns a boolean if a field has been set.
func (o *ReflectBasedOn) HasMentalModels() bool {
if o != nil && !IsNil(o.MentalModels) {
return true
}
return false
}
// SetMentalModels gets a reference to the given []ReflectMentalModel and assigns it to the MentalModels field.
func (o *ReflectBasedOn) SetMentalModels(v []ReflectMentalModel) {
o.MentalModels = v
}
// GetDirectives returns the Directives field value if set, zero value otherwise.
func (o *ReflectBasedOn) GetDirectives() []ReflectDirective {
if o == nil || IsNil(o.Directives) {
var ret []ReflectDirective
return ret
}
return o.Directives
}
// GetDirectivesOk returns a tuple with the Directives field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectBasedOn) GetDirectivesOk() ([]ReflectDirective, bool) {
if o == nil || IsNil(o.Directives) {
return nil, false
}
return o.Directives, true
}
// HasDirectives returns a boolean if a field has been set.
func (o *ReflectBasedOn) HasDirectives() bool {
if o != nil && !IsNil(o.Directives) {
return true
}
return false
}
// SetDirectives gets a reference to the given []ReflectDirective and assigns it to the Directives field.
func (o *ReflectBasedOn) SetDirectives(v []ReflectDirective) {
o.Directives = v
}
func (o ReflectBasedOn) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectBasedOn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Memories) {
toSerialize["memories"] = o.Memories
}
if !IsNil(o.MentalModels) {
toSerialize["mental_models"] = o.MentalModels
}
if !IsNil(o.Directives) {
toSerialize["directives"] = o.Directives
}
return toSerialize, nil
}
type NullableReflectBasedOn struct {
value *ReflectBasedOn
isSet bool
}
func (v NullableReflectBasedOn) Get() *ReflectBasedOn {
return v.value
}
func (v *NullableReflectBasedOn) Set(val *ReflectBasedOn) {
v.value = val
v.isSet = true
}
func (v NullableReflectBasedOn) IsSet() bool {
return v.isSet
}
func (v *NullableReflectBasedOn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectBasedOn(val *ReflectBasedOn) *NullableReflectBasedOn {
return &NullableReflectBasedOn{value: val, isSet: true}
}
func (v NullableReflectBasedOn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectBasedOn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,217 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ReflectDirective type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectDirective{}
// ReflectDirective A directive applied during reflect.
type ReflectDirective struct {
// Directive ID
Id string `json:"id"`
// Directive name
Name string `json:"name"`
// Directive content
Content string `json:"content"`
}
type _ReflectDirective ReflectDirective
// NewReflectDirective instantiates a new ReflectDirective object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectDirective(id string, name string, content string) *ReflectDirective {
this := ReflectDirective{}
this.Id = id
this.Name = name
this.Content = content
return &this
}
// NewReflectDirectiveWithDefaults instantiates a new ReflectDirective object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectDirectiveWithDefaults() *ReflectDirective {
this := ReflectDirective{}
return &this
}
// GetId returns the Id field value
func (o *ReflectDirective) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *ReflectDirective) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *ReflectDirective) SetId(v string) {
o.Id = v
}
// GetName returns the Name field value
func (o *ReflectDirective) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *ReflectDirective) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ReflectDirective) SetName(v string) {
o.Name = v
}
// GetContent returns the Content field value
func (o *ReflectDirective) GetContent() string {
if o == nil {
var ret string
return ret
}
return o.Content
}
// GetContentOk returns a tuple with the Content field value
// and a boolean to check if the value has been set.
func (o *ReflectDirective) GetContentOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Content, true
}
// SetContent sets field value
func (o *ReflectDirective) SetContent(v string) {
o.Content = v
}
func (o ReflectDirective) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectDirective) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["name"] = o.Name
toSerialize["content"] = o.Content
return toSerialize, nil
}
func (o *ReflectDirective) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"name",
"content",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varReflectDirective := _ReflectDirective{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varReflectDirective)
if err != nil {
return err
}
*o = ReflectDirective(varReflectDirective)
return err
}
type NullableReflectDirective struct {
value *ReflectDirective
isSet bool
}
func (v NullableReflectDirective) Get() *ReflectDirective {
return v.value
}
func (v *NullableReflectDirective) Set(val *ReflectDirective) {
v.value = val
v.isSet = true
}
func (v NullableReflectDirective) IsSet() bool {
return v.isSet
}
func (v *NullableReflectDirective) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectDirective(val *ReflectDirective) *NullableReflectDirective {
return &NullableReflectDirective{value: val, isSet: true}
}
func (v NullableReflectDirective) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectDirective) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,389 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ReflectFact type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectFact{}
// ReflectFact A fact used in think response.
type ReflectFact struct {
Id NullableString `json:"id,omitempty"`
// Fact text. When type='observation', this contains markdown-formatted consolidated knowledge
Text string `json:"text"`
Type NullableString `json:"type,omitempty"`
Context NullableString `json:"context,omitempty"`
OccurredStart NullableString `json:"occurred_start,omitempty"`
OccurredEnd NullableString `json:"occurred_end,omitempty"`
}
type _ReflectFact ReflectFact
// NewReflectFact instantiates a new ReflectFact object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectFact(text string) *ReflectFact {
this := ReflectFact{}
this.Text = text
return &this
}
// NewReflectFactWithDefaults instantiates a new ReflectFact object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectFactWithDefaults() *ReflectFact {
this := ReflectFact{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectFact) GetId() string {
if o == nil || IsNil(o.Id.Get()) {
var ret string
return ret
}
return *o.Id.Get()
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectFact) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Id.Get(), o.Id.IsSet()
}
// HasId returns a boolean if a field has been set.
func (o *ReflectFact) HasId() bool {
if o != nil && o.Id.IsSet() {
return true
}
return false
}
// SetId gets a reference to the given NullableString and assigns it to the Id field.
func (o *ReflectFact) SetId(v string) {
o.Id.Set(&v)
}
// SetIdNil sets the value for Id to be an explicit nil
func (o *ReflectFact) SetIdNil() {
o.Id.Set(nil)
}
// UnsetId ensures that no value is present for Id, not even an explicit nil
func (o *ReflectFact) UnsetId() {
o.Id.Unset()
}
// GetText returns the Text field value
func (o *ReflectFact) GetText() string {
if o == nil {
var ret string
return ret
}
return o.Text
}
// GetTextOk returns a tuple with the Text field value
// and a boolean to check if the value has been set.
func (o *ReflectFact) GetTextOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Text, true
}
// SetText sets field value
func (o *ReflectFact) SetText(v string) {
o.Text = v
}
// GetType returns the Type field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectFact) GetType() string {
if o == nil || IsNil(o.Type.Get()) {
var ret string
return ret
}
return *o.Type.Get()
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectFact) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Type.Get(), o.Type.IsSet()
}
// HasType returns a boolean if a field has been set.
func (o *ReflectFact) HasType() bool {
if o != nil && o.Type.IsSet() {
return true
}
return false
}
// SetType gets a reference to the given NullableString and assigns it to the Type field.
func (o *ReflectFact) SetType(v string) {
o.Type.Set(&v)
}
// SetTypeNil sets the value for Type to be an explicit nil
func (o *ReflectFact) SetTypeNil() {
o.Type.Set(nil)
}
// UnsetType ensures that no value is present for Type, not even an explicit nil
func (o *ReflectFact) UnsetType() {
o.Type.Unset()
}
// GetContext returns the Context field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectFact) GetContext() string {
if o == nil || IsNil(o.Context.Get()) {
var ret string
return ret
}
return *o.Context.Get()
}
// GetContextOk returns a tuple with the Context field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectFact) GetContextOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Context.Get(), o.Context.IsSet()
}
// HasContext returns a boolean if a field has been set.
func (o *ReflectFact) HasContext() bool {
if o != nil && o.Context.IsSet() {
return true
}
return false
}
// SetContext gets a reference to the given NullableString and assigns it to the Context field.
func (o *ReflectFact) SetContext(v string) {
o.Context.Set(&v)
}
// SetContextNil sets the value for Context to be an explicit nil
func (o *ReflectFact) SetContextNil() {
o.Context.Set(nil)
}
// UnsetContext ensures that no value is present for Context, not even an explicit nil
func (o *ReflectFact) UnsetContext() {
o.Context.Unset()
}
// GetOccurredStart returns the OccurredStart field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectFact) GetOccurredStart() string {
if o == nil || IsNil(o.OccurredStart.Get()) {
var ret string
return ret
}
return *o.OccurredStart.Get()
}
// GetOccurredStartOk returns a tuple with the OccurredStart field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectFact) GetOccurredStartOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.OccurredStart.Get(), o.OccurredStart.IsSet()
}
// HasOccurredStart returns a boolean if a field has been set.
func (o *ReflectFact) HasOccurredStart() bool {
if o != nil && o.OccurredStart.IsSet() {
return true
}
return false
}
// SetOccurredStart gets a reference to the given NullableString and assigns it to the OccurredStart field.
func (o *ReflectFact) SetOccurredStart(v string) {
o.OccurredStart.Set(&v)
}
// SetOccurredStartNil sets the value for OccurredStart to be an explicit nil
func (o *ReflectFact) SetOccurredStartNil() {
o.OccurredStart.Set(nil)
}
// UnsetOccurredStart ensures that no value is present for OccurredStart, not even an explicit nil
func (o *ReflectFact) UnsetOccurredStart() {
o.OccurredStart.Unset()
}
// GetOccurredEnd returns the OccurredEnd field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectFact) GetOccurredEnd() string {
if o == nil || IsNil(o.OccurredEnd.Get()) {
var ret string
return ret
}
return *o.OccurredEnd.Get()
}
// GetOccurredEndOk returns a tuple with the OccurredEnd field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectFact) GetOccurredEndOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.OccurredEnd.Get(), o.OccurredEnd.IsSet()
}
// HasOccurredEnd returns a boolean if a field has been set.
func (o *ReflectFact) HasOccurredEnd() bool {
if o != nil && o.OccurredEnd.IsSet() {
return true
}
return false
}
// SetOccurredEnd gets a reference to the given NullableString and assigns it to the OccurredEnd field.
func (o *ReflectFact) SetOccurredEnd(v string) {
o.OccurredEnd.Set(&v)
}
// SetOccurredEndNil sets the value for OccurredEnd to be an explicit nil
func (o *ReflectFact) SetOccurredEndNil() {
o.OccurredEnd.Set(nil)
}
// UnsetOccurredEnd ensures that no value is present for OccurredEnd, not even an explicit nil
func (o *ReflectFact) UnsetOccurredEnd() {
o.OccurredEnd.Unset()
}
func (o ReflectFact) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectFact) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Id.IsSet() {
toSerialize["id"] = o.Id.Get()
}
toSerialize["text"] = o.Text
if o.Type.IsSet() {
toSerialize["type"] = o.Type.Get()
}
if o.Context.IsSet() {
toSerialize["context"] = o.Context.Get()
}
if o.OccurredStart.IsSet() {
toSerialize["occurred_start"] = o.OccurredStart.Get()
}
if o.OccurredEnd.IsSet() {
toSerialize["occurred_end"] = o.OccurredEnd.Get()
}
return toSerialize, nil
}
func (o *ReflectFact) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"text",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varReflectFact := _ReflectFact{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varReflectFact)
if err != nil {
return err
}
*o = ReflectFact(varReflectFact)
return err
}
type NullableReflectFact struct {
value *ReflectFact
isSet bool
}
func (v NullableReflectFact) Get() *ReflectFact {
return v.value
}
func (v *NullableReflectFact) Set(val *ReflectFact) {
v.value = val
v.isSet = true
}
func (v NullableReflectFact) IsSet() bool {
return v.isSet
}
func (v *NullableReflectFact) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectFact(val *ReflectFact) *NullableReflectFact {
return &NullableReflectFact{value: val, isSet: true}
}
func (v NullableReflectFact) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectFact) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,173 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the ReflectIncludeOptions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectIncludeOptions{}
// ReflectIncludeOptions Options for including additional data in reflect results.
type ReflectIncludeOptions struct {
// Options for including facts (based_on) in reflect results.
Facts map[string]interface{} `json:"facts,omitempty"`
ToolCalls NullableToolCallsIncludeOptions `json:"tool_calls,omitempty"`
}
// NewReflectIncludeOptions instantiates a new ReflectIncludeOptions object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectIncludeOptions() *ReflectIncludeOptions {
this := ReflectIncludeOptions{}
return &this
}
// NewReflectIncludeOptionsWithDefaults instantiates a new ReflectIncludeOptions object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectIncludeOptionsWithDefaults() *ReflectIncludeOptions {
this := ReflectIncludeOptions{}
return &this
}
// GetFacts returns the Facts field value if set, zero value otherwise.
func (o *ReflectIncludeOptions) GetFacts() map[string]interface{} {
if o == nil || IsNil(o.Facts) {
var ret map[string]interface{}
return ret
}
return o.Facts
}
// GetFactsOk returns a tuple with the Facts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectIncludeOptions) GetFactsOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Facts) {
return map[string]interface{}{}, false
}
return o.Facts, true
}
// HasFacts returns a boolean if a field has been set.
func (o *ReflectIncludeOptions) HasFacts() bool {
if o != nil && !IsNil(o.Facts) {
return true
}
return false
}
// SetFacts gets a reference to the given map[string]interface{} and assigns it to the Facts field.
func (o *ReflectIncludeOptions) SetFacts(v map[string]interface{}) {
o.Facts = v
}
// GetToolCalls returns the ToolCalls field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectIncludeOptions) GetToolCalls() ToolCallsIncludeOptions {
if o == nil || IsNil(o.ToolCalls.Get()) {
var ret ToolCallsIncludeOptions
return ret
}
return *o.ToolCalls.Get()
}
// GetToolCallsOk returns a tuple with the ToolCalls field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectIncludeOptions) GetToolCallsOk() (*ToolCallsIncludeOptions, bool) {
if o == nil {
return nil, false
}
return o.ToolCalls.Get(), o.ToolCalls.IsSet()
}
// HasToolCalls returns a boolean if a field has been set.
func (o *ReflectIncludeOptions) HasToolCalls() bool {
if o != nil && o.ToolCalls.IsSet() {
return true
}
return false
}
// SetToolCalls gets a reference to the given NullableToolCallsIncludeOptions and assigns it to the ToolCalls field.
func (o *ReflectIncludeOptions) SetToolCalls(v ToolCallsIncludeOptions) {
o.ToolCalls.Set(&v)
}
// SetToolCallsNil sets the value for ToolCalls to be an explicit nil
func (o *ReflectIncludeOptions) SetToolCallsNil() {
o.ToolCalls.Set(nil)
}
// UnsetToolCalls ensures that no value is present for ToolCalls, not even an explicit nil
func (o *ReflectIncludeOptions) UnsetToolCalls() {
o.ToolCalls.Unset()
}
func (o ReflectIncludeOptions) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectIncludeOptions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Facts) {
toSerialize["facts"] = o.Facts
}
if o.ToolCalls.IsSet() {
toSerialize["tool_calls"] = o.ToolCalls.Get()
}
return toSerialize, nil
}
type NullableReflectIncludeOptions struct {
value *ReflectIncludeOptions
isSet bool
}
func (v NullableReflectIncludeOptions) Get() *ReflectIncludeOptions {
return v.value
}
func (v *NullableReflectIncludeOptions) Set(val *ReflectIncludeOptions) {
v.value = val
v.isSet = true
}
func (v NullableReflectIncludeOptions) IsSet() bool {
return v.isSet
}
func (v *NullableReflectIncludeOptions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectIncludeOptions(val *ReflectIncludeOptions) *NullableReflectIncludeOptions {
return &NullableReflectIncludeOptions{value: val, isSet: true}
}
func (v NullableReflectIncludeOptions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectIncludeOptions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,188 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ReflectLLMCall type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectLLMCall{}
// ReflectLLMCall An LLM call made during reflect agent execution.
type ReflectLLMCall struct {
// Call scope: agent_1, agent_2, final, etc.
Scope string `json:"scope"`
// Execution time in milliseconds
DurationMs int32 `json:"duration_ms"`
}
type _ReflectLLMCall ReflectLLMCall
// NewReflectLLMCall instantiates a new ReflectLLMCall object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectLLMCall(scope string, durationMs int32) *ReflectLLMCall {
this := ReflectLLMCall{}
this.Scope = scope
this.DurationMs = durationMs
return &this
}
// NewReflectLLMCallWithDefaults instantiates a new ReflectLLMCall object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectLLMCallWithDefaults() *ReflectLLMCall {
this := ReflectLLMCall{}
return &this
}
// GetScope returns the Scope field value
func (o *ReflectLLMCall) GetScope() string {
if o == nil {
var ret string
return ret
}
return o.Scope
}
// GetScopeOk returns a tuple with the Scope field value
// and a boolean to check if the value has been set.
func (o *ReflectLLMCall) GetScopeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Scope, true
}
// SetScope sets field value
func (o *ReflectLLMCall) SetScope(v string) {
o.Scope = v
}
// GetDurationMs returns the DurationMs field value
func (o *ReflectLLMCall) GetDurationMs() int32 {
if o == nil {
var ret int32
return ret
}
return o.DurationMs
}
// GetDurationMsOk returns a tuple with the DurationMs field value
// and a boolean to check if the value has been set.
func (o *ReflectLLMCall) GetDurationMsOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.DurationMs, true
}
// SetDurationMs sets field value
func (o *ReflectLLMCall) SetDurationMs(v int32) {
o.DurationMs = v
}
func (o ReflectLLMCall) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectLLMCall) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["scope"] = o.Scope
toSerialize["duration_ms"] = o.DurationMs
return toSerialize, nil
}
func (o *ReflectLLMCall) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"scope",
"duration_ms",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varReflectLLMCall := _ReflectLLMCall{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varReflectLLMCall)
if err != nil {
return err
}
*o = ReflectLLMCall(varReflectLLMCall)
return err
}
type NullableReflectLLMCall struct {
value *ReflectLLMCall
isSet bool
}
func (v NullableReflectLLMCall) Get() *ReflectLLMCall {
return v.value
}
func (v *NullableReflectLLMCall) Set(val *ReflectLLMCall) {
v.value = val
v.isSet = true
}
func (v NullableReflectLLMCall) IsSet() bool {
return v.isSet
}
func (v *NullableReflectLLMCall) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectLLMCall(val *ReflectLLMCall) *NullableReflectLLMCall {
return &NullableReflectLLMCall{value: val, isSet: true}
}
func (v NullableReflectLLMCall) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectLLMCall) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,234 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ReflectMentalModel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectMentalModel{}
// ReflectMentalModel A mental model used during reflect.
type ReflectMentalModel struct {
// Mental model ID
Id string `json:"id"`
// Mental model content
Text string `json:"text"`
Context NullableString `json:"context,omitempty"`
}
type _ReflectMentalModel ReflectMentalModel
// NewReflectMentalModel instantiates a new ReflectMentalModel object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectMentalModel(id string, text string) *ReflectMentalModel {
this := ReflectMentalModel{}
this.Id = id
this.Text = text
return &this
}
// NewReflectMentalModelWithDefaults instantiates a new ReflectMentalModel object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectMentalModelWithDefaults() *ReflectMentalModel {
this := ReflectMentalModel{}
return &this
}
// GetId returns the Id field value
func (o *ReflectMentalModel) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *ReflectMentalModel) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *ReflectMentalModel) SetId(v string) {
o.Id = v
}
// GetText returns the Text field value
func (o *ReflectMentalModel) GetText() string {
if o == nil {
var ret string
return ret
}
return o.Text
}
// GetTextOk returns a tuple with the Text field value
// and a boolean to check if the value has been set.
func (o *ReflectMentalModel) GetTextOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Text, true
}
// SetText sets field value
func (o *ReflectMentalModel) SetText(v string) {
o.Text = v
}
// GetContext returns the Context field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectMentalModel) GetContext() string {
if o == nil || IsNil(o.Context.Get()) {
var ret string
return ret
}
return *o.Context.Get()
}
// GetContextOk returns a tuple with the Context field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectMentalModel) GetContextOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Context.Get(), o.Context.IsSet()
}
// HasContext returns a boolean if a field has been set.
func (o *ReflectMentalModel) HasContext() bool {
if o != nil && o.Context.IsSet() {
return true
}
return false
}
// SetContext gets a reference to the given NullableString and assigns it to the Context field.
func (o *ReflectMentalModel) SetContext(v string) {
o.Context.Set(&v)
}
// SetContextNil sets the value for Context to be an explicit nil
func (o *ReflectMentalModel) SetContextNil() {
o.Context.Set(nil)
}
// UnsetContext ensures that no value is present for Context, not even an explicit nil
func (o *ReflectMentalModel) UnsetContext() {
o.Context.Unset()
}
func (o ReflectMentalModel) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectMentalModel) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["text"] = o.Text
if o.Context.IsSet() {
toSerialize["context"] = o.Context.Get()
}
return toSerialize, nil
}
func (o *ReflectMentalModel) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"text",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varReflectMentalModel := _ReflectMentalModel{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varReflectMentalModel)
if err != nil {
return err
}
*o = ReflectMentalModel(varReflectMentalModel)
return err
}
type NullableReflectMentalModel struct {
value *ReflectMentalModel
isSet bool
}
func (v NullableReflectMentalModel) Get() *ReflectMentalModel {
return v.value
}
func (v *NullableReflectMentalModel) Set(val *ReflectMentalModel) {
v.value = val
v.isSet = true
}
func (v NullableReflectMentalModel) IsSet() bool {
return v.isSet
}
func (v *NullableReflectMentalModel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectMentalModel(val *ReflectMentalModel) *NullableReflectMentalModel {
return &NullableReflectMentalModel{value: val, isSet: true}
}
func (v NullableReflectMentalModel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectMentalModel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,433 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ReflectRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectRequest{}
// ReflectRequest Request model for reflect endpoint.
type ReflectRequest struct {
Query string `json:"query"`
Budget *Budget `json:"budget,omitempty"`
Context NullableString `json:"context,omitempty"`
// Maximum tokens for the response
MaxTokens *int32 `json:"max_tokens,omitempty"`
// Options for including additional data (disabled by default)
Include *ReflectIncludeOptions `json:"include,omitempty"`
ResponseSchema map[string]interface{} `json:"response_schema,omitempty"`
Tags []string `json:"tags,omitempty"`
// How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).
TagsMatch *string `json:"tags_match,omitempty"`
}
type _ReflectRequest ReflectRequest
// NewReflectRequest instantiates a new ReflectRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectRequest(query string) *ReflectRequest {
this := ReflectRequest{}
this.Query = query
var maxTokens int32 = 4096
this.MaxTokens = &maxTokens
var tagsMatch string = "any"
this.TagsMatch = &tagsMatch
return &this
}
// NewReflectRequestWithDefaults instantiates a new ReflectRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectRequestWithDefaults() *ReflectRequest {
this := ReflectRequest{}
var maxTokens int32 = 4096
this.MaxTokens = &maxTokens
var tagsMatch string = "any"
this.TagsMatch = &tagsMatch
return &this
}
// GetQuery returns the Query field value
func (o *ReflectRequest) GetQuery() string {
if o == nil {
var ret string
return ret
}
return o.Query
}
// GetQueryOk returns a tuple with the Query field value
// and a boolean to check if the value has been set.
func (o *ReflectRequest) GetQueryOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Query, true
}
// SetQuery sets field value
func (o *ReflectRequest) SetQuery(v string) {
o.Query = v
}
// GetBudget returns the Budget field value if set, zero value otherwise.
func (o *ReflectRequest) GetBudget() Budget {
if o == nil || IsNil(o.Budget) {
var ret Budget
return ret
}
return *o.Budget
}
// GetBudgetOk returns a tuple with the Budget field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectRequest) GetBudgetOk() (*Budget, bool) {
if o == nil || IsNil(o.Budget) {
return nil, false
}
return o.Budget, true
}
// HasBudget returns a boolean if a field has been set.
func (o *ReflectRequest) HasBudget() bool {
if o != nil && !IsNil(o.Budget) {
return true
}
return false
}
// SetBudget gets a reference to the given Budget and assigns it to the Budget field.
func (o *ReflectRequest) SetBudget(v Budget) {
o.Budget = &v
}
// GetContext returns the Context field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectRequest) GetContext() string {
if o == nil || IsNil(o.Context.Get()) {
var ret string
return ret
}
return *o.Context.Get()
}
// GetContextOk returns a tuple with the Context field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectRequest) GetContextOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Context.Get(), o.Context.IsSet()
}
// HasContext returns a boolean if a field has been set.
func (o *ReflectRequest) HasContext() bool {
if o != nil && o.Context.IsSet() {
return true
}
return false
}
// SetContext gets a reference to the given NullableString and assigns it to the Context field.
func (o *ReflectRequest) SetContext(v string) {
o.Context.Set(&v)
}
// SetContextNil sets the value for Context to be an explicit nil
func (o *ReflectRequest) SetContextNil() {
o.Context.Set(nil)
}
// UnsetContext ensures that no value is present for Context, not even an explicit nil
func (o *ReflectRequest) UnsetContext() {
o.Context.Unset()
}
// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise.
func (o *ReflectRequest) GetMaxTokens() int32 {
if o == nil || IsNil(o.MaxTokens) {
var ret int32
return ret
}
return *o.MaxTokens
}
// GetMaxTokensOk returns a tuple with the MaxTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectRequest) GetMaxTokensOk() (*int32, bool) {
if o == nil || IsNil(o.MaxTokens) {
return nil, false
}
return o.MaxTokens, true
}
// HasMaxTokens returns a boolean if a field has been set.
func (o *ReflectRequest) HasMaxTokens() bool {
if o != nil && !IsNil(o.MaxTokens) {
return true
}
return false
}
// SetMaxTokens gets a reference to the given int32 and assigns it to the MaxTokens field.
func (o *ReflectRequest) SetMaxTokens(v int32) {
o.MaxTokens = &v
}
// GetInclude returns the Include field value if set, zero value otherwise.
func (o *ReflectRequest) GetInclude() ReflectIncludeOptions {
if o == nil || IsNil(o.Include) {
var ret ReflectIncludeOptions
return ret
}
return *o.Include
}
// GetIncludeOk returns a tuple with the Include field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectRequest) GetIncludeOk() (*ReflectIncludeOptions, bool) {
if o == nil || IsNil(o.Include) {
return nil, false
}
return o.Include, true
}
// HasInclude returns a boolean if a field has been set.
func (o *ReflectRequest) HasInclude() bool {
if o != nil && !IsNil(o.Include) {
return true
}
return false
}
// SetInclude gets a reference to the given ReflectIncludeOptions and assigns it to the Include field.
func (o *ReflectRequest) SetInclude(v ReflectIncludeOptions) {
o.Include = &v
}
// GetResponseSchema returns the ResponseSchema field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectRequest) GetResponseSchema() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.ResponseSchema
}
// GetResponseSchemaOk returns a tuple with the ResponseSchema field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectRequest) GetResponseSchemaOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.ResponseSchema) {
return map[string]interface{}{}, false
}
return o.ResponseSchema, true
}
// HasResponseSchema returns a boolean if a field has been set.
func (o *ReflectRequest) HasResponseSchema() bool {
if o != nil && !IsNil(o.ResponseSchema) {
return true
}
return false
}
// SetResponseSchema gets a reference to the given map[string]interface{} and assigns it to the ResponseSchema field.
func (o *ReflectRequest) SetResponseSchema(v map[string]interface{}) {
o.ResponseSchema = v
}
// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectRequest) GetTags() []string {
if o == nil {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectRequest) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *ReflectRequest) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *ReflectRequest) SetTags(v []string) {
o.Tags = v
}
// GetTagsMatch returns the TagsMatch field value if set, zero value otherwise.
func (o *ReflectRequest) GetTagsMatch() string {
if o == nil || IsNil(o.TagsMatch) {
var ret string
return ret
}
return *o.TagsMatch
}
// GetTagsMatchOk returns a tuple with the TagsMatch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectRequest) GetTagsMatchOk() (*string, bool) {
if o == nil || IsNil(o.TagsMatch) {
return nil, false
}
return o.TagsMatch, true
}
// HasTagsMatch returns a boolean if a field has been set.
func (o *ReflectRequest) HasTagsMatch() bool {
if o != nil && !IsNil(o.TagsMatch) {
return true
}
return false
}
// SetTagsMatch gets a reference to the given string and assigns it to the TagsMatch field.
func (o *ReflectRequest) SetTagsMatch(v string) {
o.TagsMatch = &v
}
func (o ReflectRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["query"] = o.Query
if !IsNil(o.Budget) {
toSerialize["budget"] = o.Budget
}
if o.Context.IsSet() {
toSerialize["context"] = o.Context.Get()
}
if !IsNil(o.MaxTokens) {
toSerialize["max_tokens"] = o.MaxTokens
}
if !IsNil(o.Include) {
toSerialize["include"] = o.Include
}
if o.ResponseSchema != nil {
toSerialize["response_schema"] = o.ResponseSchema
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
if !IsNil(o.TagsMatch) {
toSerialize["tags_match"] = o.TagsMatch
}
return toSerialize, nil
}
func (o *ReflectRequest) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"query",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varReflectRequest := _ReflectRequest{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varReflectRequest)
if err != nil {
return err
}
*o = ReflectRequest(varReflectRequest)
return err
}
type NullableReflectRequest struct {
value *ReflectRequest
isSet bool
}
func (v NullableReflectRequest) Get() *ReflectRequest {
return v.value
}
func (v *NullableReflectRequest) Set(val *ReflectRequest) {
v.value = val
v.isSet = true
}
func (v NullableReflectRequest) IsSet() bool {
return v.isSet
}
func (v *NullableReflectRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectRequest(val *ReflectRequest) *NullableReflectRequest {
return &NullableReflectRequest{value: val, isSet: true}
}
func (v NullableReflectRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,334 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ReflectResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectResponse{}
// ReflectResponse Response model for think endpoint.
type ReflectResponse struct {
// The reflect response as well-formatted markdown (headers, lists, bold/italic, code blocks, etc.)
Text string `json:"text"`
BasedOn NullableReflectBasedOn `json:"based_on,omitempty"`
StructuredOutput map[string]interface{} `json:"structured_output,omitempty"`
Usage NullableTokenUsage `json:"usage,omitempty"`
Trace NullableReflectTrace `json:"trace,omitempty"`
}
type _ReflectResponse ReflectResponse
// NewReflectResponse instantiates a new ReflectResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectResponse(text string) *ReflectResponse {
this := ReflectResponse{}
this.Text = text
return &this
}
// NewReflectResponseWithDefaults instantiates a new ReflectResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectResponseWithDefaults() *ReflectResponse {
this := ReflectResponse{}
return &this
}
// GetText returns the Text field value
func (o *ReflectResponse) GetText() string {
if o == nil {
var ret string
return ret
}
return o.Text
}
// GetTextOk returns a tuple with the Text field value
// and a boolean to check if the value has been set.
func (o *ReflectResponse) GetTextOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Text, true
}
// SetText sets field value
func (o *ReflectResponse) SetText(v string) {
o.Text = v
}
// GetBasedOn returns the BasedOn field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectResponse) GetBasedOn() ReflectBasedOn {
if o == nil || IsNil(o.BasedOn.Get()) {
var ret ReflectBasedOn
return ret
}
return *o.BasedOn.Get()
}
// GetBasedOnOk returns a tuple with the BasedOn field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectResponse) GetBasedOnOk() (*ReflectBasedOn, bool) {
if o == nil {
return nil, false
}
return o.BasedOn.Get(), o.BasedOn.IsSet()
}
// HasBasedOn returns a boolean if a field has been set.
func (o *ReflectResponse) HasBasedOn() bool {
if o != nil && o.BasedOn.IsSet() {
return true
}
return false
}
// SetBasedOn gets a reference to the given NullableReflectBasedOn and assigns it to the BasedOn field.
func (o *ReflectResponse) SetBasedOn(v ReflectBasedOn) {
o.BasedOn.Set(&v)
}
// SetBasedOnNil sets the value for BasedOn to be an explicit nil
func (o *ReflectResponse) SetBasedOnNil() {
o.BasedOn.Set(nil)
}
// UnsetBasedOn ensures that no value is present for BasedOn, not even an explicit nil
func (o *ReflectResponse) UnsetBasedOn() {
o.BasedOn.Unset()
}
// GetStructuredOutput returns the StructuredOutput field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectResponse) GetStructuredOutput() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.StructuredOutput
}
// GetStructuredOutputOk returns a tuple with the StructuredOutput field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectResponse) GetStructuredOutputOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.StructuredOutput) {
return map[string]interface{}{}, false
}
return o.StructuredOutput, true
}
// HasStructuredOutput returns a boolean if a field has been set.
func (o *ReflectResponse) HasStructuredOutput() bool {
if o != nil && !IsNil(o.StructuredOutput) {
return true
}
return false
}
// SetStructuredOutput gets a reference to the given map[string]interface{} and assigns it to the StructuredOutput field.
func (o *ReflectResponse) SetStructuredOutput(v map[string]interface{}) {
o.StructuredOutput = v
}
// GetUsage returns the Usage field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectResponse) GetUsage() TokenUsage {
if o == nil || IsNil(o.Usage.Get()) {
var ret TokenUsage
return ret
}
return *o.Usage.Get()
}
// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectResponse) GetUsageOk() (*TokenUsage, bool) {
if o == nil {
return nil, false
}
return o.Usage.Get(), o.Usage.IsSet()
}
// HasUsage returns a boolean if a field has been set.
func (o *ReflectResponse) HasUsage() bool {
if o != nil && o.Usage.IsSet() {
return true
}
return false
}
// SetUsage gets a reference to the given NullableTokenUsage and assigns it to the Usage field.
func (o *ReflectResponse) SetUsage(v TokenUsage) {
o.Usage.Set(&v)
}
// SetUsageNil sets the value for Usage to be an explicit nil
func (o *ReflectResponse) SetUsageNil() {
o.Usage.Set(nil)
}
// UnsetUsage ensures that no value is present for Usage, not even an explicit nil
func (o *ReflectResponse) UnsetUsage() {
o.Usage.Unset()
}
// GetTrace returns the Trace field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectResponse) GetTrace() ReflectTrace {
if o == nil || IsNil(o.Trace.Get()) {
var ret ReflectTrace
return ret
}
return *o.Trace.Get()
}
// GetTraceOk returns a tuple with the Trace field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectResponse) GetTraceOk() (*ReflectTrace, bool) {
if o == nil {
return nil, false
}
return o.Trace.Get(), o.Trace.IsSet()
}
// HasTrace returns a boolean if a field has been set.
func (o *ReflectResponse) HasTrace() bool {
if o != nil && o.Trace.IsSet() {
return true
}
return false
}
// SetTrace gets a reference to the given NullableReflectTrace and assigns it to the Trace field.
func (o *ReflectResponse) SetTrace(v ReflectTrace) {
o.Trace.Set(&v)
}
// SetTraceNil sets the value for Trace to be an explicit nil
func (o *ReflectResponse) SetTraceNil() {
o.Trace.Set(nil)
}
// UnsetTrace ensures that no value is present for Trace, not even an explicit nil
func (o *ReflectResponse) UnsetTrace() {
o.Trace.Unset()
}
func (o ReflectResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["text"] = o.Text
if o.BasedOn.IsSet() {
toSerialize["based_on"] = o.BasedOn.Get()
}
if o.StructuredOutput != nil {
toSerialize["structured_output"] = o.StructuredOutput
}
if o.Usage.IsSet() {
toSerialize["usage"] = o.Usage.Get()
}
if o.Trace.IsSet() {
toSerialize["trace"] = o.Trace.Get()
}
return toSerialize, nil
}
func (o *ReflectResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"text",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varReflectResponse := _ReflectResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varReflectResponse)
if err != nil {
return err
}
*o = ReflectResponse(varReflectResponse)
return err
}
type NullableReflectResponse struct {
value *ReflectResponse
isSet bool
}
func (v NullableReflectResponse) Get() *ReflectResponse {
return v.value
}
func (v *NullableReflectResponse) Set(val *ReflectResponse) {
v.value = val
v.isSet = true
}
func (v NullableReflectResponse) IsSet() bool {
return v.isSet
}
func (v *NullableReflectResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectResponse(val *ReflectResponse) *NullableReflectResponse {
return &NullableReflectResponse{value: val, isSet: true}
}
func (v NullableReflectResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,295 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the ReflectToolCall type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectToolCall{}
// ReflectToolCall A tool call made during reflect agent execution.
type ReflectToolCall struct {
// Tool name: lookup, recall, learn, expand
Tool string `json:"tool"`
// Tool input parameters
Input map[string]interface{} `json:"input"`
Output map[string]interface{} `json:"output,omitempty"`
// Execution time in milliseconds
DurationMs int32 `json:"duration_ms"`
// Iteration number (1-based) when this tool was called
Iteration *int32 `json:"iteration,omitempty"`
}
type _ReflectToolCall ReflectToolCall
// NewReflectToolCall instantiates a new ReflectToolCall object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectToolCall(tool string, input map[string]interface{}, durationMs int32) *ReflectToolCall {
this := ReflectToolCall{}
this.Tool = tool
this.Input = input
this.DurationMs = durationMs
var iteration int32 = 0
this.Iteration = &iteration
return &this
}
// NewReflectToolCallWithDefaults instantiates a new ReflectToolCall object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectToolCallWithDefaults() *ReflectToolCall {
this := ReflectToolCall{}
var iteration int32 = 0
this.Iteration = &iteration
return &this
}
// GetTool returns the Tool field value
func (o *ReflectToolCall) GetTool() string {
if o == nil {
var ret string
return ret
}
return o.Tool
}
// GetToolOk returns a tuple with the Tool field value
// and a boolean to check if the value has been set.
func (o *ReflectToolCall) GetToolOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Tool, true
}
// SetTool sets field value
func (o *ReflectToolCall) SetTool(v string) {
o.Tool = v
}
// GetInput returns the Input field value
func (o *ReflectToolCall) GetInput() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Input
}
// GetInputOk returns a tuple with the Input field value
// and a boolean to check if the value has been set.
func (o *ReflectToolCall) GetInputOk() (map[string]interface{}, bool) {
if o == nil {
return map[string]interface{}{}, false
}
return o.Input, true
}
// SetInput sets field value
func (o *ReflectToolCall) SetInput(v map[string]interface{}) {
o.Input = v
}
// GetOutput returns the Output field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ReflectToolCall) GetOutput() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Output
}
// GetOutputOk returns a tuple with the Output field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReflectToolCall) GetOutputOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Output) {
return map[string]interface{}{}, false
}
return o.Output, true
}
// HasOutput returns a boolean if a field has been set.
func (o *ReflectToolCall) HasOutput() bool {
if o != nil && !IsNil(o.Output) {
return true
}
return false
}
// SetOutput gets a reference to the given map[string]interface{} and assigns it to the Output field.
func (o *ReflectToolCall) SetOutput(v map[string]interface{}) {
o.Output = v
}
// GetDurationMs returns the DurationMs field value
func (o *ReflectToolCall) GetDurationMs() int32 {
if o == nil {
var ret int32
return ret
}
return o.DurationMs
}
// GetDurationMsOk returns a tuple with the DurationMs field value
// and a boolean to check if the value has been set.
func (o *ReflectToolCall) GetDurationMsOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.DurationMs, true
}
// SetDurationMs sets field value
func (o *ReflectToolCall) SetDurationMs(v int32) {
o.DurationMs = v
}
// GetIteration returns the Iteration field value if set, zero value otherwise.
func (o *ReflectToolCall) GetIteration() int32 {
if o == nil || IsNil(o.Iteration) {
var ret int32
return ret
}
return *o.Iteration
}
// GetIterationOk returns a tuple with the Iteration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectToolCall) GetIterationOk() (*int32, bool) {
if o == nil || IsNil(o.Iteration) {
return nil, false
}
return o.Iteration, true
}
// HasIteration returns a boolean if a field has been set.
func (o *ReflectToolCall) HasIteration() bool {
if o != nil && !IsNil(o.Iteration) {
return true
}
return false
}
// SetIteration gets a reference to the given int32 and assigns it to the Iteration field.
func (o *ReflectToolCall) SetIteration(v int32) {
o.Iteration = &v
}
func (o ReflectToolCall) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectToolCall) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["tool"] = o.Tool
toSerialize["input"] = o.Input
if o.Output != nil {
toSerialize["output"] = o.Output
}
toSerialize["duration_ms"] = o.DurationMs
if !IsNil(o.Iteration) {
toSerialize["iteration"] = o.Iteration
}
return toSerialize, nil
}
func (o *ReflectToolCall) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"tool",
"input",
"duration_ms",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varReflectToolCall := _ReflectToolCall{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varReflectToolCall)
if err != nil {
return err
}
*o = ReflectToolCall(varReflectToolCall)
return err
}
type NullableReflectToolCall struct {
value *ReflectToolCall
isSet bool
}
func (v NullableReflectToolCall) Get() *ReflectToolCall {
return v.value
}
func (v *NullableReflectToolCall) Set(val *ReflectToolCall) {
v.value = val
v.isSet = true
}
func (v NullableReflectToolCall) IsSet() bool {
return v.isSet
}
func (v *NullableReflectToolCall) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectToolCall(val *ReflectToolCall) *NullableReflectToolCall {
return &NullableReflectToolCall{value: val, isSet: true}
}
func (v NullableReflectToolCall) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectToolCall) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,164 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the ReflectTrace type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReflectTrace{}
// ReflectTrace Execution trace of LLM and tool calls during reflection.
type ReflectTrace struct {
// Tool calls made during reflection
ToolCalls []ReflectToolCall `json:"tool_calls,omitempty"`
// LLM calls made during reflection
LlmCalls []ReflectLLMCall `json:"llm_calls,omitempty"`
}
// NewReflectTrace instantiates a new ReflectTrace object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReflectTrace() *ReflectTrace {
this := ReflectTrace{}
return &this
}
// NewReflectTraceWithDefaults instantiates a new ReflectTrace object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReflectTraceWithDefaults() *ReflectTrace {
this := ReflectTrace{}
return &this
}
// GetToolCalls returns the ToolCalls field value if set, zero value otherwise.
func (o *ReflectTrace) GetToolCalls() []ReflectToolCall {
if o == nil || IsNil(o.ToolCalls) {
var ret []ReflectToolCall
return ret
}
return o.ToolCalls
}
// GetToolCallsOk returns a tuple with the ToolCalls field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectTrace) GetToolCallsOk() ([]ReflectToolCall, bool) {
if o == nil || IsNil(o.ToolCalls) {
return nil, false
}
return o.ToolCalls, true
}
// HasToolCalls returns a boolean if a field has been set.
func (o *ReflectTrace) HasToolCalls() bool {
if o != nil && !IsNil(o.ToolCalls) {
return true
}
return false
}
// SetToolCalls gets a reference to the given []ReflectToolCall and assigns it to the ToolCalls field.
func (o *ReflectTrace) SetToolCalls(v []ReflectToolCall) {
o.ToolCalls = v
}
// GetLlmCalls returns the LlmCalls field value if set, zero value otherwise.
func (o *ReflectTrace) GetLlmCalls() []ReflectLLMCall {
if o == nil || IsNil(o.LlmCalls) {
var ret []ReflectLLMCall
return ret
}
return o.LlmCalls
}
// GetLlmCallsOk returns a tuple with the LlmCalls field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReflectTrace) GetLlmCallsOk() ([]ReflectLLMCall, bool) {
if o == nil || IsNil(o.LlmCalls) {
return nil, false
}
return o.LlmCalls, true
}
// HasLlmCalls returns a boolean if a field has been set.
func (o *ReflectTrace) HasLlmCalls() bool {
if o != nil && !IsNil(o.LlmCalls) {
return true
}
return false
}
// SetLlmCalls gets a reference to the given []ReflectLLMCall and assigns it to the LlmCalls field.
func (o *ReflectTrace) SetLlmCalls(v []ReflectLLMCall) {
o.LlmCalls = v
}
func (o ReflectTrace) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReflectTrace) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ToolCalls) {
toSerialize["tool_calls"] = o.ToolCalls
}
if !IsNil(o.LlmCalls) {
toSerialize["llm_calls"] = o.LlmCalls
}
return toSerialize, nil
}
type NullableReflectTrace struct {
value *ReflectTrace
isSet bool
}
func (v NullableReflectTrace) Get() *ReflectTrace {
return v.value
}
func (v *NullableReflectTrace) Set(val *ReflectTrace) {
v.value = val
v.isSet = true
}
func (v NullableReflectTrace) IsSet() bool {
return v.isSet
}
func (v *NullableReflectTrace) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReflectTrace(val *ReflectTrace) *NullableReflectTrace {
return &NullableReflectTrace{value: val, isSet: true}
}
func (v NullableReflectTrace) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReflectTrace) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,236 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the RetainRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RetainRequest{}
// RetainRequest Request model for retain endpoint.
type RetainRequest struct {
Items []MemoryItem `json:"items"`
// If true, process asynchronously in background. If false, wait for completion (default: false)
Async *bool `json:"async,omitempty"`
DocumentTags []string `json:"document_tags,omitempty"`
}
type _RetainRequest RetainRequest
// NewRetainRequest instantiates a new RetainRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewRetainRequest(items []MemoryItem) *RetainRequest {
this := RetainRequest{}
this.Items = items
var async bool = false
this.Async = &async
return &this
}
// NewRetainRequestWithDefaults instantiates a new RetainRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewRetainRequestWithDefaults() *RetainRequest {
this := RetainRequest{}
var async bool = false
this.Async = &async
return &this
}
// GetItems returns the Items field value
func (o *RetainRequest) GetItems() []MemoryItem {
if o == nil {
var ret []MemoryItem
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value
// and a boolean to check if the value has been set.
func (o *RetainRequest) GetItemsOk() ([]MemoryItem, bool) {
if o == nil {
return nil, false
}
return o.Items, true
}
// SetItems sets field value
func (o *RetainRequest) SetItems(v []MemoryItem) {
o.Items = v
}
// GetAsync returns the Async field value if set, zero value otherwise.
func (o *RetainRequest) GetAsync() bool {
if o == nil || IsNil(o.Async) {
var ret bool
return ret
}
return *o.Async
}
// GetAsyncOk returns a tuple with the Async field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RetainRequest) GetAsyncOk() (*bool, bool) {
if o == nil || IsNil(o.Async) {
return nil, false
}
return o.Async, true
}
// HasAsync returns a boolean if a field has been set.
func (o *RetainRequest) HasAsync() bool {
if o != nil && !IsNil(o.Async) {
return true
}
return false
}
// SetAsync gets a reference to the given bool and assigns it to the Async field.
func (o *RetainRequest) SetAsync(v bool) {
o.Async = &v
}
// GetDocumentTags returns the DocumentTags field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RetainRequest) GetDocumentTags() []string {
if o == nil {
var ret []string
return ret
}
return o.DocumentTags
}
// GetDocumentTagsOk returns a tuple with the DocumentTags field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RetainRequest) GetDocumentTagsOk() ([]string, bool) {
if o == nil || IsNil(o.DocumentTags) {
return nil, false
}
return o.DocumentTags, true
}
// HasDocumentTags returns a boolean if a field has been set.
func (o *RetainRequest) HasDocumentTags() bool {
if o != nil && !IsNil(o.DocumentTags) {
return true
}
return false
}
// SetDocumentTags gets a reference to the given []string and assigns it to the DocumentTags field.
func (o *RetainRequest) SetDocumentTags(v []string) {
o.DocumentTags = v
}
func (o RetainRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RetainRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["items"] = o.Items
if !IsNil(o.Async) {
toSerialize["async"] = o.Async
}
if o.DocumentTags != nil {
toSerialize["document_tags"] = o.DocumentTags
}
return toSerialize, nil
}
func (o *RetainRequest) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"items",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varRetainRequest := _RetainRequest{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varRetainRequest)
if err != nil {
return err
}
*o = RetainRequest(varRetainRequest)
return err
}
type NullableRetainRequest struct {
value *RetainRequest
isSet bool
}
func (v NullableRetainRequest) Get() *RetainRequest {
return v.value
}
func (v *NullableRetainRequest) Set(val *RetainRequest) {
v.value = val
v.isSet = true
}
func (v NullableRetainRequest) IsSet() bool {
return v.isSet
}
func (v *NullableRetainRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRetainRequest(val *RetainRequest) *NullableRetainRequest {
return &NullableRetainRequest{value: val, isSet: true}
}
func (v NullableRetainRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRetainRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,335 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the RetainResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RetainResponse{}
// RetainResponse Response model for retain endpoint.
type RetainResponse struct {
Success bool `json:"success"`
BankId string `json:"bank_id"`
ItemsCount int32 `json:"items_count"`
// Whether the operation was processed asynchronously
Async bool `json:"async"`
OperationId NullableString `json:"operation_id,omitempty"`
Usage NullableTokenUsage `json:"usage,omitempty"`
}
type _RetainResponse RetainResponse
// NewRetainResponse instantiates a new RetainResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewRetainResponse(success bool, bankId string, itemsCount int32, async bool) *RetainResponse {
this := RetainResponse{}
this.Success = success
this.BankId = bankId
this.ItemsCount = itemsCount
this.Async = async
return &this
}
// NewRetainResponseWithDefaults instantiates a new RetainResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewRetainResponseWithDefaults() *RetainResponse {
this := RetainResponse{}
return &this
}
// GetSuccess returns the Success field value
func (o *RetainResponse) GetSuccess() bool {
if o == nil {
var ret bool
return ret
}
return o.Success
}
// GetSuccessOk returns a tuple with the Success field value
// and a boolean to check if the value has been set.
func (o *RetainResponse) GetSuccessOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Success, true
}
// SetSuccess sets field value
func (o *RetainResponse) SetSuccess(v bool) {
o.Success = v
}
// GetBankId returns the BankId field value
func (o *RetainResponse) GetBankId() string {
if o == nil {
var ret string
return ret
}
return o.BankId
}
// GetBankIdOk returns a tuple with the BankId field value
// and a boolean to check if the value has been set.
func (o *RetainResponse) GetBankIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BankId, true
}
// SetBankId sets field value
func (o *RetainResponse) SetBankId(v string) {
o.BankId = v
}
// GetItemsCount returns the ItemsCount field value
func (o *RetainResponse) GetItemsCount() int32 {
if o == nil {
var ret int32
return ret
}
return o.ItemsCount
}
// GetItemsCountOk returns a tuple with the ItemsCount field value
// and a boolean to check if the value has been set.
func (o *RetainResponse) GetItemsCountOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.ItemsCount, true
}
// SetItemsCount sets field value
func (o *RetainResponse) SetItemsCount(v int32) {
o.ItemsCount = v
}
// GetAsync returns the Async field value
func (o *RetainResponse) GetAsync() bool {
if o == nil {
var ret bool
return ret
}
return o.Async
}
// GetAsyncOk returns a tuple with the Async field value
// and a boolean to check if the value has been set.
func (o *RetainResponse) GetAsyncOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Async, true
}
// SetAsync sets field value
func (o *RetainResponse) SetAsync(v bool) {
o.Async = v
}
// GetOperationId returns the OperationId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RetainResponse) GetOperationId() string {
if o == nil || IsNil(o.OperationId.Get()) {
var ret string
return ret
}
return *o.OperationId.Get()
}
// GetOperationIdOk returns a tuple with the OperationId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RetainResponse) GetOperationIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.OperationId.Get(), o.OperationId.IsSet()
}
// HasOperationId returns a boolean if a field has been set.
func (o *RetainResponse) HasOperationId() bool {
if o != nil && o.OperationId.IsSet() {
return true
}
return false
}
// SetOperationId gets a reference to the given NullableString and assigns it to the OperationId field.
func (o *RetainResponse) SetOperationId(v string) {
o.OperationId.Set(&v)
}
// SetOperationIdNil sets the value for OperationId to be an explicit nil
func (o *RetainResponse) SetOperationIdNil() {
o.OperationId.Set(nil)
}
// UnsetOperationId ensures that no value is present for OperationId, not even an explicit nil
func (o *RetainResponse) UnsetOperationId() {
o.OperationId.Unset()
}
// GetUsage returns the Usage field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *RetainResponse) GetUsage() TokenUsage {
if o == nil || IsNil(o.Usage.Get()) {
var ret TokenUsage
return ret
}
return *o.Usage.Get()
}
// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RetainResponse) GetUsageOk() (*TokenUsage, bool) {
if o == nil {
return nil, false
}
return o.Usage.Get(), o.Usage.IsSet()
}
// HasUsage returns a boolean if a field has been set.
func (o *RetainResponse) HasUsage() bool {
if o != nil && o.Usage.IsSet() {
return true
}
return false
}
// SetUsage gets a reference to the given NullableTokenUsage and assigns it to the Usage field.
func (o *RetainResponse) SetUsage(v TokenUsage) {
o.Usage.Set(&v)
}
// SetUsageNil sets the value for Usage to be an explicit nil
func (o *RetainResponse) SetUsageNil() {
o.Usage.Set(nil)
}
// UnsetUsage ensures that no value is present for Usage, not even an explicit nil
func (o *RetainResponse) UnsetUsage() {
o.Usage.Unset()
}
func (o RetainResponse) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RetainResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["success"] = o.Success
toSerialize["bank_id"] = o.BankId
toSerialize["items_count"] = o.ItemsCount
toSerialize["async"] = o.Async
if o.OperationId.IsSet() {
toSerialize["operation_id"] = o.OperationId.Get()
}
if o.Usage.IsSet() {
toSerialize["usage"] = o.Usage.Get()
}
return toSerialize, nil
}
func (o *RetainResponse) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"success",
"bank_id",
"items_count",
"async",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varRetainResponse := _RetainResponse{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varRetainResponse)
if err != nil {
return err
}
*o = RetainResponse(varRetainResponse)
return err
}
type NullableRetainResponse struct {
value *RetainResponse
isSet bool
}
func (v NullableRetainResponse) Get() *RetainResponse {
return v.value
}
func (v *NullableRetainResponse) Set(val *RetainResponse) {
v.value = val
v.isSet = true
}
func (v NullableRetainResponse) IsSet() bool {
return v.isSet
}
func (v *NullableRetainResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRetainResponse(val *RetainResponse) *NullableRetainResponse {
return &NullableRetainResponse{value: val, isSet: true}
}
func (v NullableRetainResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRetainResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,188 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the TagItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagItem{}
// TagItem Single tag with usage count.
type TagItem struct {
// The tag value
Tag string `json:"tag"`
// Number of memories with this tag
Count int32 `json:"count"`
}
type _TagItem TagItem
// NewTagItem instantiates a new TagItem object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTagItem(tag string, count int32) *TagItem {
this := TagItem{}
this.Tag = tag
this.Count = count
return &this
}
// NewTagItemWithDefaults instantiates a new TagItem object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTagItemWithDefaults() *TagItem {
this := TagItem{}
return &this
}
// GetTag returns the Tag field value
func (o *TagItem) GetTag() string {
if o == nil {
var ret string
return ret
}
return o.Tag
}
// GetTagOk returns a tuple with the Tag field value
// and a boolean to check if the value has been set.
func (o *TagItem) GetTagOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Tag, true
}
// SetTag sets field value
func (o *TagItem) SetTag(v string) {
o.Tag = v
}
// GetCount returns the Count field value
func (o *TagItem) GetCount() int32 {
if o == nil {
var ret int32
return ret
}
return o.Count
}
// GetCountOk returns a tuple with the Count field value
// and a boolean to check if the value has been set.
func (o *TagItem) GetCountOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Count, true
}
// SetCount sets field value
func (o *TagItem) SetCount(v int32) {
o.Count = v
}
func (o TagItem) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TagItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["tag"] = o.Tag
toSerialize["count"] = o.Count
return toSerialize, nil
}
func (o *TagItem) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"tag",
"count",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varTagItem := _TagItem{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varTagItem)
if err != nil {
return err
}
*o = TagItem(varTagItem)
return err
}
type NullableTagItem struct {
value *TagItem
isSet bool
}
func (v NullableTagItem) Get() *TagItem {
return v.value
}
func (v *NullableTagItem) Set(val *TagItem) {
v.value = val
v.isSet = true
}
func (v NullableTagItem) IsSet() bool {
return v.isSet
}
func (v *NullableTagItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTagItem(val *TagItem) *NullableTagItem {
return &NullableTagItem{value: val, isSet: true}
}
func (v NullableTagItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTagItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,213 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the TokenUsage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TokenUsage{}
// TokenUsage Token usage metrics for LLM calls. Tracks input/output tokens for a single request to enable per-request cost tracking and monitoring.
type TokenUsage struct {
// Number of input/prompt tokens consumed
InputTokens *int32 `json:"input_tokens,omitempty"`
// Number of output/completion tokens generated
OutputTokens *int32 `json:"output_tokens,omitempty"`
// Total tokens (input + output)
TotalTokens *int32 `json:"total_tokens,omitempty"`
}
// NewTokenUsage instantiates a new TokenUsage object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewTokenUsage() *TokenUsage {
this := TokenUsage{}
var inputTokens int32 = 0
this.InputTokens = &inputTokens
var outputTokens int32 = 0
this.OutputTokens = &outputTokens
var totalTokens int32 = 0
this.TotalTokens = &totalTokens
return &this
}
// NewTokenUsageWithDefaults instantiates a new TokenUsage object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewTokenUsageWithDefaults() *TokenUsage {
this := TokenUsage{}
var inputTokens int32 = 0
this.InputTokens = &inputTokens
var outputTokens int32 = 0
this.OutputTokens = &outputTokens
var totalTokens int32 = 0
this.TotalTokens = &totalTokens
return &this
}
// GetInputTokens returns the InputTokens field value if set, zero value otherwise.
func (o *TokenUsage) GetInputTokens() int32 {
if o == nil || IsNil(o.InputTokens) {
var ret int32
return ret
}
return *o.InputTokens
}
// GetInputTokensOk returns a tuple with the InputTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TokenUsage) GetInputTokensOk() (*int32, bool) {
if o == nil || IsNil(o.InputTokens) {
return nil, false
}
return o.InputTokens, true
}
// HasInputTokens returns a boolean if a field has been set.
func (o *TokenUsage) HasInputTokens() bool {
if o != nil && !IsNil(o.InputTokens) {
return true
}
return false
}
// SetInputTokens gets a reference to the given int32 and assigns it to the InputTokens field.
func (o *TokenUsage) SetInputTokens(v int32) {
o.InputTokens = &v
}
// GetOutputTokens returns the OutputTokens field value if set, zero value otherwise.
func (o *TokenUsage) GetOutputTokens() int32 {
if o == nil || IsNil(o.OutputTokens) {
var ret int32
return ret
}
return *o.OutputTokens
}
// GetOutputTokensOk returns a tuple with the OutputTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TokenUsage) GetOutputTokensOk() (*int32, bool) {
if o == nil || IsNil(o.OutputTokens) {
return nil, false
}
return o.OutputTokens, true
}
// HasOutputTokens returns a boolean if a field has been set.
func (o *TokenUsage) HasOutputTokens() bool {
if o != nil && !IsNil(o.OutputTokens) {
return true
}
return false
}
// SetOutputTokens gets a reference to the given int32 and assigns it to the OutputTokens field.
func (o *TokenUsage) SetOutputTokens(v int32) {
o.OutputTokens = &v
}
// GetTotalTokens returns the TotalTokens field value if set, zero value otherwise.
func (o *TokenUsage) GetTotalTokens() int32 {
if o == nil || IsNil(o.TotalTokens) {
var ret int32
return ret
}
return *o.TotalTokens
}
// GetTotalTokensOk returns a tuple with the TotalTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TokenUsage) GetTotalTokensOk() (*int32, bool) {
if o == nil || IsNil(o.TotalTokens) {
return nil, false
}
return o.TotalTokens, true
}
// HasTotalTokens returns a boolean if a field has been set.
func (o *TokenUsage) HasTotalTokens() bool {
if o != nil && !IsNil(o.TotalTokens) {
return true
}
return false
}
// SetTotalTokens gets a reference to the given int32 and assigns it to the TotalTokens field.
func (o *TokenUsage) SetTotalTokens(v int32) {
o.TotalTokens = &v
}
func (o TokenUsage) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TokenUsage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.InputTokens) {
toSerialize["input_tokens"] = o.InputTokens
}
if !IsNil(o.OutputTokens) {
toSerialize["output_tokens"] = o.OutputTokens
}
if !IsNil(o.TotalTokens) {
toSerialize["total_tokens"] = o.TotalTokens
}
return toSerialize, nil
}
type NullableTokenUsage struct {
value *TokenUsage
isSet bool
}
func (v NullableTokenUsage) Get() *TokenUsage {
return v.value
}
func (v *NullableTokenUsage) Set(val *TokenUsage) {
v.value = val
v.isSet = true
}
func (v NullableTokenUsage) IsSet() bool {
return v.isSet
}
func (v *NullableTokenUsage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTokenUsage(val *TokenUsage) *NullableTokenUsage {
return &NullableTokenUsage{value: val, isSet: true}
}
func (v NullableTokenUsage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTokenUsage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,131 @@
/*
Hindsight HTTP API
HTTP API for Hindsight
API version: 0.4.11
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hindsight
import (
"encoding/json"
)
// checks if the ToolCallsIncludeOptions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolCallsIncludeOptions{}
// ToolCallsIncludeOptions Options for including tool calls in reflect results.
type ToolCallsIncludeOptions struct {
// Include tool outputs in the trace. Set to false to only include inputs (smaller payload).
Output *bool `json:"output,omitempty"`
}
// NewToolCallsIncludeOptions instantiates a new ToolCallsIncludeOptions object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewToolCallsIncludeOptions() *ToolCallsIncludeOptions {
this := ToolCallsIncludeOptions{}
var output bool = true
this.Output = &output
return &this
}
// NewToolCallsIncludeOptionsWithDefaults instantiates a new ToolCallsIncludeOptions object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewToolCallsIncludeOptionsWithDefaults() *ToolCallsIncludeOptions {
this := ToolCallsIncludeOptions{}
var output bool = true
this.Output = &output
return &this
}
// GetOutput returns the Output field value if set, zero value otherwise.
func (o *ToolCallsIncludeOptions) GetOutput() bool {
if o == nil || IsNil(o.Output) {
var ret bool
return ret
}
return *o.Output
}
// GetOutputOk returns a tuple with the Output field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolCallsIncludeOptions) GetOutputOk() (*bool, bool) {
if o == nil || IsNil(o.Output) {
return nil, false
}
return o.Output, true
}
// HasOutput returns a boolean if a field has been set.
func (o *ToolCallsIncludeOptions) HasOutput() bool {
if o != nil && !IsNil(o.Output) {
return true
}
return false
}
// SetOutput gets a reference to the given bool and assigns it to the Output field.
func (o *ToolCallsIncludeOptions) SetOutput(v bool) {
o.Output = &v
}
func (o ToolCallsIncludeOptions) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolCallsIncludeOptions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Output) {
toSerialize["output"] = o.Output
}
return toSerialize, nil
}
type NullableToolCallsIncludeOptions struct {
value *ToolCallsIncludeOptions
isSet bool
}
func (v NullableToolCallsIncludeOptions) Get() *ToolCallsIncludeOptions {
return v.value
}
func (v *NullableToolCallsIncludeOptions) Set(val *ToolCallsIncludeOptions) {
v.value = val
v.isSet = true
}
func (v NullableToolCallsIncludeOptions) IsSet() bool {
return v.isSet
}
func (v *NullableToolCallsIncludeOptions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolCallsIncludeOptions(val *ToolCallsIncludeOptions) *NullableToolCallsIncludeOptions {
return &NullableToolCallsIncludeOptions{value: val, isSet: true}
}
func (v NullableToolCallsIncludeOptions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolCallsIncludeOptions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

Some files were not shown because too many files have changed in this diff Show more