diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index b7a11e2..193ac7f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -32,6 +32,7 @@ api_domains.go api_environments.go api_headers.go api_kv.go +api_open_ai_compatibility.go api_organizations.go api_projects.go api_purge.go @@ -71,6 +72,7 @@ docs/AiSearchSearchRequest.md docs/AiSearchTriggerCrawlRequest.md docs/AiSearchUpdateSettingsRequest.md docs/Application.md +docs/ApplicationCache.md docs/ApplicationDatabase.md docs/ApplicationDeploymentInformationInner.md docs/ApplicationFilesystem.md @@ -310,6 +312,20 @@ docs/ListTasks200Response.md docs/ListTasks200ResponseTasksInner.md docs/ListVectorCollections200Response.md docs/ListVectorCollections200ResponseCollectionsInner.md +docs/OaiChatCompletions200Response.md +docs/OaiChatCompletions200ResponseChoicesInner.md +docs/OaiChatCompletions200ResponseChoicesInnerMessage.md +docs/OaiChatCompletions200ResponseUsage.md +docs/OaiChatCompletionsRequest.md +docs/OaiChatCompletionsRequestMessagesInner.md +docs/OaiEmbeddings200Response.md +docs/OaiEmbeddings200ResponseDataInner.md +docs/OaiEmbeddings200ResponseUsage.md +docs/OaiEmbeddingsRequest.md +docs/OaiGetModel200Response.md +docs/OaiListModels200Response.md +docs/OaiListModels200ResponseDataInner.md +docs/OpenAICompatibilityAPI.md docs/OrganizationsAPI.md docs/OrganizationsList200ResponseInner.md docs/PatchEnvironmentCompose202Response.md @@ -503,6 +519,7 @@ model_ai_search_search_request.go model_ai_search_trigger_crawl_request.go model_ai_search_update_settings_request.go model_application.go +model_application_cache.go model_application_database.go model_application_deployment_information_inner.go model_application_filesystem.go @@ -729,6 +746,19 @@ model_list_tasks_200_response.go model_list_tasks_200_response_tasks_inner.go model_list_vector_collections_200_response.go model_list_vector_collections_200_response_collections_inner.go +model_oai_chat_completions_200_response.go +model_oai_chat_completions_200_response_choices_inner.go +model_oai_chat_completions_200_response_choices_inner_message.go +model_oai_chat_completions_200_response_usage.go +model_oai_chat_completions_request.go +model_oai_chat_completions_request_messages_inner.go +model_oai_embeddings_200_response.go +model_oai_embeddings_200_response_data_inner.go +model_oai_embeddings_200_response_usage.go +model_oai_embeddings_request.go +model_oai_get_model_200_response.go +model_oai_list_models_200_response.go +model_oai_list_models_200_response_data_inner.go model_organizations_list_200_response_inner.go model_patch_environment_compose_202_response.go model_patch_environment_compose_202_response_spot_configuration.go @@ -930,6 +960,7 @@ test/api_domains_test.go test/api_environments_test.go test/api_headers_test.go test/api_kv_test.go +test/api_open_ai_compatibility_test.go test/api_organizations_test.go test/api_projects_test.go test/api_purge_test.go diff --git a/README.md b/README.md index 06eebf7..0fb7b75 100644 --- a/README.md +++ b/README.md @@ -253,6 +253,10 @@ Class | Method | HTTP request | Description *KVAPI* | [**KVList**](docs/KVAPI.md#kvlist) | **Get** /api/v2/organizations/{organization}/projects/{project}/kv | List key-value stores *KVAPI* | [**KVShow**](docs/KVAPI.md#kvshow) | **Get** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id} | Get a kv store *KVAPI* | [**KVUnlinkFromProject**](docs/KVAPI.md#kvunlinkfromproject) | **Delete** /api/v2/organizations/{organization}/projects/{project}/kv/{store_id}/link | Unlink a KV store from this project +*OpenAICompatibilityAPI* | [**OaiChatCompletions**](docs/OpenAICompatibilityAPI.md#oaichatcompletions) | **Post** /oai/v1/chat/completions | Create a chat completion (OpenAI-compatible) +*OpenAICompatibilityAPI* | [**OaiEmbeddings**](docs/OpenAICompatibilityAPI.md#oaiembeddings) | **Post** /oai/v1/embeddings | Create embeddings (OpenAI-compatible) +*OpenAICompatibilityAPI* | [**OaiGetModel**](docs/OpenAICompatibilityAPI.md#oaigetmodel) | **Get** /oai/v1/models/{model} | Retrieve a model (OpenAI-compatible) +*OpenAICompatibilityAPI* | [**OaiListModels**](docs/OpenAICompatibilityAPI.md#oailistmodels) | **Get** /oai/v1/models | List available models (OpenAI-compatible) *OrganizationsAPI* | [**OrganizationsList**](docs/OrganizationsAPI.md#organizationslist) | **Get** /api/v2/organizations | Retrieve all organizations *OrganizationsAPI* | [**OrganizationsRead**](docs/OrganizationsAPI.md#organizationsread) | **Get** /api/v2/organizations/{organization} | Get details of a single organization *ProjectsAPI* | [**ProjectsCreate**](docs/ProjectsAPI.md#projectscreate) | **Post** /api/v2/organizations/{organization}/projects | Create a new project @@ -338,6 +342,7 @@ Class | Method | HTTP request | Description - [AiSearchTriggerCrawlRequest](docs/AiSearchTriggerCrawlRequest.md) - [AiSearchUpdateSettingsRequest](docs/AiSearchUpdateSettingsRequest.md) - [Application](docs/Application.md) + - [ApplicationCache](docs/ApplicationCache.md) - [ApplicationDatabase](docs/ApplicationDatabase.md) - [ApplicationDeploymentInformationInner](docs/ApplicationDeploymentInformationInner.md) - [ApplicationFilesystem](docs/ApplicationFilesystem.md) @@ -564,6 +569,19 @@ Class | Method | HTTP request | Description - [ListTasks200ResponseTasksInner](docs/ListTasks200ResponseTasksInner.md) - [ListVectorCollections200Response](docs/ListVectorCollections200Response.md) - [ListVectorCollections200ResponseCollectionsInner](docs/ListVectorCollections200ResponseCollectionsInner.md) + - [OaiChatCompletions200Response](docs/OaiChatCompletions200Response.md) + - [OaiChatCompletions200ResponseChoicesInner](docs/OaiChatCompletions200ResponseChoicesInner.md) + - [OaiChatCompletions200ResponseChoicesInnerMessage](docs/OaiChatCompletions200ResponseChoicesInnerMessage.md) + - [OaiChatCompletions200ResponseUsage](docs/OaiChatCompletions200ResponseUsage.md) + - [OaiChatCompletionsRequest](docs/OaiChatCompletionsRequest.md) + - [OaiChatCompletionsRequestMessagesInner](docs/OaiChatCompletionsRequestMessagesInner.md) + - [OaiEmbeddings200Response](docs/OaiEmbeddings200Response.md) + - [OaiEmbeddings200ResponseDataInner](docs/OaiEmbeddings200ResponseDataInner.md) + - [OaiEmbeddings200ResponseUsage](docs/OaiEmbeddings200ResponseUsage.md) + - [OaiEmbeddingsRequest](docs/OaiEmbeddingsRequest.md) + - [OaiGetModel200Response](docs/OaiGetModel200Response.md) + - [OaiListModels200Response](docs/OaiListModels200Response.md) + - [OaiListModels200ResponseDataInner](docs/OaiListModels200ResponseDataInner.md) - [OrganizationsList200ResponseInner](docs/OrganizationsList200ResponseInner.md) - [PatchEnvironmentCompose202Response](docs/PatchEnvironmentCompose202Response.md) - [PatchEnvironmentCompose202ResponseSpotConfiguration](docs/PatchEnvironmentCompose202ResponseSpotConfiguration.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 375a3de..e99414f 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -95,6 +95,8 @@ tags: name: AI Usage - description: Restore Management name: Restore Management +- description: OpenAI Compatibility + name: OpenAI Compatibility paths: /api/v3/organisations/{organisation}/projects/{project}/ai-search: get: @@ -11546,6 +11548,117 @@ paths: summary: Get the status of a restore operation tags: - Restore Management + /oai/v1/chat/completions: + post: + description: "Drop-in replacement for OpenAI's POST /v1/chat/completions. Point\ + \ any OpenAI SDK at base_url=https:///oai/v1 and use a Quant API token\ + \ (qc_...) as the api_key. Set `stream: true` to receive Server-Sent Events\ + \ (chat.completion.chunk objects terminated by `data: [DONE]`); otherwise\ + \ a single chat.completion object is returned. Supports tool/function calling\ + \ and the standard tool_choice modes." + operationId: oaiChatCompletions + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/oaiChatCompletions_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/oaiChatCompletions_200_response' + description: A chat.completion object (or an SSE stream of chat.completion.chunk + objects when stream=true) + "401": + description: Missing or invalid API key + "403": + description: "Token not scoped to an organisation, or org lacks AI access" + "422": + description: Invalid request + security: + - bearerAuth: [] + summary: Create a chat completion (OpenAI-compatible) + tags: + - OpenAI Compatibility + /oai/v1/embeddings: + post: + description: Drop-in replacement for OpenAI's POST /v1/embeddings. Accepts a + single string or an array of strings in `input` and returns a list of embedding + objects. + operationId: oaiEmbeddings + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/oaiEmbeddings_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/oaiEmbeddings_200_response' + description: A list of embedding objects + "401": + description: Missing or invalid API key + "403": + description: "Token not scoped to an organisation, or org lacks AI access" + security: + - bearerAuth: [] + summary: Create embeddings (OpenAI-compatible) + tags: + - OpenAI Compatibility + /oai/v1/models: + get: + description: Drop-in replacement for OpenAI's GET /v1/models. Returns the model + ids available to the organisation; pass one of these ids as `model` in chat/embeddings + requests. + operationId: oaiListModels + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/oaiListModels_200_response' + description: A list of model objects + "401": + description: Missing or invalid API key + security: + - bearerAuth: [] + summary: List available models (OpenAI-compatible) + tags: + - OpenAI Compatibility + /oai/v1/models/{model}: + get: + description: "Drop-in replacement for OpenAI's GET /v1/models/{model}." + operationId: oaiGetModel + parameters: + - example: amazon.nova-micro-v1:0 + explode: false + in: path + name: model + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/oaiGetModel_200_response' + description: A model object + "401": + description: Missing or invalid API key + "404": + description: Model not found + security: + - bearerAuth: [] + summary: Retrieve a model (OpenAI-compatible) + tags: + - OpenAI Compatibility /api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies: delete: description: "Deletes a specific scaling policy for the environment. Specify\ @@ -12151,10 +12264,12 @@ components: CreateApplicationRequest: example: composeDefinition: + singleTaskOnly: true spotConfiguration: strategy: spot-only - taskMemory: 2 - maxCapacity: 7 + startupGracePeriodSeconds: 368 + taskMemory: 4 + maxCapacity: 1 containers: - originProtectionConfig: ipAllow: @@ -12162,7 +12277,7 @@ components: - ipAllow redirectHost: redirectHost enabled: true - memory: 6 + memory: 1 dependsOn: - condition: START containerName: containerName @@ -12172,7 +12287,7 @@ components: exposedPorts: - 5 - 5 - cpu: 0 + cpu: 6 imageReference: identifier: identifier type: internal @@ -12181,7 +12296,7 @@ components: valueFrom: valueFrom - name: name valueFrom: valueFrom - memoryReservation: 1 + memoryReservation: 5 command: - command - command @@ -12193,13 +12308,13 @@ components: readonlyRootFilesystem: false originProtection: false healthCheck: - retries: 7 - startPeriod: 279 - interval: 171 + retries: 9 + startPeriod: 108 + interval: 72 command: - command - command - timeout: 15 + timeout: 42 name: name mountPoints: - readOnly: false @@ -12219,7 +12334,7 @@ components: - ipAllow redirectHost: redirectHost enabled: true - memory: 6 + memory: 1 dependsOn: - condition: START containerName: containerName @@ -12229,7 +12344,7 @@ components: exposedPorts: - 5 - 5 - cpu: 0 + cpu: 6 imageReference: identifier: identifier type: internal @@ -12238,7 +12353,7 @@ components: valueFrom: valueFrom - name: name valueFrom: valueFrom - memoryReservation: 1 + memoryReservation: 5 command: - command - command @@ -12250,13 +12365,13 @@ components: readonlyRootFilesystem: false originProtection: false healthCheck: - retries: 7 - startPeriod: 279 - interval: 171 + retries: 9 + startPeriod: 108 + interval: 72 command: - command - command - timeout: 15 + timeout: 42 name: name mountPoints: - readOnly: false @@ -12270,8 +12385,8 @@ components: - entryPoint user: user essential: true - minCapacity: 4 - taskCpu: 3 + minCapacity: 7 + taskCpu: 2 enableCrossAppNetworking: false architecture: architecture enableCrossEnvNetworking: false @@ -12371,6 +12486,10 @@ components: type: object Application: example: + cache: + cacheEndpoint: cacheEndpoint + cacheIdentifier: cacheIdentifier + dataStorageMaxGb: 0 appName: appName deploymentInformation: - createdAt: 2000-01-23T04:56:07.000+00:00 @@ -12386,9 +12505,9 @@ components: environmentNames: - environmentNames - environmentNames - desiredCount: 1 + desiredCount: 7 organisation: organisation - maxCapacity: 1 + maxCapacity: 6 imageReference: identifier: identifier type: internal @@ -12404,10 +12523,12 @@ components: rdsInstanceStatus: rdsInstanceStatus rdsInstanceEndpoint: rdsInstanceEndpoint composeDefinition: + singleTaskOnly: true spotConfiguration: strategy: spot-only - taskMemory: 2 - maxCapacity: 7 + startupGracePeriodSeconds: 368 + taskMemory: 4 + maxCapacity: 1 containers: - originProtectionConfig: ipAllow: @@ -12415,7 +12536,7 @@ components: - ipAllow redirectHost: redirectHost enabled: true - memory: 6 + memory: 1 dependsOn: - condition: START containerName: containerName @@ -12425,7 +12546,7 @@ components: exposedPorts: - 5 - 5 - cpu: 0 + cpu: 6 imageReference: identifier: identifier type: internal @@ -12434,7 +12555,7 @@ components: valueFrom: valueFrom - name: name valueFrom: valueFrom - memoryReservation: 1 + memoryReservation: 5 command: - command - command @@ -12446,13 +12567,13 @@ components: readonlyRootFilesystem: false originProtection: false healthCheck: - retries: 7 - startPeriod: 279 - interval: 171 + retries: 9 + startPeriod: 108 + interval: 72 command: - command - command - timeout: 15 + timeout: 42 name: name mountPoints: - readOnly: false @@ -12472,7 +12593,7 @@ components: - ipAllow redirectHost: redirectHost enabled: true - memory: 6 + memory: 1 dependsOn: - condition: START containerName: containerName @@ -12482,7 +12603,7 @@ components: exposedPorts: - 5 - 5 - cpu: 0 + cpu: 6 imageReference: identifier: identifier type: internal @@ -12491,7 +12612,7 @@ components: valueFrom: valueFrom - name: name valueFrom: valueFrom - memoryReservation: 1 + memoryReservation: 5 command: - command - command @@ -12503,13 +12624,13 @@ components: readonlyRootFilesystem: false originProtection: false healthCheck: - retries: 7 - startPeriod: 279 - interval: 171 + retries: 9 + startPeriod: 108 + interval: 72 command: - command - command - timeout: 15 + timeout: 42 name: name mountPoints: - readOnly: false @@ -12523,12 +12644,12 @@ components: - entryPoint user: user essential: true - minCapacity: 4 - taskCpu: 3 + minCapacity: 7 + taskCpu: 2 enableCrossAppNetworking: false architecture: architecture enableCrossEnvNetworking: false - runningCount: 6 + runningCount: 1 minCapacity: 1 status: status properties: @@ -12542,6 +12663,8 @@ components: $ref: '#/components/schemas/Application_database' filesystem: $ref: '#/components/schemas/Application_filesystem' + cache: + $ref: '#/components/schemas/Application_cache' composeDefinition: $ref: '#/components/schemas/Compose' status: @@ -12632,10 +12755,12 @@ components: type: object Compose: example: + singleTaskOnly: true spotConfiguration: strategy: spot-only - taskMemory: 2 - maxCapacity: 7 + startupGracePeriodSeconds: 368 + taskMemory: 4 + maxCapacity: 1 containers: - originProtectionConfig: ipAllow: @@ -12643,7 +12768,7 @@ components: - ipAllow redirectHost: redirectHost enabled: true - memory: 6 + memory: 1 dependsOn: - condition: START containerName: containerName @@ -12653,7 +12778,7 @@ components: exposedPorts: - 5 - 5 - cpu: 0 + cpu: 6 imageReference: identifier: identifier type: internal @@ -12662,7 +12787,7 @@ components: valueFrom: valueFrom - name: name valueFrom: valueFrom - memoryReservation: 1 + memoryReservation: 5 command: - command - command @@ -12674,13 +12799,13 @@ components: readonlyRootFilesystem: false originProtection: false healthCheck: - retries: 7 - startPeriod: 279 - interval: 171 + retries: 9 + startPeriod: 108 + interval: 72 command: - command - command - timeout: 15 + timeout: 42 name: name mountPoints: - readOnly: false @@ -12700,7 +12825,7 @@ components: - ipAllow redirectHost: redirectHost enabled: true - memory: 6 + memory: 1 dependsOn: - condition: START containerName: containerName @@ -12710,7 +12835,7 @@ components: exposedPorts: - 5 - 5 - cpu: 0 + cpu: 6 imageReference: identifier: identifier type: internal @@ -12719,7 +12844,7 @@ components: valueFrom: valueFrom - name: name valueFrom: valueFrom - memoryReservation: 1 + memoryReservation: 5 command: - command - command @@ -12731,13 +12856,13 @@ components: readonlyRootFilesystem: false originProtection: false healthCheck: - retries: 7 - startPeriod: 279 - interval: 171 + retries: 9 + startPeriod: 108 + interval: 72 command: - command - command - timeout: 15 + timeout: 42 name: name mountPoints: - readOnly: false @@ -12751,8 +12876,8 @@ components: - entryPoint user: user essential: true - minCapacity: 4 - taskCpu: 3 + minCapacity: 7 + taskCpu: 2 enableCrossAppNetworking: false architecture: architecture enableCrossEnvNetworking: false @@ -12781,6 +12906,25 @@ components: description: Maximum number of instances nullable: false type: integer + singleTaskOnly: + description: "Optional. Forces single-task mode for data-safe applications\ + \ (max one running task). When true: capacity is locked to 1. When false:\ + \ explicitly allows scaling. When omitted: the platform auto-detects stateful\ + \ containers and enables single-task mode if found." + nullable: true + type: boolean + startupGracePeriodSeconds: + default: 120 + description: "Optional. Seconds the load balancer waits after a task starts\ + \ before an unhealthy health check can replace it (applied as the ECS\ + \ service's healthCheckGracePeriodSeconds when a load balancer is attached).\ + \ Raise for apps that are slow to boot, e.g. run migrations on startup.\ + \ Tasks that become healthy sooner still enter service immediately. Defaults\ + \ to 120 when omitted." + maximum: 3600 + minimum: 0 + nullable: true + type: integer spotConfiguration: $ref: '#/components/schemas/SpotConfiguration' enableCrossEnvNetworking: @@ -12812,7 +12956,7 @@ components: - ipAllow redirectHost: redirectHost enabled: true - memory: 6 + memory: 1 dependsOn: - condition: START containerName: containerName @@ -12822,7 +12966,7 @@ components: exposedPorts: - 5 - 5 - cpu: 0 + cpu: 6 imageReference: identifier: identifier type: internal @@ -12831,7 +12975,7 @@ components: valueFrom: valueFrom - name: name valueFrom: valueFrom - memoryReservation: 1 + memoryReservation: 5 command: - command - command @@ -12843,13 +12987,13 @@ components: readonlyRootFilesystem: false originProtection: false healthCheck: - retries: 7 - startPeriod: 279 - interval: 171 + retries: 9 + startPeriod: 108 + interval: 72 command: - command - command - timeout: 15 + timeout: 42 name: name mountPoints: - readOnly: false @@ -23454,12 +23598,19 @@ components: monthlyBudgetCents: 0 perUserDailyBudgetCents: 5 warningThresholdPercent: 5 + perTokenMonthlyBudgetCents: 2 perUserMonthlyBudgetCents: 1 dailyBudgetCents: 6 + tokenOverrides: + key: + dailyCents: 9 + unlimited: true + monthlyCents: 3 interfaceLimits: key: dailyCents: 2 monthlyCents: 7 + perTokenDailyBudgetCents: 4 properties: monthlyBudgetCents: nullable: true @@ -23489,6 +23640,22 @@ components: \ id, slack-, or system:code-agent). Replaces the flat per-user budget\ \ for that user; unlimited=true exempts them." type: object + perTokenMonthlyBudgetCents: + description: Flat monthly cap in cents applied to every API token without + a named override + nullable: true + type: integer + perTokenDailyBudgetCents: + description: Flat daily cap in cents applied to every API token without + a named override + nullable: true + type: integer + tokenOverrides: + additionalProperties: + $ref: '#/components/schemas/getGovernanceConfig_200_response_spendLimits_userOverrides_value' + description: Per-token budget overrides keyed by API token id. Replaces + the flat per-token budget for that token; unlimited=true exempts it. + type: object type: object getGovernanceConfig_200_response: example: @@ -23501,7 +23668,7 @@ components: modelPolicy: unrestricted aiEnabled: true mandatoryGuardrailPreset: mandatoryGuardrailPreset - version: 2 + version: 7 orgId: orgId spendLimits: userOverrides: @@ -23512,12 +23679,19 @@ components: monthlyBudgetCents: 0 perUserDailyBudgetCents: 5 warningThresholdPercent: 5 + perTokenMonthlyBudgetCents: 2 perUserMonthlyBudgetCents: 1 dailyBudgetCents: 6 + tokenOverrides: + key: + dailyCents: 9 + unlimited: true + monthlyCents: 3 interfaceLimits: key: dailyCents: 2 monthlyCents: 7 + perTokenDailyBudgetCents: 4 properties: orgId: type: string @@ -23937,6 +24111,18 @@ components: minimum: 1 nullable: true type: integer + singleTaskOnly: + description: Forces single-task mode (max one running task). Omitted = auto-detect + from stateful containers. + nullable: true + type: boolean + startupGracePeriodSeconds: + description: Seconds the load balancer waits after a task starts before + an unhealthy health check can replace it. Default 120. + maximum: 3600 + minimum: 0 + nullable: true + type: integer containers: items: type: object @@ -24136,6 +24322,20 @@ components: maxCapacity: description: Maximum number of instances type: integer + singleTaskOnly: + description: "Optional. Forces single-task mode (max one running task).\ + \ When omitted, the platform auto-detects stateful containers." + nullable: true + type: boolean + startupGracePeriodSeconds: + default: 120 + description: "Optional. Seconds the load balancer waits after a task starts\ + \ before an unhealthy health check can replace it. If not set, the value\ + \ from composeDefinition (or default 120) is used." + maximum: 3600 + minimum: 0 + nullable: true + type: integer cloneConfigurationFrom: description: Clone configuration from an existing environment type: string @@ -24508,6 +24708,278 @@ components: nullable: true type: integer type: object + oaiChatCompletions_request_messages_inner: + properties: + role: + enum: + - system + - user + - assistant + - tool + type: string + content: + type: string + type: object + oaiChatCompletions_request: + properties: + model: + description: A model id from GET /oai/v1/models + example: anthropic.claude-sonnet-4-6 + type: string + messages: + items: + $ref: '#/components/schemas/oaiChatCompletions_request_messages_inner' + type: array + stream: + default: false + description: Stream the response as SSE chat.completion.chunk events + type: boolean + max_tokens: + type: integer + temperature: + type: number + top_p: + type: number + tools: + description: OpenAI function tool definitions + items: + type: object + type: array + tool_choice: + description: "auto | none | required | {type:function, function:{name}}" + stream_options: + description: "{include_usage: true} to emit a final usage chunk when streaming" + type: object + required: + - messages + - model + type: object + oaiChatCompletions_200_response_choices_inner_message: + example: + role: role + tool_calls: + - "{}" + - "{}" + content: content + properties: + role: + type: string + content: + nullable: true + type: string + tool_calls: + items: + type: object + type: array + type: object + oaiChatCompletions_200_response_choices_inner: + example: + finish_reason: stop + index: 6 + message: + role: role + tool_calls: + - "{}" + - "{}" + content: content + properties: + index: + type: integer + message: + $ref: '#/components/schemas/oaiChatCompletions_200_response_choices_inner_message' + finish_reason: + enum: + - stop + - tool_calls + - length + type: string + type: object + oaiChatCompletions_200_response_usage: + example: + completion_tokens: 5 + prompt_tokens: 1 + total_tokens: 5 + properties: + prompt_tokens: + type: integer + completion_tokens: + type: integer + total_tokens: + type: integer + type: object + oaiChatCompletions_200_response: + example: + created: 0 + usage: + completion_tokens: 5 + prompt_tokens: 1 + total_tokens: 5 + model: model + id: chatcmpl-abc123 + choices: + - finish_reason: stop + index: 6 + message: + role: role + tool_calls: + - "{}" + - "{}" + content: content + - finish_reason: stop + index: 6 + message: + role: role + tool_calls: + - "{}" + - "{}" + content: content + object: chat.completion + properties: + id: + example: chatcmpl-abc123 + type: string + object: + example: chat.completion + type: string + created: + type: integer + model: + type: string + choices: + items: + $ref: '#/components/schemas/oaiChatCompletions_200_response_choices_inner' + type: array + usage: + $ref: '#/components/schemas/oaiChatCompletions_200_response_usage' + type: object + oaiEmbeddings_request: + properties: + model: + example: amazon.titan-embed-text-v2:0 + type: string + input: + description: A string or array of strings to embed + required: + - input + - model + type: object + oaiEmbeddings_200_response_data_inner: + example: + index: 0 + embedding: + - 6.027456183070403 + - 6.027456183070403 + object: embedding + properties: + object: + example: embedding + type: string + index: + type: integer + embedding: + items: + type: number + type: array + type: object + oaiEmbeddings_200_response_usage: + example: + prompt_tokens: 1 + total_tokens: 5 + properties: + prompt_tokens: + type: integer + total_tokens: + type: integer + type: object + oaiEmbeddings_200_response: + example: + data: + - index: 0 + embedding: + - 6.027456183070403 + - 6.027456183070403 + object: embedding + - index: 0 + embedding: + - 6.027456183070403 + - 6.027456183070403 + object: embedding + usage: + prompt_tokens: 1 + total_tokens: 5 + model: model + object: list + properties: + object: + example: list + type: string + data: + items: + $ref: '#/components/schemas/oaiEmbeddings_200_response_data_inner' + type: array + model: + type: string + usage: + $ref: '#/components/schemas/oaiEmbeddings_200_response_usage' + type: object + oaiListModels_200_response_data_inner: + example: + created: 0 + owned_by: quant + id: anthropic.claude-sonnet-4-6 + object: model + properties: + id: + example: anthropic.claude-sonnet-4-6 + type: string + object: + example: model + type: string + created: + type: integer + owned_by: + example: quant + type: string + type: object + oaiListModels_200_response: + example: + data: + - created: 0 + owned_by: quant + id: anthropic.claude-sonnet-4-6 + object: model + - created: 0 + owned_by: quant + id: anthropic.claude-sonnet-4-6 + object: model + object: list + properties: + object: + example: list + type: string + data: + items: + $ref: '#/components/schemas/oaiListModels_200_response_data_inner' + type: array + type: object + oaiGetModel_200_response: + example: + created: 0 + owned_by: quant + id: id + object: model + properties: + id: + type: string + object: + example: model + type: string + created: + type: integer + owned_by: + example: quant + type: string + type: object getSshAccessCredentials_200_response_credentials: example: accessKeyId: accessKeyId @@ -24703,6 +25175,27 @@ components: description: Default mount path in containers type: string type: object + Application_cache: + description: Managed Valkey cache configuration + example: + cacheEndpoint: cacheEndpoint + cacheIdentifier: cacheIdentifier + dataStorageMaxGb: 0 + nullable: true + properties: + cacheEndpoint: + description: Cache cluster endpoint + nullable: true + type: string + cacheIdentifier: + description: Cache cluster identifier + nullable: true + type: string + dataStorageMaxGb: + description: Maximum cache storage in GB + nullable: true + type: integer + type: object Application_deploymentInformation_inner: example: createdAt: 2000-01-23T04:56:07.000+00:00 @@ -24818,13 +25311,13 @@ components: Container_healthCheck: description: Container health check configuration example: - retries: 7 - startPeriod: 279 - interval: 171 + retries: 9 + startPeriod: 108 + interval: 72 command: - command - command - timeout: 15 + timeout: 42 nullable: true properties: command: diff --git a/api_open_ai_compatibility.go b/api_open_ai_compatibility.go new file mode 100644 index 0000000..abcb65f --- /dev/null +++ b/api_open_ai_compatibility.go @@ -0,0 +1,506 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +type OpenAICompatibilityAPI interface { + + /* + OaiChatCompletions Create a chat completion (OpenAI-compatible) + + Drop-in replacement for OpenAI's POST /v1/chat/completions. Point any OpenAI SDK at base_url=https:///oai/v1 and use a Quant API token (qc_...) as the api_key. Set `stream: true` to receive Server-Sent Events (chat.completion.chunk objects terminated by `data: [DONE]`); otherwise a single chat.completion object is returned. Supports tool/function calling and the standard tool_choice modes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return OpenAICompatibilityAPIOaiChatCompletionsRequest + */ + OaiChatCompletions(ctx context.Context) OpenAICompatibilityAPIOaiChatCompletionsRequest + + // OaiChatCompletionsExecute executes the request + // @return OaiChatCompletions200Response + OaiChatCompletionsExecute(r OpenAICompatibilityAPIOaiChatCompletionsRequest) (*OaiChatCompletions200Response, *http.Response, error) + + /* + OaiEmbeddings Create embeddings (OpenAI-compatible) + + Drop-in replacement for OpenAI's POST /v1/embeddings. Accepts a single string or an array of strings in `input` and returns a list of embedding objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return OpenAICompatibilityAPIOaiEmbeddingsRequest + */ + OaiEmbeddings(ctx context.Context) OpenAICompatibilityAPIOaiEmbeddingsRequest + + // OaiEmbeddingsExecute executes the request + // @return OaiEmbeddings200Response + OaiEmbeddingsExecute(r OpenAICompatibilityAPIOaiEmbeddingsRequest) (*OaiEmbeddings200Response, *http.Response, error) + + /* + OaiGetModel Retrieve a model (OpenAI-compatible) + + Drop-in replacement for OpenAI's GET /v1/models/{model}. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param model + @return OpenAICompatibilityAPIOaiGetModelRequest + */ + OaiGetModel(ctx context.Context, model string) OpenAICompatibilityAPIOaiGetModelRequest + + // OaiGetModelExecute executes the request + // @return OaiGetModel200Response + OaiGetModelExecute(r OpenAICompatibilityAPIOaiGetModelRequest) (*OaiGetModel200Response, *http.Response, error) + + /* + OaiListModels List available models (OpenAI-compatible) + + Drop-in replacement for OpenAI's GET /v1/models. Returns the model ids available to the organisation; pass one of these ids as `model` in chat/embeddings requests. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return OpenAICompatibilityAPIOaiListModelsRequest + */ + OaiListModels(ctx context.Context) OpenAICompatibilityAPIOaiListModelsRequest + + // OaiListModelsExecute executes the request + // @return OaiListModels200Response + OaiListModelsExecute(r OpenAICompatibilityAPIOaiListModelsRequest) (*OaiListModels200Response, *http.Response, error) +} + +// OpenAICompatibilityAPIService OpenAICompatibilityAPI service +type OpenAICompatibilityAPIService service + +type OpenAICompatibilityAPIOaiChatCompletionsRequest struct { + ctx context.Context + ApiService OpenAICompatibilityAPI + oaiChatCompletionsRequest *OaiChatCompletionsRequest +} + +func (r OpenAICompatibilityAPIOaiChatCompletionsRequest) OaiChatCompletionsRequest(oaiChatCompletionsRequest OaiChatCompletionsRequest) OpenAICompatibilityAPIOaiChatCompletionsRequest { + r.oaiChatCompletionsRequest = &oaiChatCompletionsRequest + return r +} + +func (r OpenAICompatibilityAPIOaiChatCompletionsRequest) Execute() (*OaiChatCompletions200Response, *http.Response, error) { + return r.ApiService.OaiChatCompletionsExecute(r) +} + +/* +OaiChatCompletions Create a chat completion (OpenAI-compatible) + +Drop-in replacement for OpenAI's POST /v1/chat/completions. Point any OpenAI SDK at base_url=https:///oai/v1 and use a Quant API token (qc_...) as the api_key. Set `stream: true` to receive Server-Sent Events (chat.completion.chunk objects terminated by `data: [DONE]`); otherwise a single chat.completion object is returned. Supports tool/function calling and the standard tool_choice modes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return OpenAICompatibilityAPIOaiChatCompletionsRequest +*/ +func (a *OpenAICompatibilityAPIService) OaiChatCompletions(ctx context.Context) OpenAICompatibilityAPIOaiChatCompletionsRequest { + return OpenAICompatibilityAPIOaiChatCompletionsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return OaiChatCompletions200Response +func (a *OpenAICompatibilityAPIService) OaiChatCompletionsExecute(r OpenAICompatibilityAPIOaiChatCompletionsRequest) (*OaiChatCompletions200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OaiChatCompletions200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OpenAICompatibilityAPIService.OaiChatCompletions") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oai/v1/chat/completions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.oaiChatCompletionsRequest == nil { + return localVarReturnValue, nil, reportError("oaiChatCompletionsRequest 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 + } + // body params + localVarPostBody = r.oaiChatCompletionsRequest + 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 OpenAICompatibilityAPIOaiEmbeddingsRequest struct { + ctx context.Context + ApiService OpenAICompatibilityAPI + oaiEmbeddingsRequest *OaiEmbeddingsRequest +} + +func (r OpenAICompatibilityAPIOaiEmbeddingsRequest) OaiEmbeddingsRequest(oaiEmbeddingsRequest OaiEmbeddingsRequest) OpenAICompatibilityAPIOaiEmbeddingsRequest { + r.oaiEmbeddingsRequest = &oaiEmbeddingsRequest + return r +} + +func (r OpenAICompatibilityAPIOaiEmbeddingsRequest) Execute() (*OaiEmbeddings200Response, *http.Response, error) { + return r.ApiService.OaiEmbeddingsExecute(r) +} + +/* +OaiEmbeddings Create embeddings (OpenAI-compatible) + +Drop-in replacement for OpenAI's POST /v1/embeddings. Accepts a single string or an array of strings in `input` and returns a list of embedding objects. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return OpenAICompatibilityAPIOaiEmbeddingsRequest +*/ +func (a *OpenAICompatibilityAPIService) OaiEmbeddings(ctx context.Context) OpenAICompatibilityAPIOaiEmbeddingsRequest { + return OpenAICompatibilityAPIOaiEmbeddingsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return OaiEmbeddings200Response +func (a *OpenAICompatibilityAPIService) OaiEmbeddingsExecute(r OpenAICompatibilityAPIOaiEmbeddingsRequest) (*OaiEmbeddings200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OaiEmbeddings200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OpenAICompatibilityAPIService.OaiEmbeddings") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oai/v1/embeddings" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.oaiEmbeddingsRequest == nil { + return localVarReturnValue, nil, reportError("oaiEmbeddingsRequest 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 + } + // body params + localVarPostBody = r.oaiEmbeddingsRequest + 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 OpenAICompatibilityAPIOaiGetModelRequest struct { + ctx context.Context + ApiService OpenAICompatibilityAPI + model string +} + +func (r OpenAICompatibilityAPIOaiGetModelRequest) Execute() (*OaiGetModel200Response, *http.Response, error) { + return r.ApiService.OaiGetModelExecute(r) +} + +/* +OaiGetModel Retrieve a model (OpenAI-compatible) + +Drop-in replacement for OpenAI's GET /v1/models/{model}. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param model + @return OpenAICompatibilityAPIOaiGetModelRequest +*/ +func (a *OpenAICompatibilityAPIService) OaiGetModel(ctx context.Context, model string) OpenAICompatibilityAPIOaiGetModelRequest { + return OpenAICompatibilityAPIOaiGetModelRequest{ + ApiService: a, + ctx: ctx, + model: model, + } +} + +// Execute executes the request +// @return OaiGetModel200Response +func (a *OpenAICompatibilityAPIService) OaiGetModelExecute(r OpenAICompatibilityAPIOaiGetModelRequest) (*OaiGetModel200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OaiGetModel200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OpenAICompatibilityAPIService.OaiGetModel") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oai/v1/models/{model}" + localVarPath = strings.Replace(localVarPath, "{"+"model"+"}", url.PathEscape(parameterValueToString(r.model, "model")), -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 + } + 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 OpenAICompatibilityAPIOaiListModelsRequest struct { + ctx context.Context + ApiService OpenAICompatibilityAPI +} + +func (r OpenAICompatibilityAPIOaiListModelsRequest) Execute() (*OaiListModels200Response, *http.Response, error) { + return r.ApiService.OaiListModelsExecute(r) +} + +/* +OaiListModels List available models (OpenAI-compatible) + +Drop-in replacement for OpenAI's GET /v1/models. Returns the model ids available to the organisation; pass one of these ids as `model` in chat/embeddings requests. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return OpenAICompatibilityAPIOaiListModelsRequest +*/ +func (a *OpenAICompatibilityAPIService) OaiListModels(ctx context.Context) OpenAICompatibilityAPIOaiListModelsRequest { + return OpenAICompatibilityAPIOaiListModelsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return OaiListModels200Response +func (a *OpenAICompatibilityAPIService) OaiListModelsExecute(r OpenAICompatibilityAPIOaiListModelsRequest) (*OaiListModels200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OaiListModels200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OpenAICompatibilityAPIService.OaiListModels") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oai/v1/models" + + 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 +} diff --git a/client.go b/client.go index a5e7b44..b75b334 100644 --- a/client.go +++ b/client.go @@ -109,6 +109,8 @@ type APIClient struct { KVAPI KVAPI + OpenAICompatibilityAPI OpenAICompatibilityAPI + OrganizationsAPI OrganizationsAPI ProjectsAPI ProjectsAPI @@ -178,6 +180,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.EnvironmentsAPI = (*EnvironmentsAPIService)(&c.common) c.HeadersAPI = (*HeadersAPIService)(&c.common) c.KVAPI = (*KVAPIService)(&c.common) + c.OpenAICompatibilityAPI = (*OpenAICompatibilityAPIService)(&c.common) c.OrganizationsAPI = (*OrganizationsAPIService)(&c.common) c.ProjectsAPI = (*ProjectsAPIService)(&c.common) c.PurgeAPI = (*PurgeAPIService)(&c.common) diff --git a/client_redact_test.go b/client_redact_test.go deleted file mode 100644 index 3280c81..0000000 --- a/client_redact_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package quantadmingo - -import ( - "net/http" - "strings" - "testing" -) - -// TestRedactedDumpRequest guards the debug-logging redaction (CodeQL -// go/clear-text-logging): credentials in the URL userinfo and the -// Authorization, Proxy-Authorization and Cookie headers must never appear in -// the bytes handed to the logger, while non-sensitive fields are preserved. -func TestRedactedDumpRequest(t *testing.T) { - req, err := http.NewRequest(http.MethodPost, "https://user:supersecretpw@api.example.com/v1/things?q=1", strings.NewReader(`{"k":"v"}`)) - if err != nil { - t.Fatalf("NewRequest: %v", err) - } - req.Header.Set("Authorization", "Bearer topsecrettoken") - req.Header.Set("Proxy-Authorization", "Basic cHJveHk6c2VjcmV0") - req.Header.Set("Cookie", "session=secretcookievalue") - - dump, err := redactedDumpRequest(req) - if err != nil { - t.Fatalf("redactedDumpRequest: %v", err) - } - out := string(dump) - - // No credential from URL userinfo, headers, or body may reach the log line. - for _, secret := range []string{"supersecretpw", "topsecrettoken", "cHJveHk6c2VjcmV0", "secretcookievalue", `{"k":"v"}`} { - if strings.Contains(out, secret) { - t.Errorf("redacted log leaked secret %q:\n%s", secret, out) - } - } - // The non-credential request line must survive so the log stays useful. - for _, want := range []string{http.MethodPost, "api.example.com", "/v1/things"} { - if !strings.Contains(out, want) { - t.Errorf("expected %q in redacted log, got:\n%s", want, out) - } - } -} diff --git a/docs/Application.md b/docs/Application.md index 9a4b019..527d411 100644 --- a/docs/Application.md +++ b/docs/Application.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Organisation** | **string** | Organisation machine name | **Database** | Pointer to [**NullableApplicationDatabase**](ApplicationDatabase.md) | | [optional] **Filesystem** | Pointer to [**NullableApplicationFilesystem**](ApplicationFilesystem.md) | | [optional] +**Cache** | Pointer to [**NullableApplicationCache**](ApplicationCache.md) | | [optional] **ComposeDefinition** | Pointer to [**Compose**](Compose.md) | | [optional] **Status** | Pointer to **NullableString** | Application status | [optional] [readonly] **DeploymentInformation** | Pointer to [**[]ApplicationDeploymentInformationInner**](ApplicationDeploymentInformationInner.md) | Deployment history | [optional] [readonly] @@ -148,6 +149,41 @@ HasFilesystem returns a boolean if a field has been set. `func (o *Application) UnsetFilesystem()` UnsetFilesystem ensures that no value is present for Filesystem, not even an explicit nil +### GetCache + +`func (o *Application) GetCache() ApplicationCache` + +GetCache returns the Cache field if non-nil, zero value otherwise. + +### GetCacheOk + +`func (o *Application) GetCacheOk() (*ApplicationCache, bool)` + +GetCacheOk returns a tuple with the Cache field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCache + +`func (o *Application) SetCache(v ApplicationCache)` + +SetCache sets Cache field to given value. + +### HasCache + +`func (o *Application) HasCache() bool` + +HasCache returns a boolean if a field has been set. + +### SetCacheNil + +`func (o *Application) SetCacheNil(b bool)` + + SetCacheNil sets the value for Cache to be an explicit nil + +### UnsetCache +`func (o *Application) UnsetCache()` + +UnsetCache ensures that no value is present for Cache, not even an explicit nil ### GetComposeDefinition `func (o *Application) GetComposeDefinition() Compose` diff --git a/docs/ApplicationCache.md b/docs/ApplicationCache.md new file mode 100644 index 0000000..14fdc84 --- /dev/null +++ b/docs/ApplicationCache.md @@ -0,0 +1,138 @@ +# ApplicationCache + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CacheEndpoint** | Pointer to **NullableString** | Cache cluster endpoint | [optional] +**CacheIdentifier** | Pointer to **NullableString** | Cache cluster identifier | [optional] +**DataStorageMaxGb** | Pointer to **NullableInt32** | Maximum cache storage in GB | [optional] + +## Methods + +### NewApplicationCache + +`func NewApplicationCache() *ApplicationCache` + +NewApplicationCache instantiates a new ApplicationCache 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 + +### NewApplicationCacheWithDefaults + +`func NewApplicationCacheWithDefaults() *ApplicationCache` + +NewApplicationCacheWithDefaults instantiates a new ApplicationCache 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 + +### GetCacheEndpoint + +`func (o *ApplicationCache) GetCacheEndpoint() string` + +GetCacheEndpoint returns the CacheEndpoint field if non-nil, zero value otherwise. + +### GetCacheEndpointOk + +`func (o *ApplicationCache) GetCacheEndpointOk() (*string, bool)` + +GetCacheEndpointOk returns a tuple with the CacheEndpoint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCacheEndpoint + +`func (o *ApplicationCache) SetCacheEndpoint(v string)` + +SetCacheEndpoint sets CacheEndpoint field to given value. + +### HasCacheEndpoint + +`func (o *ApplicationCache) HasCacheEndpoint() bool` + +HasCacheEndpoint returns a boolean if a field has been set. + +### SetCacheEndpointNil + +`func (o *ApplicationCache) SetCacheEndpointNil(b bool)` + + SetCacheEndpointNil sets the value for CacheEndpoint to be an explicit nil + +### UnsetCacheEndpoint +`func (o *ApplicationCache) UnsetCacheEndpoint()` + +UnsetCacheEndpoint ensures that no value is present for CacheEndpoint, not even an explicit nil +### GetCacheIdentifier + +`func (o *ApplicationCache) GetCacheIdentifier() string` + +GetCacheIdentifier returns the CacheIdentifier field if non-nil, zero value otherwise. + +### GetCacheIdentifierOk + +`func (o *ApplicationCache) GetCacheIdentifierOk() (*string, bool)` + +GetCacheIdentifierOk returns a tuple with the CacheIdentifier field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCacheIdentifier + +`func (o *ApplicationCache) SetCacheIdentifier(v string)` + +SetCacheIdentifier sets CacheIdentifier field to given value. + +### HasCacheIdentifier + +`func (o *ApplicationCache) HasCacheIdentifier() bool` + +HasCacheIdentifier returns a boolean if a field has been set. + +### SetCacheIdentifierNil + +`func (o *ApplicationCache) SetCacheIdentifierNil(b bool)` + + SetCacheIdentifierNil sets the value for CacheIdentifier to be an explicit nil + +### UnsetCacheIdentifier +`func (o *ApplicationCache) UnsetCacheIdentifier()` + +UnsetCacheIdentifier ensures that no value is present for CacheIdentifier, not even an explicit nil +### GetDataStorageMaxGb + +`func (o *ApplicationCache) GetDataStorageMaxGb() int32` + +GetDataStorageMaxGb returns the DataStorageMaxGb field if non-nil, zero value otherwise. + +### GetDataStorageMaxGbOk + +`func (o *ApplicationCache) GetDataStorageMaxGbOk() (*int32, bool)` + +GetDataStorageMaxGbOk returns a tuple with the DataStorageMaxGb field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataStorageMaxGb + +`func (o *ApplicationCache) SetDataStorageMaxGb(v int32)` + +SetDataStorageMaxGb sets DataStorageMaxGb field to given value. + +### HasDataStorageMaxGb + +`func (o *ApplicationCache) HasDataStorageMaxGb() bool` + +HasDataStorageMaxGb returns a boolean if a field has been set. + +### SetDataStorageMaxGbNil + +`func (o *ApplicationCache) SetDataStorageMaxGbNil(b bool)` + + SetDataStorageMaxGbNil sets the value for DataStorageMaxGb to be an explicit nil + +### UnsetDataStorageMaxGb +`func (o *ApplicationCache) UnsetDataStorageMaxGb()` + +UnsetDataStorageMaxGb ensures that no value is present for DataStorageMaxGb, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Compose.md b/docs/Compose.md index 7e2ea4d..0d1a55e 100644 --- a/docs/Compose.md +++ b/docs/Compose.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **TaskMemory** | Pointer to **int32** | Task-level memory in MB | [optional] **MinCapacity** | Pointer to **int32** | Minimum number of instances | [optional] **MaxCapacity** | Pointer to **int32** | Maximum number of instances | [optional] +**SingleTaskOnly** | Pointer to **NullableBool** | Optional. Forces single-task mode for data-safe applications (max one running task). When true: capacity is locked to 1. When false: explicitly allows scaling. When omitted: the platform auto-detects stateful containers and enables single-task mode if found. | [optional] +**StartupGracePeriodSeconds** | Pointer to **NullableInt32** | Optional. Seconds the load balancer waits after a task starts before an unhealthy health check can replace it (applied as the ECS service's healthCheckGracePeriodSeconds when a load balancer is attached). Raise for apps that are slow to boot, e.g. run migrations on startup. Tasks that become healthy sooner still enter service immediately. Defaults to 120 when omitted. | [optional] [default to 120] **SpotConfiguration** | Pointer to [**SpotConfiguration**](SpotConfiguration.md) | | [optional] **EnableCrossEnvNetworking** | Pointer to **NullableBool** | Optional. Enable cross-environment networking within the same application. When false (default): Uses shared security group for complete isolation (most secure). When true: Uses app-specific security group to enable communication between environments of the same application (e.g., staging can connect to production database). Note: If enableCrossAppNetworking is true, this setting is overridden. | [optional] [default to false] **EnableCrossAppNetworking** | Pointer to **NullableBool** | Optional. Enable cross-application networking within the same organization. When false (default): Uses shared/app-specific security group based on enableCrossEnvNetworking. When true: Uses org-specific security group to enable container-to-container communication with ALL applications in the same organization via service discovery (microservices architecture). This setting takes priority over enableCrossEnvNetworking. | [optional] [default to false] @@ -183,6 +185,76 @@ SetMaxCapacity sets MaxCapacity field to given value. HasMaxCapacity returns a boolean if a field has been set. +### GetSingleTaskOnly + +`func (o *Compose) GetSingleTaskOnly() bool` + +GetSingleTaskOnly returns the SingleTaskOnly field if non-nil, zero value otherwise. + +### GetSingleTaskOnlyOk + +`func (o *Compose) GetSingleTaskOnlyOk() (*bool, bool)` + +GetSingleTaskOnlyOk returns a tuple with the SingleTaskOnly field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSingleTaskOnly + +`func (o *Compose) SetSingleTaskOnly(v bool)` + +SetSingleTaskOnly sets SingleTaskOnly field to given value. + +### HasSingleTaskOnly + +`func (o *Compose) HasSingleTaskOnly() bool` + +HasSingleTaskOnly returns a boolean if a field has been set. + +### SetSingleTaskOnlyNil + +`func (o *Compose) SetSingleTaskOnlyNil(b bool)` + + SetSingleTaskOnlyNil sets the value for SingleTaskOnly to be an explicit nil + +### UnsetSingleTaskOnly +`func (o *Compose) UnsetSingleTaskOnly()` + +UnsetSingleTaskOnly ensures that no value is present for SingleTaskOnly, not even an explicit nil +### GetStartupGracePeriodSeconds + +`func (o *Compose) GetStartupGracePeriodSeconds() int32` + +GetStartupGracePeriodSeconds returns the StartupGracePeriodSeconds field if non-nil, zero value otherwise. + +### GetStartupGracePeriodSecondsOk + +`func (o *Compose) GetStartupGracePeriodSecondsOk() (*int32, bool)` + +GetStartupGracePeriodSecondsOk returns a tuple with the StartupGracePeriodSeconds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartupGracePeriodSeconds + +`func (o *Compose) SetStartupGracePeriodSeconds(v int32)` + +SetStartupGracePeriodSeconds sets StartupGracePeriodSeconds field to given value. + +### HasStartupGracePeriodSeconds + +`func (o *Compose) HasStartupGracePeriodSeconds() bool` + +HasStartupGracePeriodSeconds returns a boolean if a field has been set. + +### SetStartupGracePeriodSecondsNil + +`func (o *Compose) SetStartupGracePeriodSecondsNil(b bool)` + + SetStartupGracePeriodSecondsNil sets the value for StartupGracePeriodSeconds to be an explicit nil + +### UnsetStartupGracePeriodSeconds +`func (o *Compose) UnsetStartupGracePeriodSeconds()` + +UnsetStartupGracePeriodSeconds ensures that no value is present for StartupGracePeriodSeconds, not even an explicit nil ### GetSpotConfiguration `func (o *Compose) GetSpotConfiguration() SpotConfiguration` diff --git a/docs/CreateEnvironmentRequest.md b/docs/CreateEnvironmentRequest.md index 4d2d066..80d714d 100644 --- a/docs/CreateEnvironmentRequest.md +++ b/docs/CreateEnvironmentRequest.md @@ -7,6 +7,8 @@ Name | Type | Description | Notes **EnvName** | **string** | Environment name (e.g., 'staging', 'development') | **MinCapacity** | Pointer to **int32** | Minimum number of instances | [optional] **MaxCapacity** | Pointer to **int32** | Maximum number of instances | [optional] +**SingleTaskOnly** | Pointer to **NullableBool** | Optional. Forces single-task mode (max one running task). When omitted, the platform auto-detects stateful containers. | [optional] +**StartupGracePeriodSeconds** | Pointer to **NullableInt32** | Optional. Seconds the load balancer waits after a task starts before an unhealthy health check can replace it. If not set, the value from composeDefinition (or default 120) is used. | [optional] [default to 120] **CloneConfigurationFrom** | Pointer to **string** | Clone configuration from an existing environment | [optional] **ComposeDefinition** | Pointer to [**Compose**](Compose.md) | | [optional] **ImageSuffix** | Pointer to **string** | Optional image tag suffix for cloning | [optional] @@ -103,6 +105,76 @@ SetMaxCapacity sets MaxCapacity field to given value. HasMaxCapacity returns a boolean if a field has been set. +### GetSingleTaskOnly + +`func (o *CreateEnvironmentRequest) GetSingleTaskOnly() bool` + +GetSingleTaskOnly returns the SingleTaskOnly field if non-nil, zero value otherwise. + +### GetSingleTaskOnlyOk + +`func (o *CreateEnvironmentRequest) GetSingleTaskOnlyOk() (*bool, bool)` + +GetSingleTaskOnlyOk returns a tuple with the SingleTaskOnly field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSingleTaskOnly + +`func (o *CreateEnvironmentRequest) SetSingleTaskOnly(v bool)` + +SetSingleTaskOnly sets SingleTaskOnly field to given value. + +### HasSingleTaskOnly + +`func (o *CreateEnvironmentRequest) HasSingleTaskOnly() bool` + +HasSingleTaskOnly returns a boolean if a field has been set. + +### SetSingleTaskOnlyNil + +`func (o *CreateEnvironmentRequest) SetSingleTaskOnlyNil(b bool)` + + SetSingleTaskOnlyNil sets the value for SingleTaskOnly to be an explicit nil + +### UnsetSingleTaskOnly +`func (o *CreateEnvironmentRequest) UnsetSingleTaskOnly()` + +UnsetSingleTaskOnly ensures that no value is present for SingleTaskOnly, not even an explicit nil +### GetStartupGracePeriodSeconds + +`func (o *CreateEnvironmentRequest) GetStartupGracePeriodSeconds() int32` + +GetStartupGracePeriodSeconds returns the StartupGracePeriodSeconds field if non-nil, zero value otherwise. + +### GetStartupGracePeriodSecondsOk + +`func (o *CreateEnvironmentRequest) GetStartupGracePeriodSecondsOk() (*int32, bool)` + +GetStartupGracePeriodSecondsOk returns a tuple with the StartupGracePeriodSeconds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartupGracePeriodSeconds + +`func (o *CreateEnvironmentRequest) SetStartupGracePeriodSeconds(v int32)` + +SetStartupGracePeriodSeconds sets StartupGracePeriodSeconds field to given value. + +### HasStartupGracePeriodSeconds + +`func (o *CreateEnvironmentRequest) HasStartupGracePeriodSeconds() bool` + +HasStartupGracePeriodSeconds returns a boolean if a field has been set. + +### SetStartupGracePeriodSecondsNil + +`func (o *CreateEnvironmentRequest) SetStartupGracePeriodSecondsNil(b bool)` + + SetStartupGracePeriodSecondsNil sets the value for StartupGracePeriodSeconds to be an explicit nil + +### UnsetStartupGracePeriodSeconds +`func (o *CreateEnvironmentRequest) UnsetStartupGracePeriodSeconds()` + +UnsetStartupGracePeriodSeconds ensures that no value is present for StartupGracePeriodSeconds, not even an explicit nil ### GetCloneConfigurationFrom `func (o *CreateEnvironmentRequest) GetCloneConfigurationFrom() string` diff --git a/docs/GetGovernanceConfig200ResponseSpendLimits.md b/docs/GetGovernanceConfig200ResponseSpendLimits.md index 7cdde45..988ff96 100644 --- a/docs/GetGovernanceConfig200ResponseSpendLimits.md +++ b/docs/GetGovernanceConfig200ResponseSpendLimits.md @@ -11,6 +11,9 @@ Name | Type | Description | Notes **WarningThresholdPercent** | Pointer to **NullableInt32** | | [optional] **InterfaceLimits** | Pointer to [**map[string]GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue**](GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue.md) | Aggregate spend caps per interface label (slack, autonomous, api-gateway, streaming, websocket). Keys are interface labels. | [optional] **UserOverrides** | Pointer to [**map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue**](GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md) | Per-user budget overrides keyed by userId (numeric portal id, slack-<id>, or system:code-agent). Replaces the flat per-user budget for that user; unlimited=true exempts them. | [optional] +**PerTokenMonthlyBudgetCents** | Pointer to **NullableInt32** | Flat monthly cap in cents applied to every API token without a named override | [optional] +**PerTokenDailyBudgetCents** | Pointer to **NullableInt32** | Flat daily cap in cents applied to every API token without a named override | [optional] +**TokenOverrides** | Pointer to [**map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue**](GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue.md) | Per-token budget overrides keyed by API token id. Replaces the flat per-token budget for that token; unlimited=true exempts it. | [optional] ## Methods @@ -256,6 +259,101 @@ SetUserOverrides sets UserOverrides field to given value. HasUserOverrides returns a boolean if a field has been set. +### GetPerTokenMonthlyBudgetCents + +`func (o *GetGovernanceConfig200ResponseSpendLimits) GetPerTokenMonthlyBudgetCents() int32` + +GetPerTokenMonthlyBudgetCents returns the PerTokenMonthlyBudgetCents field if non-nil, zero value otherwise. + +### GetPerTokenMonthlyBudgetCentsOk + +`func (o *GetGovernanceConfig200ResponseSpendLimits) GetPerTokenMonthlyBudgetCentsOk() (*int32, bool)` + +GetPerTokenMonthlyBudgetCentsOk returns a tuple with the PerTokenMonthlyBudgetCents field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPerTokenMonthlyBudgetCents + +`func (o *GetGovernanceConfig200ResponseSpendLimits) SetPerTokenMonthlyBudgetCents(v int32)` + +SetPerTokenMonthlyBudgetCents sets PerTokenMonthlyBudgetCents field to given value. + +### HasPerTokenMonthlyBudgetCents + +`func (o *GetGovernanceConfig200ResponseSpendLimits) HasPerTokenMonthlyBudgetCents() bool` + +HasPerTokenMonthlyBudgetCents returns a boolean if a field has been set. + +### SetPerTokenMonthlyBudgetCentsNil + +`func (o *GetGovernanceConfig200ResponseSpendLimits) SetPerTokenMonthlyBudgetCentsNil(b bool)` + + SetPerTokenMonthlyBudgetCentsNil sets the value for PerTokenMonthlyBudgetCents to be an explicit nil + +### UnsetPerTokenMonthlyBudgetCents +`func (o *GetGovernanceConfig200ResponseSpendLimits) UnsetPerTokenMonthlyBudgetCents()` + +UnsetPerTokenMonthlyBudgetCents ensures that no value is present for PerTokenMonthlyBudgetCents, not even an explicit nil +### GetPerTokenDailyBudgetCents + +`func (o *GetGovernanceConfig200ResponseSpendLimits) GetPerTokenDailyBudgetCents() int32` + +GetPerTokenDailyBudgetCents returns the PerTokenDailyBudgetCents field if non-nil, zero value otherwise. + +### GetPerTokenDailyBudgetCentsOk + +`func (o *GetGovernanceConfig200ResponseSpendLimits) GetPerTokenDailyBudgetCentsOk() (*int32, bool)` + +GetPerTokenDailyBudgetCentsOk returns a tuple with the PerTokenDailyBudgetCents field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPerTokenDailyBudgetCents + +`func (o *GetGovernanceConfig200ResponseSpendLimits) SetPerTokenDailyBudgetCents(v int32)` + +SetPerTokenDailyBudgetCents sets PerTokenDailyBudgetCents field to given value. + +### HasPerTokenDailyBudgetCents + +`func (o *GetGovernanceConfig200ResponseSpendLimits) HasPerTokenDailyBudgetCents() bool` + +HasPerTokenDailyBudgetCents returns a boolean if a field has been set. + +### SetPerTokenDailyBudgetCentsNil + +`func (o *GetGovernanceConfig200ResponseSpendLimits) SetPerTokenDailyBudgetCentsNil(b bool)` + + SetPerTokenDailyBudgetCentsNil sets the value for PerTokenDailyBudgetCents to be an explicit nil + +### UnsetPerTokenDailyBudgetCents +`func (o *GetGovernanceConfig200ResponseSpendLimits) UnsetPerTokenDailyBudgetCents()` + +UnsetPerTokenDailyBudgetCents ensures that no value is present for PerTokenDailyBudgetCents, not even an explicit nil +### GetTokenOverrides + +`func (o *GetGovernanceConfig200ResponseSpendLimits) GetTokenOverrides() map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue` + +GetTokenOverrides returns the TokenOverrides field if non-nil, zero value otherwise. + +### GetTokenOverridesOk + +`func (o *GetGovernanceConfig200ResponseSpendLimits) GetTokenOverridesOk() (*map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue, bool)` + +GetTokenOverridesOk returns a tuple with the TokenOverrides field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTokenOverrides + +`func (o *GetGovernanceConfig200ResponseSpendLimits) SetTokenOverrides(v map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue)` + +SetTokenOverrides sets TokenOverrides field to given value. + +### HasTokenOverrides + +`func (o *GetGovernanceConfig200ResponseSpendLimits) HasTokenOverrides() bool` + +HasTokenOverrides returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/OaiChatCompletions200Response.md b/docs/OaiChatCompletions200Response.md new file mode 100644 index 0000000..3ab4b1f --- /dev/null +++ b/docs/OaiChatCompletions200Response.md @@ -0,0 +1,186 @@ +# OaiChatCompletions200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Object** | Pointer to **string** | | [optional] +**Created** | Pointer to **int32** | | [optional] +**Model** | Pointer to **string** | | [optional] +**Choices** | Pointer to [**[]OaiChatCompletions200ResponseChoicesInner**](OaiChatCompletions200ResponseChoicesInner.md) | | [optional] +**Usage** | Pointer to [**OaiChatCompletions200ResponseUsage**](OaiChatCompletions200ResponseUsage.md) | | [optional] + +## Methods + +### NewOaiChatCompletions200Response + +`func NewOaiChatCompletions200Response() *OaiChatCompletions200Response` + +NewOaiChatCompletions200Response instantiates a new OaiChatCompletions200Response 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 + +### NewOaiChatCompletions200ResponseWithDefaults + +`func NewOaiChatCompletions200ResponseWithDefaults() *OaiChatCompletions200Response` + +NewOaiChatCompletions200ResponseWithDefaults instantiates a new OaiChatCompletions200Response 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 + +### GetId + +`func (o *OaiChatCompletions200Response) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *OaiChatCompletions200Response) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *OaiChatCompletions200Response) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *OaiChatCompletions200Response) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetObject + +`func (o *OaiChatCompletions200Response) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *OaiChatCompletions200Response) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *OaiChatCompletions200Response) SetObject(v string)` + +SetObject sets Object field to given value. + +### HasObject + +`func (o *OaiChatCompletions200Response) HasObject() bool` + +HasObject returns a boolean if a field has been set. + +### GetCreated + +`func (o *OaiChatCompletions200Response) GetCreated() int32` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *OaiChatCompletions200Response) GetCreatedOk() (*int32, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *OaiChatCompletions200Response) SetCreated(v int32)` + +SetCreated sets Created field to given value. + +### HasCreated + +`func (o *OaiChatCompletions200Response) HasCreated() bool` + +HasCreated returns a boolean if a field has been set. + +### GetModel + +`func (o *OaiChatCompletions200Response) GetModel() string` + +GetModel returns the Model field if non-nil, zero value otherwise. + +### GetModelOk + +`func (o *OaiChatCompletions200Response) GetModelOk() (*string, bool)` + +GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModel + +`func (o *OaiChatCompletions200Response) SetModel(v string)` + +SetModel sets Model field to given value. + +### HasModel + +`func (o *OaiChatCompletions200Response) HasModel() bool` + +HasModel returns a boolean if a field has been set. + +### GetChoices + +`func (o *OaiChatCompletions200Response) GetChoices() []OaiChatCompletions200ResponseChoicesInner` + +GetChoices returns the Choices field if non-nil, zero value otherwise. + +### GetChoicesOk + +`func (o *OaiChatCompletions200Response) GetChoicesOk() (*[]OaiChatCompletions200ResponseChoicesInner, bool)` + +GetChoicesOk returns a tuple with the Choices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChoices + +`func (o *OaiChatCompletions200Response) SetChoices(v []OaiChatCompletions200ResponseChoicesInner)` + +SetChoices sets Choices field to given value. + +### HasChoices + +`func (o *OaiChatCompletions200Response) HasChoices() bool` + +HasChoices returns a boolean if a field has been set. + +### GetUsage + +`func (o *OaiChatCompletions200Response) GetUsage() OaiChatCompletions200ResponseUsage` + +GetUsage returns the Usage field if non-nil, zero value otherwise. + +### GetUsageOk + +`func (o *OaiChatCompletions200Response) GetUsageOk() (*OaiChatCompletions200ResponseUsage, bool)` + +GetUsageOk returns a tuple with the Usage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsage + +`func (o *OaiChatCompletions200Response) SetUsage(v OaiChatCompletions200ResponseUsage)` + +SetUsage sets Usage field to given value. + +### HasUsage + +`func (o *OaiChatCompletions200Response) HasUsage() bool` + +HasUsage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiChatCompletions200ResponseChoicesInner.md b/docs/OaiChatCompletions200ResponseChoicesInner.md new file mode 100644 index 0000000..e6005ba --- /dev/null +++ b/docs/OaiChatCompletions200ResponseChoicesInner.md @@ -0,0 +1,108 @@ +# OaiChatCompletions200ResponseChoicesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Index** | Pointer to **int32** | | [optional] +**Message** | Pointer to [**OaiChatCompletions200ResponseChoicesInnerMessage**](OaiChatCompletions200ResponseChoicesInnerMessage.md) | | [optional] +**FinishReason** | Pointer to **string** | | [optional] + +## Methods + +### NewOaiChatCompletions200ResponseChoicesInner + +`func NewOaiChatCompletions200ResponseChoicesInner() *OaiChatCompletions200ResponseChoicesInner` + +NewOaiChatCompletions200ResponseChoicesInner instantiates a new OaiChatCompletions200ResponseChoicesInner 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 + +### NewOaiChatCompletions200ResponseChoicesInnerWithDefaults + +`func NewOaiChatCompletions200ResponseChoicesInnerWithDefaults() *OaiChatCompletions200ResponseChoicesInner` + +NewOaiChatCompletions200ResponseChoicesInnerWithDefaults instantiates a new OaiChatCompletions200ResponseChoicesInner 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 + +### GetIndex + +`func (o *OaiChatCompletions200ResponseChoicesInner) GetIndex() int32` + +GetIndex returns the Index field if non-nil, zero value otherwise. + +### GetIndexOk + +`func (o *OaiChatCompletions200ResponseChoicesInner) GetIndexOk() (*int32, bool)` + +GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndex + +`func (o *OaiChatCompletions200ResponseChoicesInner) SetIndex(v int32)` + +SetIndex sets Index field to given value. + +### HasIndex + +`func (o *OaiChatCompletions200ResponseChoicesInner) HasIndex() bool` + +HasIndex returns a boolean if a field has been set. + +### GetMessage + +`func (o *OaiChatCompletions200ResponseChoicesInner) GetMessage() OaiChatCompletions200ResponseChoicesInnerMessage` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *OaiChatCompletions200ResponseChoicesInner) GetMessageOk() (*OaiChatCompletions200ResponseChoicesInnerMessage, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *OaiChatCompletions200ResponseChoicesInner) SetMessage(v OaiChatCompletions200ResponseChoicesInnerMessage)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *OaiChatCompletions200ResponseChoicesInner) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetFinishReason + +`func (o *OaiChatCompletions200ResponseChoicesInner) GetFinishReason() string` + +GetFinishReason returns the FinishReason field if non-nil, zero value otherwise. + +### GetFinishReasonOk + +`func (o *OaiChatCompletions200ResponseChoicesInner) GetFinishReasonOk() (*string, bool)` + +GetFinishReasonOk returns a tuple with the FinishReason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFinishReason + +`func (o *OaiChatCompletions200ResponseChoicesInner) SetFinishReason(v string)` + +SetFinishReason sets FinishReason field to given value. + +### HasFinishReason + +`func (o *OaiChatCompletions200ResponseChoicesInner) HasFinishReason() bool` + +HasFinishReason returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiChatCompletions200ResponseChoicesInnerMessage.md b/docs/OaiChatCompletions200ResponseChoicesInnerMessage.md new file mode 100644 index 0000000..637c8fa --- /dev/null +++ b/docs/OaiChatCompletions200ResponseChoicesInnerMessage.md @@ -0,0 +1,118 @@ +# OaiChatCompletions200ResponseChoicesInnerMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | Pointer to **string** | | [optional] +**Content** | Pointer to **NullableString** | | [optional] +**ToolCalls** | Pointer to **[]map[string]interface{}** | | [optional] + +## Methods + +### NewOaiChatCompletions200ResponseChoicesInnerMessage + +`func NewOaiChatCompletions200ResponseChoicesInnerMessage() *OaiChatCompletions200ResponseChoicesInnerMessage` + +NewOaiChatCompletions200ResponseChoicesInnerMessage instantiates a new OaiChatCompletions200ResponseChoicesInnerMessage 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 + +### NewOaiChatCompletions200ResponseChoicesInnerMessageWithDefaults + +`func NewOaiChatCompletions200ResponseChoicesInnerMessageWithDefaults() *OaiChatCompletions200ResponseChoicesInnerMessage` + +NewOaiChatCompletions200ResponseChoicesInnerMessageWithDefaults instantiates a new OaiChatCompletions200ResponseChoicesInnerMessage 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 + +### GetRole + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetContent + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) SetContent(v string)` + +SetContent sets Content field to given value. + +### HasContent + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) HasContent() bool` + +HasContent returns a boolean if a field has been set. + +### SetContentNil + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) SetContentNil(b bool)` + + SetContentNil sets the value for Content to be an explicit nil + +### UnsetContent +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) UnsetContent()` + +UnsetContent ensures that no value is present for Content, not even an explicit nil +### GetToolCalls + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetToolCalls() []map[string]interface{}` + +GetToolCalls returns the ToolCalls field if non-nil, zero value otherwise. + +### GetToolCallsOk + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetToolCallsOk() (*[]map[string]interface{}, bool)` + +GetToolCallsOk returns a tuple with the ToolCalls field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToolCalls + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) SetToolCalls(v []map[string]interface{})` + +SetToolCalls sets ToolCalls field to given value. + +### HasToolCalls + +`func (o *OaiChatCompletions200ResponseChoicesInnerMessage) HasToolCalls() bool` + +HasToolCalls returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiChatCompletions200ResponseUsage.md b/docs/OaiChatCompletions200ResponseUsage.md new file mode 100644 index 0000000..8747ae1 --- /dev/null +++ b/docs/OaiChatCompletions200ResponseUsage.md @@ -0,0 +1,108 @@ +# OaiChatCompletions200ResponseUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PromptTokens** | Pointer to **int32** | | [optional] +**CompletionTokens** | Pointer to **int32** | | [optional] +**TotalTokens** | Pointer to **int32** | | [optional] + +## Methods + +### NewOaiChatCompletions200ResponseUsage + +`func NewOaiChatCompletions200ResponseUsage() *OaiChatCompletions200ResponseUsage` + +NewOaiChatCompletions200ResponseUsage instantiates a new OaiChatCompletions200ResponseUsage 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 + +### NewOaiChatCompletions200ResponseUsageWithDefaults + +`func NewOaiChatCompletions200ResponseUsageWithDefaults() *OaiChatCompletions200ResponseUsage` + +NewOaiChatCompletions200ResponseUsageWithDefaults instantiates a new OaiChatCompletions200ResponseUsage 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 + +### GetPromptTokens + +`func (o *OaiChatCompletions200ResponseUsage) GetPromptTokens() int32` + +GetPromptTokens returns the PromptTokens field if non-nil, zero value otherwise. + +### GetPromptTokensOk + +`func (o *OaiChatCompletions200ResponseUsage) GetPromptTokensOk() (*int32, bool)` + +GetPromptTokensOk returns a tuple with the PromptTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPromptTokens + +`func (o *OaiChatCompletions200ResponseUsage) SetPromptTokens(v int32)` + +SetPromptTokens sets PromptTokens field to given value. + +### HasPromptTokens + +`func (o *OaiChatCompletions200ResponseUsage) HasPromptTokens() bool` + +HasPromptTokens returns a boolean if a field has been set. + +### GetCompletionTokens + +`func (o *OaiChatCompletions200ResponseUsage) GetCompletionTokens() int32` + +GetCompletionTokens returns the CompletionTokens field if non-nil, zero value otherwise. + +### GetCompletionTokensOk + +`func (o *OaiChatCompletions200ResponseUsage) GetCompletionTokensOk() (*int32, bool)` + +GetCompletionTokensOk returns a tuple with the CompletionTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompletionTokens + +`func (o *OaiChatCompletions200ResponseUsage) SetCompletionTokens(v int32)` + +SetCompletionTokens sets CompletionTokens field to given value. + +### HasCompletionTokens + +`func (o *OaiChatCompletions200ResponseUsage) HasCompletionTokens() bool` + +HasCompletionTokens returns a boolean if a field has been set. + +### GetTotalTokens + +`func (o *OaiChatCompletions200ResponseUsage) GetTotalTokens() int32` + +GetTotalTokens returns the TotalTokens field if non-nil, zero value otherwise. + +### GetTotalTokensOk + +`func (o *OaiChatCompletions200ResponseUsage) GetTotalTokensOk() (*int32, bool)` + +GetTotalTokensOk returns a tuple with the TotalTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalTokens + +`func (o *OaiChatCompletions200ResponseUsage) SetTotalTokens(v int32)` + +SetTotalTokens sets TotalTokens field to given value. + +### HasTotalTokens + +`func (o *OaiChatCompletions200ResponseUsage) HasTotalTokens() bool` + +HasTotalTokens returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiChatCompletionsRequest.md b/docs/OaiChatCompletionsRequest.md new file mode 100644 index 0000000..66bc584 --- /dev/null +++ b/docs/OaiChatCompletionsRequest.md @@ -0,0 +1,264 @@ +# OaiChatCompletionsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Model** | **string** | A model id from GET /oai/v1/models | +**Messages** | [**[]OaiChatCompletionsRequestMessagesInner**](OaiChatCompletionsRequestMessagesInner.md) | | +**Stream** | Pointer to **bool** | Stream the response as SSE chat.completion.chunk events | [optional] [default to false] +**MaxTokens** | Pointer to **int32** | | [optional] +**Temperature** | Pointer to **float32** | | [optional] +**TopP** | Pointer to **float32** | | [optional] +**Tools** | Pointer to **[]map[string]interface{}** | OpenAI function tool definitions | [optional] +**ToolChoice** | Pointer to **interface{}** | auto | none | required | {type:function, function:{name}} | [optional] +**StreamOptions** | Pointer to **map[string]interface{}** | {include_usage: true} to emit a final usage chunk when streaming | [optional] + +## Methods + +### NewOaiChatCompletionsRequest + +`func NewOaiChatCompletionsRequest(model string, messages []OaiChatCompletionsRequestMessagesInner, ) *OaiChatCompletionsRequest` + +NewOaiChatCompletionsRequest instantiates a new OaiChatCompletionsRequest 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 + +### NewOaiChatCompletionsRequestWithDefaults + +`func NewOaiChatCompletionsRequestWithDefaults() *OaiChatCompletionsRequest` + +NewOaiChatCompletionsRequestWithDefaults instantiates a new OaiChatCompletionsRequest 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 + +### GetModel + +`func (o *OaiChatCompletionsRequest) GetModel() string` + +GetModel returns the Model field if non-nil, zero value otherwise. + +### GetModelOk + +`func (o *OaiChatCompletionsRequest) GetModelOk() (*string, bool)` + +GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModel + +`func (o *OaiChatCompletionsRequest) SetModel(v string)` + +SetModel sets Model field to given value. + + +### GetMessages + +`func (o *OaiChatCompletionsRequest) GetMessages() []OaiChatCompletionsRequestMessagesInner` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *OaiChatCompletionsRequest) GetMessagesOk() (*[]OaiChatCompletionsRequestMessagesInner, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *OaiChatCompletionsRequest) SetMessages(v []OaiChatCompletionsRequestMessagesInner)` + +SetMessages sets Messages field to given value. + + +### GetStream + +`func (o *OaiChatCompletionsRequest) GetStream() bool` + +GetStream returns the Stream field if non-nil, zero value otherwise. + +### GetStreamOk + +`func (o *OaiChatCompletionsRequest) GetStreamOk() (*bool, bool)` + +GetStreamOk returns a tuple with the Stream field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStream + +`func (o *OaiChatCompletionsRequest) SetStream(v bool)` + +SetStream sets Stream field to given value. + +### HasStream + +`func (o *OaiChatCompletionsRequest) HasStream() bool` + +HasStream returns a boolean if a field has been set. + +### GetMaxTokens + +`func (o *OaiChatCompletionsRequest) GetMaxTokens() int32` + +GetMaxTokens returns the MaxTokens field if non-nil, zero value otherwise. + +### GetMaxTokensOk + +`func (o *OaiChatCompletionsRequest) GetMaxTokensOk() (*int32, bool)` + +GetMaxTokensOk returns a tuple with the MaxTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxTokens + +`func (o *OaiChatCompletionsRequest) SetMaxTokens(v int32)` + +SetMaxTokens sets MaxTokens field to given value. + +### HasMaxTokens + +`func (o *OaiChatCompletionsRequest) HasMaxTokens() bool` + +HasMaxTokens returns a boolean if a field has been set. + +### GetTemperature + +`func (o *OaiChatCompletionsRequest) GetTemperature() float32` + +GetTemperature returns the Temperature field if non-nil, zero value otherwise. + +### GetTemperatureOk + +`func (o *OaiChatCompletionsRequest) GetTemperatureOk() (*float32, bool)` + +GetTemperatureOk returns a tuple with the Temperature field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTemperature + +`func (o *OaiChatCompletionsRequest) SetTemperature(v float32)` + +SetTemperature sets Temperature field to given value. + +### HasTemperature + +`func (o *OaiChatCompletionsRequest) HasTemperature() bool` + +HasTemperature returns a boolean if a field has been set. + +### GetTopP + +`func (o *OaiChatCompletionsRequest) GetTopP() float32` + +GetTopP returns the TopP field if non-nil, zero value otherwise. + +### GetTopPOk + +`func (o *OaiChatCompletionsRequest) GetTopPOk() (*float32, bool)` + +GetTopPOk returns a tuple with the TopP field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTopP + +`func (o *OaiChatCompletionsRequest) SetTopP(v float32)` + +SetTopP sets TopP field to given value. + +### HasTopP + +`func (o *OaiChatCompletionsRequest) HasTopP() bool` + +HasTopP returns a boolean if a field has been set. + +### GetTools + +`func (o *OaiChatCompletionsRequest) GetTools() []map[string]interface{}` + +GetTools returns the Tools field if non-nil, zero value otherwise. + +### GetToolsOk + +`func (o *OaiChatCompletionsRequest) GetToolsOk() (*[]map[string]interface{}, bool)` + +GetToolsOk returns a tuple with the Tools field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTools + +`func (o *OaiChatCompletionsRequest) SetTools(v []map[string]interface{})` + +SetTools sets Tools field to given value. + +### HasTools + +`func (o *OaiChatCompletionsRequest) HasTools() bool` + +HasTools returns a boolean if a field has been set. + +### GetToolChoice + +`func (o *OaiChatCompletionsRequest) GetToolChoice() interface{}` + +GetToolChoice returns the ToolChoice field if non-nil, zero value otherwise. + +### GetToolChoiceOk + +`func (o *OaiChatCompletionsRequest) GetToolChoiceOk() (*interface{}, bool)` + +GetToolChoiceOk returns a tuple with the ToolChoice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToolChoice + +`func (o *OaiChatCompletionsRequest) SetToolChoice(v interface{})` + +SetToolChoice sets ToolChoice field to given value. + +### HasToolChoice + +`func (o *OaiChatCompletionsRequest) HasToolChoice() bool` + +HasToolChoice returns a boolean if a field has been set. + +### SetToolChoiceNil + +`func (o *OaiChatCompletionsRequest) SetToolChoiceNil(b bool)` + + SetToolChoiceNil sets the value for ToolChoice to be an explicit nil + +### UnsetToolChoice +`func (o *OaiChatCompletionsRequest) UnsetToolChoice()` + +UnsetToolChoice ensures that no value is present for ToolChoice, not even an explicit nil +### GetStreamOptions + +`func (o *OaiChatCompletionsRequest) GetStreamOptions() map[string]interface{}` + +GetStreamOptions returns the StreamOptions field if non-nil, zero value otherwise. + +### GetStreamOptionsOk + +`func (o *OaiChatCompletionsRequest) GetStreamOptionsOk() (*map[string]interface{}, bool)` + +GetStreamOptionsOk returns a tuple with the StreamOptions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStreamOptions + +`func (o *OaiChatCompletionsRequest) SetStreamOptions(v map[string]interface{})` + +SetStreamOptions sets StreamOptions field to given value. + +### HasStreamOptions + +`func (o *OaiChatCompletionsRequest) HasStreamOptions() bool` + +HasStreamOptions returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiChatCompletionsRequestMessagesInner.md b/docs/OaiChatCompletionsRequestMessagesInner.md new file mode 100644 index 0000000..583386f --- /dev/null +++ b/docs/OaiChatCompletionsRequestMessagesInner.md @@ -0,0 +1,82 @@ +# OaiChatCompletionsRequestMessagesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | Pointer to **string** | | [optional] +**Content** | Pointer to **string** | | [optional] + +## Methods + +### NewOaiChatCompletionsRequestMessagesInner + +`func NewOaiChatCompletionsRequestMessagesInner() *OaiChatCompletionsRequestMessagesInner` + +NewOaiChatCompletionsRequestMessagesInner instantiates a new OaiChatCompletionsRequestMessagesInner 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 + +### NewOaiChatCompletionsRequestMessagesInnerWithDefaults + +`func NewOaiChatCompletionsRequestMessagesInnerWithDefaults() *OaiChatCompletionsRequestMessagesInner` + +NewOaiChatCompletionsRequestMessagesInnerWithDefaults instantiates a new OaiChatCompletionsRequestMessagesInner 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 + +### GetRole + +`func (o *OaiChatCompletionsRequestMessagesInner) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *OaiChatCompletionsRequestMessagesInner) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *OaiChatCompletionsRequestMessagesInner) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *OaiChatCompletionsRequestMessagesInner) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetContent + +`func (o *OaiChatCompletionsRequestMessagesInner) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *OaiChatCompletionsRequestMessagesInner) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *OaiChatCompletionsRequestMessagesInner) SetContent(v string)` + +SetContent sets Content field to given value. + +### HasContent + +`func (o *OaiChatCompletionsRequestMessagesInner) HasContent() bool` + +HasContent returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiEmbeddings200Response.md b/docs/OaiEmbeddings200Response.md new file mode 100644 index 0000000..64c28c7 --- /dev/null +++ b/docs/OaiEmbeddings200Response.md @@ -0,0 +1,134 @@ +# OaiEmbeddings200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Object** | Pointer to **string** | | [optional] +**Data** | Pointer to [**[]OaiEmbeddings200ResponseDataInner**](OaiEmbeddings200ResponseDataInner.md) | | [optional] +**Model** | Pointer to **string** | | [optional] +**Usage** | Pointer to [**OaiEmbeddings200ResponseUsage**](OaiEmbeddings200ResponseUsage.md) | | [optional] + +## Methods + +### NewOaiEmbeddings200Response + +`func NewOaiEmbeddings200Response() *OaiEmbeddings200Response` + +NewOaiEmbeddings200Response instantiates a new OaiEmbeddings200Response 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 + +### NewOaiEmbeddings200ResponseWithDefaults + +`func NewOaiEmbeddings200ResponseWithDefaults() *OaiEmbeddings200Response` + +NewOaiEmbeddings200ResponseWithDefaults instantiates a new OaiEmbeddings200Response 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 + +### GetObject + +`func (o *OaiEmbeddings200Response) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *OaiEmbeddings200Response) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *OaiEmbeddings200Response) SetObject(v string)` + +SetObject sets Object field to given value. + +### HasObject + +`func (o *OaiEmbeddings200Response) HasObject() bool` + +HasObject returns a boolean if a field has been set. + +### GetData + +`func (o *OaiEmbeddings200Response) GetData() []OaiEmbeddings200ResponseDataInner` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *OaiEmbeddings200Response) GetDataOk() (*[]OaiEmbeddings200ResponseDataInner, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *OaiEmbeddings200Response) SetData(v []OaiEmbeddings200ResponseDataInner)` + +SetData sets Data field to given value. + +### HasData + +`func (o *OaiEmbeddings200Response) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetModel + +`func (o *OaiEmbeddings200Response) GetModel() string` + +GetModel returns the Model field if non-nil, zero value otherwise. + +### GetModelOk + +`func (o *OaiEmbeddings200Response) GetModelOk() (*string, bool)` + +GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModel + +`func (o *OaiEmbeddings200Response) SetModel(v string)` + +SetModel sets Model field to given value. + +### HasModel + +`func (o *OaiEmbeddings200Response) HasModel() bool` + +HasModel returns a boolean if a field has been set. + +### GetUsage + +`func (o *OaiEmbeddings200Response) GetUsage() OaiEmbeddings200ResponseUsage` + +GetUsage returns the Usage field if non-nil, zero value otherwise. + +### GetUsageOk + +`func (o *OaiEmbeddings200Response) GetUsageOk() (*OaiEmbeddings200ResponseUsage, bool)` + +GetUsageOk returns a tuple with the Usage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsage + +`func (o *OaiEmbeddings200Response) SetUsage(v OaiEmbeddings200ResponseUsage)` + +SetUsage sets Usage field to given value. + +### HasUsage + +`func (o *OaiEmbeddings200Response) HasUsage() bool` + +HasUsage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiEmbeddings200ResponseDataInner.md b/docs/OaiEmbeddings200ResponseDataInner.md new file mode 100644 index 0000000..1ec209c --- /dev/null +++ b/docs/OaiEmbeddings200ResponseDataInner.md @@ -0,0 +1,108 @@ +# OaiEmbeddings200ResponseDataInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Object** | Pointer to **string** | | [optional] +**Index** | Pointer to **int32** | | [optional] +**Embedding** | Pointer to **[]float32** | | [optional] + +## Methods + +### NewOaiEmbeddings200ResponseDataInner + +`func NewOaiEmbeddings200ResponseDataInner() *OaiEmbeddings200ResponseDataInner` + +NewOaiEmbeddings200ResponseDataInner instantiates a new OaiEmbeddings200ResponseDataInner 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 + +### NewOaiEmbeddings200ResponseDataInnerWithDefaults + +`func NewOaiEmbeddings200ResponseDataInnerWithDefaults() *OaiEmbeddings200ResponseDataInner` + +NewOaiEmbeddings200ResponseDataInnerWithDefaults instantiates a new OaiEmbeddings200ResponseDataInner 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 + +### GetObject + +`func (o *OaiEmbeddings200ResponseDataInner) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *OaiEmbeddings200ResponseDataInner) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *OaiEmbeddings200ResponseDataInner) SetObject(v string)` + +SetObject sets Object field to given value. + +### HasObject + +`func (o *OaiEmbeddings200ResponseDataInner) HasObject() bool` + +HasObject returns a boolean if a field has been set. + +### GetIndex + +`func (o *OaiEmbeddings200ResponseDataInner) GetIndex() int32` + +GetIndex returns the Index field if non-nil, zero value otherwise. + +### GetIndexOk + +`func (o *OaiEmbeddings200ResponseDataInner) GetIndexOk() (*int32, bool)` + +GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndex + +`func (o *OaiEmbeddings200ResponseDataInner) SetIndex(v int32)` + +SetIndex sets Index field to given value. + +### HasIndex + +`func (o *OaiEmbeddings200ResponseDataInner) HasIndex() bool` + +HasIndex returns a boolean if a field has been set. + +### GetEmbedding + +`func (o *OaiEmbeddings200ResponseDataInner) GetEmbedding() []float32` + +GetEmbedding returns the Embedding field if non-nil, zero value otherwise. + +### GetEmbeddingOk + +`func (o *OaiEmbeddings200ResponseDataInner) GetEmbeddingOk() (*[]float32, bool)` + +GetEmbeddingOk returns a tuple with the Embedding field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmbedding + +`func (o *OaiEmbeddings200ResponseDataInner) SetEmbedding(v []float32)` + +SetEmbedding sets Embedding field to given value. + +### HasEmbedding + +`func (o *OaiEmbeddings200ResponseDataInner) HasEmbedding() bool` + +HasEmbedding returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiEmbeddings200ResponseUsage.md b/docs/OaiEmbeddings200ResponseUsage.md new file mode 100644 index 0000000..9d29f03 --- /dev/null +++ b/docs/OaiEmbeddings200ResponseUsage.md @@ -0,0 +1,82 @@ +# OaiEmbeddings200ResponseUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PromptTokens** | Pointer to **int32** | | [optional] +**TotalTokens** | Pointer to **int32** | | [optional] + +## Methods + +### NewOaiEmbeddings200ResponseUsage + +`func NewOaiEmbeddings200ResponseUsage() *OaiEmbeddings200ResponseUsage` + +NewOaiEmbeddings200ResponseUsage instantiates a new OaiEmbeddings200ResponseUsage 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 + +### NewOaiEmbeddings200ResponseUsageWithDefaults + +`func NewOaiEmbeddings200ResponseUsageWithDefaults() *OaiEmbeddings200ResponseUsage` + +NewOaiEmbeddings200ResponseUsageWithDefaults instantiates a new OaiEmbeddings200ResponseUsage 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 + +### GetPromptTokens + +`func (o *OaiEmbeddings200ResponseUsage) GetPromptTokens() int32` + +GetPromptTokens returns the PromptTokens field if non-nil, zero value otherwise. + +### GetPromptTokensOk + +`func (o *OaiEmbeddings200ResponseUsage) GetPromptTokensOk() (*int32, bool)` + +GetPromptTokensOk returns a tuple with the PromptTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPromptTokens + +`func (o *OaiEmbeddings200ResponseUsage) SetPromptTokens(v int32)` + +SetPromptTokens sets PromptTokens field to given value. + +### HasPromptTokens + +`func (o *OaiEmbeddings200ResponseUsage) HasPromptTokens() bool` + +HasPromptTokens returns a boolean if a field has been set. + +### GetTotalTokens + +`func (o *OaiEmbeddings200ResponseUsage) GetTotalTokens() int32` + +GetTotalTokens returns the TotalTokens field if non-nil, zero value otherwise. + +### GetTotalTokensOk + +`func (o *OaiEmbeddings200ResponseUsage) GetTotalTokensOk() (*int32, bool)` + +GetTotalTokensOk returns a tuple with the TotalTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalTokens + +`func (o *OaiEmbeddings200ResponseUsage) SetTotalTokens(v int32)` + +SetTotalTokens sets TotalTokens field to given value. + +### HasTotalTokens + +`func (o *OaiEmbeddings200ResponseUsage) HasTotalTokens() bool` + +HasTotalTokens returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiEmbeddingsRequest.md b/docs/OaiEmbeddingsRequest.md new file mode 100644 index 0000000..abd363e --- /dev/null +++ b/docs/OaiEmbeddingsRequest.md @@ -0,0 +1,82 @@ +# OaiEmbeddingsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Model** | **string** | | +**Input** | **interface{}** | A string or array of strings to embed | + +## Methods + +### NewOaiEmbeddingsRequest + +`func NewOaiEmbeddingsRequest(model string, input interface{}, ) *OaiEmbeddingsRequest` + +NewOaiEmbeddingsRequest instantiates a new OaiEmbeddingsRequest 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 + +### NewOaiEmbeddingsRequestWithDefaults + +`func NewOaiEmbeddingsRequestWithDefaults() *OaiEmbeddingsRequest` + +NewOaiEmbeddingsRequestWithDefaults instantiates a new OaiEmbeddingsRequest 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 + +### GetModel + +`func (o *OaiEmbeddingsRequest) GetModel() string` + +GetModel returns the Model field if non-nil, zero value otherwise. + +### GetModelOk + +`func (o *OaiEmbeddingsRequest) GetModelOk() (*string, bool)` + +GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModel + +`func (o *OaiEmbeddingsRequest) SetModel(v string)` + +SetModel sets Model field to given value. + + +### GetInput + +`func (o *OaiEmbeddingsRequest) GetInput() interface{}` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *OaiEmbeddingsRequest) GetInputOk() (*interface{}, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *OaiEmbeddingsRequest) SetInput(v interface{})` + +SetInput sets Input field to given value. + + +### SetInputNil + +`func (o *OaiEmbeddingsRequest) SetInputNil(b bool)` + + SetInputNil sets the value for Input to be an explicit nil + +### UnsetInput +`func (o *OaiEmbeddingsRequest) UnsetInput()` + +UnsetInput ensures that no value is present for Input, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiGetModel200Response.md b/docs/OaiGetModel200Response.md new file mode 100644 index 0000000..6c12fc3 --- /dev/null +++ b/docs/OaiGetModel200Response.md @@ -0,0 +1,134 @@ +# OaiGetModel200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Object** | Pointer to **string** | | [optional] +**Created** | Pointer to **int32** | | [optional] +**OwnedBy** | Pointer to **string** | | [optional] + +## Methods + +### NewOaiGetModel200Response + +`func NewOaiGetModel200Response() *OaiGetModel200Response` + +NewOaiGetModel200Response instantiates a new OaiGetModel200Response 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 + +### NewOaiGetModel200ResponseWithDefaults + +`func NewOaiGetModel200ResponseWithDefaults() *OaiGetModel200Response` + +NewOaiGetModel200ResponseWithDefaults instantiates a new OaiGetModel200Response 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 + +### GetId + +`func (o *OaiGetModel200Response) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *OaiGetModel200Response) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *OaiGetModel200Response) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *OaiGetModel200Response) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetObject + +`func (o *OaiGetModel200Response) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *OaiGetModel200Response) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *OaiGetModel200Response) SetObject(v string)` + +SetObject sets Object field to given value. + +### HasObject + +`func (o *OaiGetModel200Response) HasObject() bool` + +HasObject returns a boolean if a field has been set. + +### GetCreated + +`func (o *OaiGetModel200Response) GetCreated() int32` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *OaiGetModel200Response) GetCreatedOk() (*int32, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *OaiGetModel200Response) SetCreated(v int32)` + +SetCreated sets Created field to given value. + +### HasCreated + +`func (o *OaiGetModel200Response) HasCreated() bool` + +HasCreated returns a boolean if a field has been set. + +### GetOwnedBy + +`func (o *OaiGetModel200Response) GetOwnedBy() string` + +GetOwnedBy returns the OwnedBy field if non-nil, zero value otherwise. + +### GetOwnedByOk + +`func (o *OaiGetModel200Response) GetOwnedByOk() (*string, bool)` + +GetOwnedByOk returns a tuple with the OwnedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOwnedBy + +`func (o *OaiGetModel200Response) SetOwnedBy(v string)` + +SetOwnedBy sets OwnedBy field to given value. + +### HasOwnedBy + +`func (o *OaiGetModel200Response) HasOwnedBy() bool` + +HasOwnedBy returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiListModels200Response.md b/docs/OaiListModels200Response.md new file mode 100644 index 0000000..0609831 --- /dev/null +++ b/docs/OaiListModels200Response.md @@ -0,0 +1,82 @@ +# OaiListModels200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Object** | Pointer to **string** | | [optional] +**Data** | Pointer to [**[]OaiListModels200ResponseDataInner**](OaiListModels200ResponseDataInner.md) | | [optional] + +## Methods + +### NewOaiListModels200Response + +`func NewOaiListModels200Response() *OaiListModels200Response` + +NewOaiListModels200Response instantiates a new OaiListModels200Response 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 + +### NewOaiListModels200ResponseWithDefaults + +`func NewOaiListModels200ResponseWithDefaults() *OaiListModels200Response` + +NewOaiListModels200ResponseWithDefaults instantiates a new OaiListModels200Response 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 + +### GetObject + +`func (o *OaiListModels200Response) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *OaiListModels200Response) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *OaiListModels200Response) SetObject(v string)` + +SetObject sets Object field to given value. + +### HasObject + +`func (o *OaiListModels200Response) HasObject() bool` + +HasObject returns a boolean if a field has been set. + +### GetData + +`func (o *OaiListModels200Response) GetData() []OaiListModels200ResponseDataInner` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *OaiListModels200Response) GetDataOk() (*[]OaiListModels200ResponseDataInner, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *OaiListModels200Response) SetData(v []OaiListModels200ResponseDataInner)` + +SetData sets Data field to given value. + +### HasData + +`func (o *OaiListModels200Response) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OaiListModels200ResponseDataInner.md b/docs/OaiListModels200ResponseDataInner.md new file mode 100644 index 0000000..1f284df --- /dev/null +++ b/docs/OaiListModels200ResponseDataInner.md @@ -0,0 +1,134 @@ +# OaiListModels200ResponseDataInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Object** | Pointer to **string** | | [optional] +**Created** | Pointer to **int32** | | [optional] +**OwnedBy** | Pointer to **string** | | [optional] + +## Methods + +### NewOaiListModels200ResponseDataInner + +`func NewOaiListModels200ResponseDataInner() *OaiListModels200ResponseDataInner` + +NewOaiListModels200ResponseDataInner instantiates a new OaiListModels200ResponseDataInner 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 + +### NewOaiListModels200ResponseDataInnerWithDefaults + +`func NewOaiListModels200ResponseDataInnerWithDefaults() *OaiListModels200ResponseDataInner` + +NewOaiListModels200ResponseDataInnerWithDefaults instantiates a new OaiListModels200ResponseDataInner 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 + +### GetId + +`func (o *OaiListModels200ResponseDataInner) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *OaiListModels200ResponseDataInner) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *OaiListModels200ResponseDataInner) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *OaiListModels200ResponseDataInner) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetObject + +`func (o *OaiListModels200ResponseDataInner) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *OaiListModels200ResponseDataInner) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *OaiListModels200ResponseDataInner) SetObject(v string)` + +SetObject sets Object field to given value. + +### HasObject + +`func (o *OaiListModels200ResponseDataInner) HasObject() bool` + +HasObject returns a boolean if a field has been set. + +### GetCreated + +`func (o *OaiListModels200ResponseDataInner) GetCreated() int32` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *OaiListModels200ResponseDataInner) GetCreatedOk() (*int32, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *OaiListModels200ResponseDataInner) SetCreated(v int32)` + +SetCreated sets Created field to given value. + +### HasCreated + +`func (o *OaiListModels200ResponseDataInner) HasCreated() bool` + +HasCreated returns a boolean if a field has been set. + +### GetOwnedBy + +`func (o *OaiListModels200ResponseDataInner) GetOwnedBy() string` + +GetOwnedBy returns the OwnedBy field if non-nil, zero value otherwise. + +### GetOwnedByOk + +`func (o *OaiListModels200ResponseDataInner) GetOwnedByOk() (*string, bool)` + +GetOwnedByOk returns a tuple with the OwnedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOwnedBy + +`func (o *OaiListModels200ResponseDataInner) SetOwnedBy(v string)` + +SetOwnedBy sets OwnedBy field to given value. + +### HasOwnedBy + +`func (o *OaiListModels200ResponseDataInner) HasOwnedBy() bool` + +HasOwnedBy returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OpenAICompatibilityAPI.md b/docs/OpenAICompatibilityAPI.md new file mode 100644 index 0000000..cfb8a09 --- /dev/null +++ b/docs/OpenAICompatibilityAPI.md @@ -0,0 +1,275 @@ +# \OpenAICompatibilityAPI + +All URIs are relative to *https://dashboard.quantcdn.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**OaiChatCompletions**](OpenAICompatibilityAPI.md#OaiChatCompletions) | **Post** /oai/v1/chat/completions | Create a chat completion (OpenAI-compatible) +[**OaiEmbeddings**](OpenAICompatibilityAPI.md#OaiEmbeddings) | **Post** /oai/v1/embeddings | Create embeddings (OpenAI-compatible) +[**OaiGetModel**](OpenAICompatibilityAPI.md#OaiGetModel) | **Get** /oai/v1/models/{model} | Retrieve a model (OpenAI-compatible) +[**OaiListModels**](OpenAICompatibilityAPI.md#OaiListModels) | **Get** /oai/v1/models | List available models (OpenAI-compatible) + + + +## OaiChatCompletions + +> OaiChatCompletions200Response OaiChatCompletions(ctx).OaiChatCompletionsRequest(oaiChatCompletionsRequest).Execute() + +Create a chat completion (OpenAI-compatible) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/quantcdn/quant-admin-go" +) + +func main() { + oaiChatCompletionsRequest := *openapiclient.NewOaiChatCompletionsRequest("anthropic.claude-sonnet-4-6", []openapiclient.OaiChatCompletionsRequestMessagesInner{*openapiclient.NewOaiChatCompletionsRequestMessagesInner()}) // OaiChatCompletionsRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OpenAICompatibilityAPI.OaiChatCompletions(context.Background()).OaiChatCompletionsRequest(oaiChatCompletionsRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OpenAICompatibilityAPI.OaiChatCompletions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `OaiChatCompletions`: OaiChatCompletions200Response + fmt.Fprintf(os.Stdout, "Response from `OpenAICompatibilityAPI.OaiChatCompletions`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiOaiChatCompletionsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oaiChatCompletionsRequest** | [**OaiChatCompletionsRequest**](OaiChatCompletionsRequest.md) | | + +### Return type + +[**OaiChatCompletions200Response**](OaiChatCompletions200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## OaiEmbeddings + +> OaiEmbeddings200Response OaiEmbeddings(ctx).OaiEmbeddingsRequest(oaiEmbeddingsRequest).Execute() + +Create embeddings (OpenAI-compatible) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/quantcdn/quant-admin-go" +) + +func main() { + oaiEmbeddingsRequest := *openapiclient.NewOaiEmbeddingsRequest("amazon.titan-embed-text-v2:0", interface{}(123)) // OaiEmbeddingsRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OpenAICompatibilityAPI.OaiEmbeddings(context.Background()).OaiEmbeddingsRequest(oaiEmbeddingsRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OpenAICompatibilityAPI.OaiEmbeddings``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `OaiEmbeddings`: OaiEmbeddings200Response + fmt.Fprintf(os.Stdout, "Response from `OpenAICompatibilityAPI.OaiEmbeddings`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiOaiEmbeddingsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oaiEmbeddingsRequest** | [**OaiEmbeddingsRequest**](OaiEmbeddingsRequest.md) | | + +### Return type + +[**OaiEmbeddings200Response**](OaiEmbeddings200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## OaiGetModel + +> OaiGetModel200Response OaiGetModel(ctx, model).Execute() + +Retrieve a model (OpenAI-compatible) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/quantcdn/quant-admin-go" +) + +func main() { + model := "amazon.nova-micro-v1:0" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OpenAICompatibilityAPI.OaiGetModel(context.Background(), model).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OpenAICompatibilityAPI.OaiGetModel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `OaiGetModel`: OaiGetModel200Response + fmt.Fprintf(os.Stdout, "Response from `OpenAICompatibilityAPI.OaiGetModel`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**model** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiOaiGetModelRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**OaiGetModel200Response**](OaiGetModel200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## OaiListModels + +> OaiListModels200Response OaiListModels(ctx).Execute() + +List available models (OpenAI-compatible) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/quantcdn/quant-admin-go" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OpenAICompatibilityAPI.OaiListModels(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OpenAICompatibilityAPI.OaiListModels``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `OaiListModels`: OaiListModels200Response + fmt.Fprintf(os.Stdout, "Response from `OpenAICompatibilityAPI.OaiListModels`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiOaiListModelsRequest struct via the builder pattern + + +### Return type + +[**OaiListModels200Response**](OaiListModels200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/PatchEnvironmentComposeRequest.md b/docs/PatchEnvironmentComposeRequest.md index 0294284..e5d923b 100644 --- a/docs/PatchEnvironmentComposeRequest.md +++ b/docs/PatchEnvironmentComposeRequest.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **TaskMemory** | Pointer to **NullableString** | | [optional] **MinCapacity** | Pointer to **NullableInt32** | | [optional] **MaxCapacity** | Pointer to **NullableInt32** | | [optional] +**SingleTaskOnly** | Pointer to **NullableBool** | Forces single-task mode (max one running task). Omitted = auto-detect from stateful containers. | [optional] +**StartupGracePeriodSeconds** | Pointer to **NullableInt32** | Seconds the load balancer waits after a task starts before an unhealthy health check can replace it. Default 120. | [optional] **Containers** | Pointer to **[]map[string]interface{}** | | [optional] **SpotConfiguration** | Pointer to [**NullablePatchEnvironmentComposeRequestSpotConfiguration**](PatchEnvironmentComposeRequestSpotConfiguration.md) | | [optional] **EnableCrossEnvNetworking** | Pointer to **NullableBool** | | [optional] @@ -208,6 +210,76 @@ HasMaxCapacity returns a boolean if a field has been set. `func (o *PatchEnvironmentComposeRequest) UnsetMaxCapacity()` UnsetMaxCapacity ensures that no value is present for MaxCapacity, not even an explicit nil +### GetSingleTaskOnly + +`func (o *PatchEnvironmentComposeRequest) GetSingleTaskOnly() bool` + +GetSingleTaskOnly returns the SingleTaskOnly field if non-nil, zero value otherwise. + +### GetSingleTaskOnlyOk + +`func (o *PatchEnvironmentComposeRequest) GetSingleTaskOnlyOk() (*bool, bool)` + +GetSingleTaskOnlyOk returns a tuple with the SingleTaskOnly field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSingleTaskOnly + +`func (o *PatchEnvironmentComposeRequest) SetSingleTaskOnly(v bool)` + +SetSingleTaskOnly sets SingleTaskOnly field to given value. + +### HasSingleTaskOnly + +`func (o *PatchEnvironmentComposeRequest) HasSingleTaskOnly() bool` + +HasSingleTaskOnly returns a boolean if a field has been set. + +### SetSingleTaskOnlyNil + +`func (o *PatchEnvironmentComposeRequest) SetSingleTaskOnlyNil(b bool)` + + SetSingleTaskOnlyNil sets the value for SingleTaskOnly to be an explicit nil + +### UnsetSingleTaskOnly +`func (o *PatchEnvironmentComposeRequest) UnsetSingleTaskOnly()` + +UnsetSingleTaskOnly ensures that no value is present for SingleTaskOnly, not even an explicit nil +### GetStartupGracePeriodSeconds + +`func (o *PatchEnvironmentComposeRequest) GetStartupGracePeriodSeconds() int32` + +GetStartupGracePeriodSeconds returns the StartupGracePeriodSeconds field if non-nil, zero value otherwise. + +### GetStartupGracePeriodSecondsOk + +`func (o *PatchEnvironmentComposeRequest) GetStartupGracePeriodSecondsOk() (*int32, bool)` + +GetStartupGracePeriodSecondsOk returns a tuple with the StartupGracePeriodSeconds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartupGracePeriodSeconds + +`func (o *PatchEnvironmentComposeRequest) SetStartupGracePeriodSeconds(v int32)` + +SetStartupGracePeriodSeconds sets StartupGracePeriodSeconds field to given value. + +### HasStartupGracePeriodSeconds + +`func (o *PatchEnvironmentComposeRequest) HasStartupGracePeriodSeconds() bool` + +HasStartupGracePeriodSeconds returns a boolean if a field has been set. + +### SetStartupGracePeriodSecondsNil + +`func (o *PatchEnvironmentComposeRequest) SetStartupGracePeriodSecondsNil(b bool)` + + SetStartupGracePeriodSecondsNil sets the value for StartupGracePeriodSeconds to be an explicit nil + +### UnsetStartupGracePeriodSeconds +`func (o *PatchEnvironmentComposeRequest) UnsetStartupGracePeriodSeconds()` + +UnsetStartupGracePeriodSeconds ensures that no value is present for StartupGracePeriodSeconds, not even an explicit nil ### GetContainers `func (o *PatchEnvironmentComposeRequest) GetContainers() []map[string]interface{}` diff --git a/model_application.go b/model_application.go index 5018bb3..ea54c06 100644 --- a/model_application.go +++ b/model_application.go @@ -26,6 +26,7 @@ type Application struct { Organisation string `json:"organisation"` Database NullableApplicationDatabase `json:"database,omitempty"` Filesystem NullableApplicationFilesystem `json:"filesystem,omitempty"` + Cache NullableApplicationCache `json:"cache,omitempty"` ComposeDefinition *Compose `json:"composeDefinition,omitempty"` // Application status Status NullableString `json:"status,omitempty"` @@ -200,6 +201,48 @@ func (o *Application) UnsetFilesystem() { o.Filesystem.Unset() } +// GetCache returns the Cache field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Application) GetCache() ApplicationCache { + if o == nil || IsNil(o.Cache.Get()) { + var ret ApplicationCache + return ret + } + return *o.Cache.Get() +} + +// GetCacheOk returns a tuple with the Cache 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 *Application) GetCacheOk() (*ApplicationCache, bool) { + if o == nil { + return nil, false + } + return o.Cache.Get(), o.Cache.IsSet() +} + +// HasCache returns a boolean if a field has been set. +func (o *Application) HasCache() bool { + if o != nil && o.Cache.IsSet() { + return true + } + + return false +} + +// SetCache gets a reference to the given NullableApplicationCache and assigns it to the Cache field. +func (o *Application) SetCache(v ApplicationCache) { + o.Cache.Set(&v) +} +// SetCacheNil sets the value for Cache to be an explicit nil +func (o *Application) SetCacheNil() { + o.Cache.Set(nil) +} + +// UnsetCache ensures that no value is present for Cache, not even an explicit nil +func (o *Application) UnsetCache() { + o.Cache.Unset() +} + // GetComposeDefinition returns the ComposeDefinition field value if set, zero value otherwise. func (o *Application) GetComposeDefinition() Compose { if o == nil || IsNil(o.ComposeDefinition) { @@ -601,6 +644,9 @@ func (o Application) ToMap() (map[string]interface{}, error) { if o.Filesystem.IsSet() { toSerialize["filesystem"] = o.Filesystem.Get() } + if o.Cache.IsSet() { + toSerialize["cache"] = o.Cache.Get() + } if !IsNil(o.ComposeDefinition) { toSerialize["composeDefinition"] = o.ComposeDefinition } @@ -679,6 +725,7 @@ func (o *Application) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "organisation") delete(additionalProperties, "database") delete(additionalProperties, "filesystem") + delete(additionalProperties, "cache") delete(additionalProperties, "composeDefinition") delete(additionalProperties, "status") delete(additionalProperties, "deploymentInformation") diff --git a/model_application_cache.go b/model_application_cache.go new file mode 100644 index 0000000..e5eab29 --- /dev/null +++ b/model_application_cache.go @@ -0,0 +1,262 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the ApplicationCache type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationCache{} + +// ApplicationCache Managed Valkey cache configuration +type ApplicationCache struct { + // Cache cluster endpoint + CacheEndpoint NullableString `json:"cacheEndpoint,omitempty"` + // Cache cluster identifier + CacheIdentifier NullableString `json:"cacheIdentifier,omitempty"` + // Maximum cache storage in GB + DataStorageMaxGb NullableInt32 `json:"dataStorageMaxGb,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationCache ApplicationCache + +// NewApplicationCache instantiates a new ApplicationCache 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 NewApplicationCache() *ApplicationCache { + this := ApplicationCache{} + return &this +} + +// NewApplicationCacheWithDefaults instantiates a new ApplicationCache 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 NewApplicationCacheWithDefaults() *ApplicationCache { + this := ApplicationCache{} + return &this +} + +// GetCacheEndpoint returns the CacheEndpoint field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ApplicationCache) GetCacheEndpoint() string { + if o == nil || IsNil(o.CacheEndpoint.Get()) { + var ret string + return ret + } + return *o.CacheEndpoint.Get() +} + +// GetCacheEndpointOk returns a tuple with the CacheEndpoint 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 *ApplicationCache) GetCacheEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CacheEndpoint.Get(), o.CacheEndpoint.IsSet() +} + +// HasCacheEndpoint returns a boolean if a field has been set. +func (o *ApplicationCache) HasCacheEndpoint() bool { + if o != nil && o.CacheEndpoint.IsSet() { + return true + } + + return false +} + +// SetCacheEndpoint gets a reference to the given NullableString and assigns it to the CacheEndpoint field. +func (o *ApplicationCache) SetCacheEndpoint(v string) { + o.CacheEndpoint.Set(&v) +} +// SetCacheEndpointNil sets the value for CacheEndpoint to be an explicit nil +func (o *ApplicationCache) SetCacheEndpointNil() { + o.CacheEndpoint.Set(nil) +} + +// UnsetCacheEndpoint ensures that no value is present for CacheEndpoint, not even an explicit nil +func (o *ApplicationCache) UnsetCacheEndpoint() { + o.CacheEndpoint.Unset() +} + +// GetCacheIdentifier returns the CacheIdentifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ApplicationCache) GetCacheIdentifier() string { + if o == nil || IsNil(o.CacheIdentifier.Get()) { + var ret string + return ret + } + return *o.CacheIdentifier.Get() +} + +// GetCacheIdentifierOk returns a tuple with the CacheIdentifier 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 *ApplicationCache) GetCacheIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CacheIdentifier.Get(), o.CacheIdentifier.IsSet() +} + +// HasCacheIdentifier returns a boolean if a field has been set. +func (o *ApplicationCache) HasCacheIdentifier() bool { + if o != nil && o.CacheIdentifier.IsSet() { + return true + } + + return false +} + +// SetCacheIdentifier gets a reference to the given NullableString and assigns it to the CacheIdentifier field. +func (o *ApplicationCache) SetCacheIdentifier(v string) { + o.CacheIdentifier.Set(&v) +} +// SetCacheIdentifierNil sets the value for CacheIdentifier to be an explicit nil +func (o *ApplicationCache) SetCacheIdentifierNil() { + o.CacheIdentifier.Set(nil) +} + +// UnsetCacheIdentifier ensures that no value is present for CacheIdentifier, not even an explicit nil +func (o *ApplicationCache) UnsetCacheIdentifier() { + o.CacheIdentifier.Unset() +} + +// GetDataStorageMaxGb returns the DataStorageMaxGb field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ApplicationCache) GetDataStorageMaxGb() int32 { + if o == nil || IsNil(o.DataStorageMaxGb.Get()) { + var ret int32 + return ret + } + return *o.DataStorageMaxGb.Get() +} + +// GetDataStorageMaxGbOk returns a tuple with the DataStorageMaxGb 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 *ApplicationCache) GetDataStorageMaxGbOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DataStorageMaxGb.Get(), o.DataStorageMaxGb.IsSet() +} + +// HasDataStorageMaxGb returns a boolean if a field has been set. +func (o *ApplicationCache) HasDataStorageMaxGb() bool { + if o != nil && o.DataStorageMaxGb.IsSet() { + return true + } + + return false +} + +// SetDataStorageMaxGb gets a reference to the given NullableInt32 and assigns it to the DataStorageMaxGb field. +func (o *ApplicationCache) SetDataStorageMaxGb(v int32) { + o.DataStorageMaxGb.Set(&v) +} +// SetDataStorageMaxGbNil sets the value for DataStorageMaxGb to be an explicit nil +func (o *ApplicationCache) SetDataStorageMaxGbNil() { + o.DataStorageMaxGb.Set(nil) +} + +// UnsetDataStorageMaxGb ensures that no value is present for DataStorageMaxGb, not even an explicit nil +func (o *ApplicationCache) UnsetDataStorageMaxGb() { + o.DataStorageMaxGb.Unset() +} + +func (o ApplicationCache) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationCache) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.CacheEndpoint.IsSet() { + toSerialize["cacheEndpoint"] = o.CacheEndpoint.Get() + } + if o.CacheIdentifier.IsSet() { + toSerialize["cacheIdentifier"] = o.CacheIdentifier.Get() + } + if o.DataStorageMaxGb.IsSet() { + toSerialize["dataStorageMaxGb"] = o.DataStorageMaxGb.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationCache) UnmarshalJSON(data []byte) (err error) { + varApplicationCache := _ApplicationCache{} + + err = json.Unmarshal(data, &varApplicationCache) + + if err != nil { + return err + } + + *o = ApplicationCache(varApplicationCache) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cacheEndpoint") + delete(additionalProperties, "cacheIdentifier") + delete(additionalProperties, "dataStorageMaxGb") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationCache struct { + value *ApplicationCache + isSet bool +} + +func (v NullableApplicationCache) Get() *ApplicationCache { + return v.value +} + +func (v *NullableApplicationCache) Set(val *ApplicationCache) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationCache) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationCache) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationCache(val *ApplicationCache) *NullableApplicationCache { + return &NullableApplicationCache{value: val, isSet: true} +} + +func (v NullableApplicationCache) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationCache) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_compose.go b/model_compose.go index 88b4a86..d2f306c 100644 --- a/model_compose.go +++ b/model_compose.go @@ -30,6 +30,10 @@ type Compose struct { MinCapacity *int32 `json:"minCapacity,omitempty"` // Maximum number of instances MaxCapacity *int32 `json:"maxCapacity,omitempty"` + // Optional. Forces single-task mode for data-safe applications (max one running task). When true: capacity is locked to 1. When false: explicitly allows scaling. When omitted: the platform auto-detects stateful containers and enables single-task mode if found. + SingleTaskOnly NullableBool `json:"singleTaskOnly,omitempty"` + // Optional. Seconds the load balancer waits after a task starts before an unhealthy health check can replace it (applied as the ECS service's healthCheckGracePeriodSeconds when a load balancer is attached). Raise for apps that are slow to boot, e.g. run migrations on startup. Tasks that become healthy sooner still enter service immediately. Defaults to 120 when omitted. + StartupGracePeriodSeconds NullableInt32 `json:"startupGracePeriodSeconds,omitempty"` SpotConfiguration *SpotConfiguration `json:"spotConfiguration,omitempty"` // Optional. Enable cross-environment networking within the same application. When false (default): Uses shared security group for complete isolation (most secure). When true: Uses app-specific security group to enable communication between environments of the same application (e.g., staging can connect to production database). Note: If enableCrossAppNetworking is true, this setting is overridden. EnableCrossEnvNetworking NullableBool `json:"enableCrossEnvNetworking,omitempty"` @@ -46,6 +50,8 @@ type _Compose Compose // will change when the set of required properties is changed func NewCompose() *Compose { this := Compose{} + var startupGracePeriodSeconds int32 = 120 + this.StartupGracePeriodSeconds = *NewNullableInt32(&startupGracePeriodSeconds) var enableCrossEnvNetworking bool = false this.EnableCrossEnvNetworking = *NewNullableBool(&enableCrossEnvNetworking) var enableCrossAppNetworking bool = false @@ -58,6 +64,8 @@ func NewCompose() *Compose { // but it doesn't guarantee that properties required by API are set func NewComposeWithDefaults() *Compose { this := Compose{} + var startupGracePeriodSeconds int32 = 120 + this.StartupGracePeriodSeconds = *NewNullableInt32(&startupGracePeriodSeconds) var enableCrossEnvNetworking bool = false this.EnableCrossEnvNetworking = *NewNullableBool(&enableCrossEnvNetworking) var enableCrossAppNetworking bool = false @@ -257,6 +265,90 @@ func (o *Compose) SetMaxCapacity(v int32) { o.MaxCapacity = &v } +// GetSingleTaskOnly returns the SingleTaskOnly field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Compose) GetSingleTaskOnly() bool { + if o == nil || IsNil(o.SingleTaskOnly.Get()) { + var ret bool + return ret + } + return *o.SingleTaskOnly.Get() +} + +// GetSingleTaskOnlyOk returns a tuple with the SingleTaskOnly 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 *Compose) GetSingleTaskOnlyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.SingleTaskOnly.Get(), o.SingleTaskOnly.IsSet() +} + +// HasSingleTaskOnly returns a boolean if a field has been set. +func (o *Compose) HasSingleTaskOnly() bool { + if o != nil && o.SingleTaskOnly.IsSet() { + return true + } + + return false +} + +// SetSingleTaskOnly gets a reference to the given NullableBool and assigns it to the SingleTaskOnly field. +func (o *Compose) SetSingleTaskOnly(v bool) { + o.SingleTaskOnly.Set(&v) +} +// SetSingleTaskOnlyNil sets the value for SingleTaskOnly to be an explicit nil +func (o *Compose) SetSingleTaskOnlyNil() { + o.SingleTaskOnly.Set(nil) +} + +// UnsetSingleTaskOnly ensures that no value is present for SingleTaskOnly, not even an explicit nil +func (o *Compose) UnsetSingleTaskOnly() { + o.SingleTaskOnly.Unset() +} + +// GetStartupGracePeriodSeconds returns the StartupGracePeriodSeconds field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Compose) GetStartupGracePeriodSeconds() int32 { + if o == nil || IsNil(o.StartupGracePeriodSeconds.Get()) { + var ret int32 + return ret + } + return *o.StartupGracePeriodSeconds.Get() +} + +// GetStartupGracePeriodSecondsOk returns a tuple with the StartupGracePeriodSeconds 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 *Compose) GetStartupGracePeriodSecondsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.StartupGracePeriodSeconds.Get(), o.StartupGracePeriodSeconds.IsSet() +} + +// HasStartupGracePeriodSeconds returns a boolean if a field has been set. +func (o *Compose) HasStartupGracePeriodSeconds() bool { + if o != nil && o.StartupGracePeriodSeconds.IsSet() { + return true + } + + return false +} + +// SetStartupGracePeriodSeconds gets a reference to the given NullableInt32 and assigns it to the StartupGracePeriodSeconds field. +func (o *Compose) SetStartupGracePeriodSeconds(v int32) { + o.StartupGracePeriodSeconds.Set(&v) +} +// SetStartupGracePeriodSecondsNil sets the value for StartupGracePeriodSeconds to be an explicit nil +func (o *Compose) SetStartupGracePeriodSecondsNil() { + o.StartupGracePeriodSeconds.Set(nil) +} + +// UnsetStartupGracePeriodSeconds ensures that no value is present for StartupGracePeriodSeconds, not even an explicit nil +func (o *Compose) UnsetStartupGracePeriodSeconds() { + o.StartupGracePeriodSeconds.Unset() +} + // GetSpotConfiguration returns the SpotConfiguration field value if set, zero value otherwise. func (o *Compose) GetSpotConfiguration() SpotConfiguration { if o == nil || IsNil(o.SpotConfiguration) { @@ -401,6 +493,12 @@ func (o Compose) ToMap() (map[string]interface{}, error) { if !IsNil(o.MaxCapacity) { toSerialize["maxCapacity"] = o.MaxCapacity } + if o.SingleTaskOnly.IsSet() { + toSerialize["singleTaskOnly"] = o.SingleTaskOnly.Get() + } + if o.StartupGracePeriodSeconds.IsSet() { + toSerialize["startupGracePeriodSeconds"] = o.StartupGracePeriodSeconds.Get() + } if !IsNil(o.SpotConfiguration) { toSerialize["spotConfiguration"] = o.SpotConfiguration } @@ -438,6 +536,8 @@ func (o *Compose) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "taskMemory") delete(additionalProperties, "minCapacity") delete(additionalProperties, "maxCapacity") + delete(additionalProperties, "singleTaskOnly") + delete(additionalProperties, "startupGracePeriodSeconds") delete(additionalProperties, "spotConfiguration") delete(additionalProperties, "enableCrossEnvNetworking") delete(additionalProperties, "enableCrossAppNetworking") diff --git a/model_create_environment_request.go b/model_create_environment_request.go index aeb6522..2db3780 100644 --- a/model_create_environment_request.go +++ b/model_create_environment_request.go @@ -26,6 +26,10 @@ type CreateEnvironmentRequest struct { MinCapacity *int32 `json:"minCapacity,omitempty"` // Maximum number of instances MaxCapacity *int32 `json:"maxCapacity,omitempty"` + // Optional. Forces single-task mode (max one running task). When omitted, the platform auto-detects stateful containers. + SingleTaskOnly NullableBool `json:"singleTaskOnly,omitempty"` + // Optional. Seconds the load balancer waits after a task starts before an unhealthy health check can replace it. If not set, the value from composeDefinition (or default 120) is used. + StartupGracePeriodSeconds NullableInt32 `json:"startupGracePeriodSeconds,omitempty"` // Clone configuration from an existing environment CloneConfigurationFrom *string `json:"cloneConfigurationFrom,omitempty"` ComposeDefinition *Compose `json:"composeDefinition,omitempty"` @@ -48,6 +52,8 @@ type _CreateEnvironmentRequest CreateEnvironmentRequest func NewCreateEnvironmentRequest(envName string) *CreateEnvironmentRequest { this := CreateEnvironmentRequest{} this.EnvName = envName + var startupGracePeriodSeconds int32 = 120 + this.StartupGracePeriodSeconds = *NewNullableInt32(&startupGracePeriodSeconds) return &this } @@ -56,6 +62,8 @@ func NewCreateEnvironmentRequest(envName string) *CreateEnvironmentRequest { // but it doesn't guarantee that properties required by API are set func NewCreateEnvironmentRequestWithDefaults() *CreateEnvironmentRequest { this := CreateEnvironmentRequest{} + var startupGracePeriodSeconds int32 = 120 + this.StartupGracePeriodSeconds = *NewNullableInt32(&startupGracePeriodSeconds) return &this } @@ -147,6 +155,90 @@ func (o *CreateEnvironmentRequest) SetMaxCapacity(v int32) { o.MaxCapacity = &v } +// GetSingleTaskOnly returns the SingleTaskOnly field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateEnvironmentRequest) GetSingleTaskOnly() bool { + if o == nil || IsNil(o.SingleTaskOnly.Get()) { + var ret bool + return ret + } + return *o.SingleTaskOnly.Get() +} + +// GetSingleTaskOnlyOk returns a tuple with the SingleTaskOnly 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 *CreateEnvironmentRequest) GetSingleTaskOnlyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.SingleTaskOnly.Get(), o.SingleTaskOnly.IsSet() +} + +// HasSingleTaskOnly returns a boolean if a field has been set. +func (o *CreateEnvironmentRequest) HasSingleTaskOnly() bool { + if o != nil && o.SingleTaskOnly.IsSet() { + return true + } + + return false +} + +// SetSingleTaskOnly gets a reference to the given NullableBool and assigns it to the SingleTaskOnly field. +func (o *CreateEnvironmentRequest) SetSingleTaskOnly(v bool) { + o.SingleTaskOnly.Set(&v) +} +// SetSingleTaskOnlyNil sets the value for SingleTaskOnly to be an explicit nil +func (o *CreateEnvironmentRequest) SetSingleTaskOnlyNil() { + o.SingleTaskOnly.Set(nil) +} + +// UnsetSingleTaskOnly ensures that no value is present for SingleTaskOnly, not even an explicit nil +func (o *CreateEnvironmentRequest) UnsetSingleTaskOnly() { + o.SingleTaskOnly.Unset() +} + +// GetStartupGracePeriodSeconds returns the StartupGracePeriodSeconds field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateEnvironmentRequest) GetStartupGracePeriodSeconds() int32 { + if o == nil || IsNil(o.StartupGracePeriodSeconds.Get()) { + var ret int32 + return ret + } + return *o.StartupGracePeriodSeconds.Get() +} + +// GetStartupGracePeriodSecondsOk returns a tuple with the StartupGracePeriodSeconds 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 *CreateEnvironmentRequest) GetStartupGracePeriodSecondsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.StartupGracePeriodSeconds.Get(), o.StartupGracePeriodSeconds.IsSet() +} + +// HasStartupGracePeriodSeconds returns a boolean if a field has been set. +func (o *CreateEnvironmentRequest) HasStartupGracePeriodSeconds() bool { + if o != nil && o.StartupGracePeriodSeconds.IsSet() { + return true + } + + return false +} + +// SetStartupGracePeriodSeconds gets a reference to the given NullableInt32 and assigns it to the StartupGracePeriodSeconds field. +func (o *CreateEnvironmentRequest) SetStartupGracePeriodSeconds(v int32) { + o.StartupGracePeriodSeconds.Set(&v) +} +// SetStartupGracePeriodSecondsNil sets the value for StartupGracePeriodSeconds to be an explicit nil +func (o *CreateEnvironmentRequest) SetStartupGracePeriodSecondsNil() { + o.StartupGracePeriodSeconds.Set(nil) +} + +// UnsetStartupGracePeriodSeconds ensures that no value is present for StartupGracePeriodSeconds, not even an explicit nil +func (o *CreateEnvironmentRequest) UnsetStartupGracePeriodSeconds() { + o.StartupGracePeriodSeconds.Unset() +} + // GetCloneConfigurationFrom returns the CloneConfigurationFrom field value if set, zero value otherwise. func (o *CreateEnvironmentRequest) GetCloneConfigurationFrom() string { if o == nil || IsNil(o.CloneConfigurationFrom) { @@ -356,6 +448,12 @@ func (o CreateEnvironmentRequest) ToMap() (map[string]interface{}, error) { if !IsNil(o.MaxCapacity) { toSerialize["maxCapacity"] = o.MaxCapacity } + if o.SingleTaskOnly.IsSet() { + toSerialize["singleTaskOnly"] = o.SingleTaskOnly.Get() + } + if o.StartupGracePeriodSeconds.IsSet() { + toSerialize["startupGracePeriodSeconds"] = o.StartupGracePeriodSeconds.Get() + } if !IsNil(o.CloneConfigurationFrom) { toSerialize["cloneConfigurationFrom"] = o.CloneConfigurationFrom } @@ -420,6 +518,8 @@ func (o *CreateEnvironmentRequest) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "envName") delete(additionalProperties, "minCapacity") delete(additionalProperties, "maxCapacity") + delete(additionalProperties, "singleTaskOnly") + delete(additionalProperties, "startupGracePeriodSeconds") delete(additionalProperties, "cloneConfigurationFrom") delete(additionalProperties, "composeDefinition") delete(additionalProperties, "imageSuffix") diff --git a/model_get_governance_config_200_response_spend_limits.go b/model_get_governance_config_200_response_spend_limits.go index 744b809..23a39da 100644 --- a/model_get_governance_config_200_response_spend_limits.go +++ b/model_get_governance_config_200_response_spend_limits.go @@ -28,6 +28,12 @@ type GetGovernanceConfig200ResponseSpendLimits struct { InterfaceLimits *map[string]GetGovernanceConfig200ResponseSpendLimitsInterfaceLimitsValue `json:"interfaceLimits,omitempty"` // Per-user budget overrides keyed by userId (numeric portal id, slack-, or system:code-agent). Replaces the flat per-user budget for that user; unlimited=true exempts them. UserOverrides *map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue `json:"userOverrides,omitempty"` + // Flat monthly cap in cents applied to every API token without a named override + PerTokenMonthlyBudgetCents NullableInt32 `json:"perTokenMonthlyBudgetCents,omitempty"` + // Flat daily cap in cents applied to every API token without a named override + PerTokenDailyBudgetCents NullableInt32 `json:"perTokenDailyBudgetCents,omitempty"` + // Per-token budget overrides keyed by API token id. Replaces the flat per-token budget for that token; unlimited=true exempts it. + TokenOverrides *map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue `json:"tokenOverrides,omitempty"` AdditionalProperties map[string]interface{} } @@ -324,6 +330,122 @@ func (o *GetGovernanceConfig200ResponseSpendLimits) SetUserOverrides(v map[strin o.UserOverrides = &v } +// GetPerTokenMonthlyBudgetCents returns the PerTokenMonthlyBudgetCents field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetGovernanceConfig200ResponseSpendLimits) GetPerTokenMonthlyBudgetCents() int32 { + if o == nil || IsNil(o.PerTokenMonthlyBudgetCents.Get()) { + var ret int32 + return ret + } + return *o.PerTokenMonthlyBudgetCents.Get() +} + +// GetPerTokenMonthlyBudgetCentsOk returns a tuple with the PerTokenMonthlyBudgetCents 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 *GetGovernanceConfig200ResponseSpendLimits) GetPerTokenMonthlyBudgetCentsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PerTokenMonthlyBudgetCents.Get(), o.PerTokenMonthlyBudgetCents.IsSet() +} + +// HasPerTokenMonthlyBudgetCents returns a boolean if a field has been set. +func (o *GetGovernanceConfig200ResponseSpendLimits) HasPerTokenMonthlyBudgetCents() bool { + if o != nil && o.PerTokenMonthlyBudgetCents.IsSet() { + return true + } + + return false +} + +// SetPerTokenMonthlyBudgetCents gets a reference to the given NullableInt32 and assigns it to the PerTokenMonthlyBudgetCents field. +func (o *GetGovernanceConfig200ResponseSpendLimits) SetPerTokenMonthlyBudgetCents(v int32) { + o.PerTokenMonthlyBudgetCents.Set(&v) +} +// SetPerTokenMonthlyBudgetCentsNil sets the value for PerTokenMonthlyBudgetCents to be an explicit nil +func (o *GetGovernanceConfig200ResponseSpendLimits) SetPerTokenMonthlyBudgetCentsNil() { + o.PerTokenMonthlyBudgetCents.Set(nil) +} + +// UnsetPerTokenMonthlyBudgetCents ensures that no value is present for PerTokenMonthlyBudgetCents, not even an explicit nil +func (o *GetGovernanceConfig200ResponseSpendLimits) UnsetPerTokenMonthlyBudgetCents() { + o.PerTokenMonthlyBudgetCents.Unset() +} + +// GetPerTokenDailyBudgetCents returns the PerTokenDailyBudgetCents field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetGovernanceConfig200ResponseSpendLimits) GetPerTokenDailyBudgetCents() int32 { + if o == nil || IsNil(o.PerTokenDailyBudgetCents.Get()) { + var ret int32 + return ret + } + return *o.PerTokenDailyBudgetCents.Get() +} + +// GetPerTokenDailyBudgetCentsOk returns a tuple with the PerTokenDailyBudgetCents 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 *GetGovernanceConfig200ResponseSpendLimits) GetPerTokenDailyBudgetCentsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PerTokenDailyBudgetCents.Get(), o.PerTokenDailyBudgetCents.IsSet() +} + +// HasPerTokenDailyBudgetCents returns a boolean if a field has been set. +func (o *GetGovernanceConfig200ResponseSpendLimits) HasPerTokenDailyBudgetCents() bool { + if o != nil && o.PerTokenDailyBudgetCents.IsSet() { + return true + } + + return false +} + +// SetPerTokenDailyBudgetCents gets a reference to the given NullableInt32 and assigns it to the PerTokenDailyBudgetCents field. +func (o *GetGovernanceConfig200ResponseSpendLimits) SetPerTokenDailyBudgetCents(v int32) { + o.PerTokenDailyBudgetCents.Set(&v) +} +// SetPerTokenDailyBudgetCentsNil sets the value for PerTokenDailyBudgetCents to be an explicit nil +func (o *GetGovernanceConfig200ResponseSpendLimits) SetPerTokenDailyBudgetCentsNil() { + o.PerTokenDailyBudgetCents.Set(nil) +} + +// UnsetPerTokenDailyBudgetCents ensures that no value is present for PerTokenDailyBudgetCents, not even an explicit nil +func (o *GetGovernanceConfig200ResponseSpendLimits) UnsetPerTokenDailyBudgetCents() { + o.PerTokenDailyBudgetCents.Unset() +} + +// GetTokenOverrides returns the TokenOverrides field value if set, zero value otherwise. +func (o *GetGovernanceConfig200ResponseSpendLimits) GetTokenOverrides() map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue { + if o == nil || IsNil(o.TokenOverrides) { + var ret map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue + return ret + } + return *o.TokenOverrides +} + +// GetTokenOverridesOk returns a tuple with the TokenOverrides field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetGovernanceConfig200ResponseSpendLimits) GetTokenOverridesOk() (*map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue, bool) { + if o == nil || IsNil(o.TokenOverrides) { + return nil, false + } + return o.TokenOverrides, true +} + +// HasTokenOverrides returns a boolean if a field has been set. +func (o *GetGovernanceConfig200ResponseSpendLimits) HasTokenOverrides() bool { + if o != nil && !IsNil(o.TokenOverrides) { + return true + } + + return false +} + +// SetTokenOverrides gets a reference to the given map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue and assigns it to the TokenOverrides field. +func (o *GetGovernanceConfig200ResponseSpendLimits) SetTokenOverrides(v map[string]GetGovernanceConfig200ResponseSpendLimitsUserOverridesValue) { + o.TokenOverrides = &v +} + func (o GetGovernanceConfig200ResponseSpendLimits) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -355,6 +477,15 @@ func (o GetGovernanceConfig200ResponseSpendLimits) ToMap() (map[string]interface if !IsNil(o.UserOverrides) { toSerialize["userOverrides"] = o.UserOverrides } + if o.PerTokenMonthlyBudgetCents.IsSet() { + toSerialize["perTokenMonthlyBudgetCents"] = o.PerTokenMonthlyBudgetCents.Get() + } + if o.PerTokenDailyBudgetCents.IsSet() { + toSerialize["perTokenDailyBudgetCents"] = o.PerTokenDailyBudgetCents.Get() + } + if !IsNil(o.TokenOverrides) { + toSerialize["tokenOverrides"] = o.TokenOverrides + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -384,6 +515,9 @@ func (o *GetGovernanceConfig200ResponseSpendLimits) UnmarshalJSON(data []byte) ( delete(additionalProperties, "warningThresholdPercent") delete(additionalProperties, "interfaceLimits") delete(additionalProperties, "userOverrides") + delete(additionalProperties, "perTokenMonthlyBudgetCents") + delete(additionalProperties, "perTokenDailyBudgetCents") + delete(additionalProperties, "tokenOverrides") o.AdditionalProperties = additionalProperties } diff --git a/model_oai_chat_completions_200_response.go b/model_oai_chat_completions_200_response.go new file mode 100644 index 0000000..2c2cd73 --- /dev/null +++ b/model_oai_chat_completions_200_response.go @@ -0,0 +1,340 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiChatCompletions200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiChatCompletions200Response{} + +// OaiChatCompletions200Response struct for OaiChatCompletions200Response +type OaiChatCompletions200Response struct { + Id *string `json:"id,omitempty"` + Object *string `json:"object,omitempty"` + Created *int32 `json:"created,omitempty"` + Model *string `json:"model,omitempty"` + Choices []OaiChatCompletions200ResponseChoicesInner `json:"choices,omitempty"` + Usage *OaiChatCompletions200ResponseUsage `json:"usage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiChatCompletions200Response OaiChatCompletions200Response + +// NewOaiChatCompletions200Response instantiates a new OaiChatCompletions200Response 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 NewOaiChatCompletions200Response() *OaiChatCompletions200Response { + this := OaiChatCompletions200Response{} + return &this +} + +// NewOaiChatCompletions200ResponseWithDefaults instantiates a new OaiChatCompletions200Response 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 NewOaiChatCompletions200ResponseWithDefaults() *OaiChatCompletions200Response { + this := OaiChatCompletions200Response{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *OaiChatCompletions200Response) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200Response) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *OaiChatCompletions200Response) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *OaiChatCompletions200Response) SetId(v string) { + o.Id = &v +} + +// GetObject returns the Object field value if set, zero value otherwise. +func (o *OaiChatCompletions200Response) GetObject() string { + if o == nil || IsNil(o.Object) { + var ret string + return ret + } + return *o.Object +} + +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200Response) GetObjectOk() (*string, bool) { + if o == nil || IsNil(o.Object) { + return nil, false + } + return o.Object, true +} + +// HasObject returns a boolean if a field has been set. +func (o *OaiChatCompletions200Response) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given string and assigns it to the Object field. +func (o *OaiChatCompletions200Response) SetObject(v string) { + o.Object = &v +} + +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *OaiChatCompletions200Response) GetCreated() int32 { + if o == nil || IsNil(o.Created) { + var ret int32 + return ret + } + return *o.Created +} + +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200Response) GetCreatedOk() (*int32, bool) { + if o == nil || IsNil(o.Created) { + return nil, false + } + return o.Created, true +} + +// HasCreated returns a boolean if a field has been set. +func (o *OaiChatCompletions200Response) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false +} + +// SetCreated gets a reference to the given int32 and assigns it to the Created field. +func (o *OaiChatCompletions200Response) SetCreated(v int32) { + o.Created = &v +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *OaiChatCompletions200Response) GetModel() string { + if o == nil || IsNil(o.Model) { + var ret string + return ret + } + return *o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200Response) GetModelOk() (*string, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *OaiChatCompletions200Response) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given string and assigns it to the Model field. +func (o *OaiChatCompletions200Response) SetModel(v string) { + o.Model = &v +} + +// GetChoices returns the Choices field value if set, zero value otherwise. +func (o *OaiChatCompletions200Response) GetChoices() []OaiChatCompletions200ResponseChoicesInner { + if o == nil || IsNil(o.Choices) { + var ret []OaiChatCompletions200ResponseChoicesInner + return ret + } + return o.Choices +} + +// GetChoicesOk returns a tuple with the Choices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200Response) GetChoicesOk() ([]OaiChatCompletions200ResponseChoicesInner, bool) { + if o == nil || IsNil(o.Choices) { + return nil, false + } + return o.Choices, true +} + +// HasChoices returns a boolean if a field has been set. +func (o *OaiChatCompletions200Response) HasChoices() bool { + if o != nil && !IsNil(o.Choices) { + return true + } + + return false +} + +// SetChoices gets a reference to the given []OaiChatCompletions200ResponseChoicesInner and assigns it to the Choices field. +func (o *OaiChatCompletions200Response) SetChoices(v []OaiChatCompletions200ResponseChoicesInner) { + o.Choices = v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *OaiChatCompletions200Response) GetUsage() OaiChatCompletions200ResponseUsage { + if o == nil || IsNil(o.Usage) { + var ret OaiChatCompletions200ResponseUsage + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200Response) GetUsageOk() (*OaiChatCompletions200ResponseUsage, bool) { + if o == nil || IsNil(o.Usage) { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *OaiChatCompletions200Response) HasUsage() bool { + if o != nil && !IsNil(o.Usage) { + return true + } + + return false +} + +// SetUsage gets a reference to the given OaiChatCompletions200ResponseUsage and assigns it to the Usage field. +func (o *OaiChatCompletions200Response) SetUsage(v OaiChatCompletions200ResponseUsage) { + o.Usage = &v +} + +func (o OaiChatCompletions200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiChatCompletions200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Object) { + toSerialize["object"] = o.Object + } + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.Choices) { + toSerialize["choices"] = o.Choices + } + if !IsNil(o.Usage) { + toSerialize["usage"] = o.Usage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiChatCompletions200Response) UnmarshalJSON(data []byte) (err error) { + varOaiChatCompletions200Response := _OaiChatCompletions200Response{} + + err = json.Unmarshal(data, &varOaiChatCompletions200Response) + + if err != nil { + return err + } + + *o = OaiChatCompletions200Response(varOaiChatCompletions200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "object") + delete(additionalProperties, "created") + delete(additionalProperties, "model") + delete(additionalProperties, "choices") + delete(additionalProperties, "usage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiChatCompletions200Response struct { + value *OaiChatCompletions200Response + isSet bool +} + +func (v NullableOaiChatCompletions200Response) Get() *OaiChatCompletions200Response { + return v.value +} + +func (v *NullableOaiChatCompletions200Response) Set(val *OaiChatCompletions200Response) { + v.value = val + v.isSet = true +} + +func (v NullableOaiChatCompletions200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiChatCompletions200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiChatCompletions200Response(val *OaiChatCompletions200Response) *NullableOaiChatCompletions200Response { + return &NullableOaiChatCompletions200Response{value: val, isSet: true} +} + +func (v NullableOaiChatCompletions200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiChatCompletions200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_chat_completions_200_response_choices_inner.go b/model_oai_chat_completions_200_response_choices_inner.go new file mode 100644 index 0000000..ff001c5 --- /dev/null +++ b/model_oai_chat_completions_200_response_choices_inner.go @@ -0,0 +1,229 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiChatCompletions200ResponseChoicesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiChatCompletions200ResponseChoicesInner{} + +// OaiChatCompletions200ResponseChoicesInner struct for OaiChatCompletions200ResponseChoicesInner +type OaiChatCompletions200ResponseChoicesInner struct { + Index *int32 `json:"index,omitempty"` + Message *OaiChatCompletions200ResponseChoicesInnerMessage `json:"message,omitempty"` + FinishReason *string `json:"finish_reason,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiChatCompletions200ResponseChoicesInner OaiChatCompletions200ResponseChoicesInner + +// NewOaiChatCompletions200ResponseChoicesInner instantiates a new OaiChatCompletions200ResponseChoicesInner 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 NewOaiChatCompletions200ResponseChoicesInner() *OaiChatCompletions200ResponseChoicesInner { + this := OaiChatCompletions200ResponseChoicesInner{} + return &this +} + +// NewOaiChatCompletions200ResponseChoicesInnerWithDefaults instantiates a new OaiChatCompletions200ResponseChoicesInner 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 NewOaiChatCompletions200ResponseChoicesInnerWithDefaults() *OaiChatCompletions200ResponseChoicesInner { + this := OaiChatCompletions200ResponseChoicesInner{} + return &this +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *OaiChatCompletions200ResponseChoicesInner) GetIndex() int32 { + if o == nil || IsNil(o.Index) { + var ret int32 + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200ResponseChoicesInner) GetIndexOk() (*int32, bool) { + if o == nil || IsNil(o.Index) { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *OaiChatCompletions200ResponseChoicesInner) HasIndex() bool { + if o != nil && !IsNil(o.Index) { + return true + } + + return false +} + +// SetIndex gets a reference to the given int32 and assigns it to the Index field. +func (o *OaiChatCompletions200ResponseChoicesInner) SetIndex(v int32) { + o.Index = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *OaiChatCompletions200ResponseChoicesInner) GetMessage() OaiChatCompletions200ResponseChoicesInnerMessage { + if o == nil || IsNil(o.Message) { + var ret OaiChatCompletions200ResponseChoicesInnerMessage + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200ResponseChoicesInner) GetMessageOk() (*OaiChatCompletions200ResponseChoicesInnerMessage, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *OaiChatCompletions200ResponseChoicesInner) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given OaiChatCompletions200ResponseChoicesInnerMessage and assigns it to the Message field. +func (o *OaiChatCompletions200ResponseChoicesInner) SetMessage(v OaiChatCompletions200ResponseChoicesInnerMessage) { + o.Message = &v +} + +// GetFinishReason returns the FinishReason field value if set, zero value otherwise. +func (o *OaiChatCompletions200ResponseChoicesInner) GetFinishReason() string { + if o == nil || IsNil(o.FinishReason) { + var ret string + return ret + } + return *o.FinishReason +} + +// GetFinishReasonOk returns a tuple with the FinishReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200ResponseChoicesInner) GetFinishReasonOk() (*string, bool) { + if o == nil || IsNil(o.FinishReason) { + return nil, false + } + return o.FinishReason, true +} + +// HasFinishReason returns a boolean if a field has been set. +func (o *OaiChatCompletions200ResponseChoicesInner) HasFinishReason() bool { + if o != nil && !IsNil(o.FinishReason) { + return true + } + + return false +} + +// SetFinishReason gets a reference to the given string and assigns it to the FinishReason field. +func (o *OaiChatCompletions200ResponseChoicesInner) SetFinishReason(v string) { + o.FinishReason = &v +} + +func (o OaiChatCompletions200ResponseChoicesInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiChatCompletions200ResponseChoicesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Index) { + toSerialize["index"] = o.Index + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !IsNil(o.FinishReason) { + toSerialize["finish_reason"] = o.FinishReason + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiChatCompletions200ResponseChoicesInner) UnmarshalJSON(data []byte) (err error) { + varOaiChatCompletions200ResponseChoicesInner := _OaiChatCompletions200ResponseChoicesInner{} + + err = json.Unmarshal(data, &varOaiChatCompletions200ResponseChoicesInner) + + if err != nil { + return err + } + + *o = OaiChatCompletions200ResponseChoicesInner(varOaiChatCompletions200ResponseChoicesInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "index") + delete(additionalProperties, "message") + delete(additionalProperties, "finish_reason") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiChatCompletions200ResponseChoicesInner struct { + value *OaiChatCompletions200ResponseChoicesInner + isSet bool +} + +func (v NullableOaiChatCompletions200ResponseChoicesInner) Get() *OaiChatCompletions200ResponseChoicesInner { + return v.value +} + +func (v *NullableOaiChatCompletions200ResponseChoicesInner) Set(val *OaiChatCompletions200ResponseChoicesInner) { + v.value = val + v.isSet = true +} + +func (v NullableOaiChatCompletions200ResponseChoicesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiChatCompletions200ResponseChoicesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiChatCompletions200ResponseChoicesInner(val *OaiChatCompletions200ResponseChoicesInner) *NullableOaiChatCompletions200ResponseChoicesInner { + return &NullableOaiChatCompletions200ResponseChoicesInner{value: val, isSet: true} +} + +func (v NullableOaiChatCompletions200ResponseChoicesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiChatCompletions200ResponseChoicesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_chat_completions_200_response_choices_inner_message.go b/model_oai_chat_completions_200_response_choices_inner_message.go new file mode 100644 index 0000000..06c18ef --- /dev/null +++ b/model_oai_chat_completions_200_response_choices_inner_message.go @@ -0,0 +1,239 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiChatCompletions200ResponseChoicesInnerMessage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiChatCompletions200ResponseChoicesInnerMessage{} + +// OaiChatCompletions200ResponseChoicesInnerMessage struct for OaiChatCompletions200ResponseChoicesInnerMessage +type OaiChatCompletions200ResponseChoicesInnerMessage struct { + Role *string `json:"role,omitempty"` + Content NullableString `json:"content,omitempty"` + ToolCalls []map[string]interface{} `json:"tool_calls,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiChatCompletions200ResponseChoicesInnerMessage OaiChatCompletions200ResponseChoicesInnerMessage + +// NewOaiChatCompletions200ResponseChoicesInnerMessage instantiates a new OaiChatCompletions200ResponseChoicesInnerMessage 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 NewOaiChatCompletions200ResponseChoicesInnerMessage() *OaiChatCompletions200ResponseChoicesInnerMessage { + this := OaiChatCompletions200ResponseChoicesInnerMessage{} + return &this +} + +// NewOaiChatCompletions200ResponseChoicesInnerMessageWithDefaults instantiates a new OaiChatCompletions200ResponseChoicesInnerMessage 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 NewOaiChatCompletions200ResponseChoicesInnerMessageWithDefaults() *OaiChatCompletions200ResponseChoicesInnerMessage { + this := OaiChatCompletions200ResponseChoicesInnerMessage{} + return &this +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetRole() string { + if o == nil || IsNil(o.Role) { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetRoleOk() (*string, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) SetRole(v string) { + o.Role = &v +} + +// GetContent returns the Content field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetContent() string { + if o == nil || IsNil(o.Content.Get()) { + var ret string + return ret + } + return *o.Content.Get() +} + +// GetContentOk returns a tuple with the Content 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 *OaiChatCompletions200ResponseChoicesInnerMessage) GetContentOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Content.Get(), o.Content.IsSet() +} + +// HasContent returns a boolean if a field has been set. +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) HasContent() bool { + if o != nil && o.Content.IsSet() { + return true + } + + return false +} + +// SetContent gets a reference to the given NullableString and assigns it to the Content field. +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) SetContent(v string) { + o.Content.Set(&v) +} +// SetContentNil sets the value for Content to be an explicit nil +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) SetContentNil() { + o.Content.Set(nil) +} + +// UnsetContent ensures that no value is present for Content, not even an explicit nil +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) UnsetContent() { + o.Content.Unset() +} + +// GetToolCalls returns the ToolCalls field value if set, zero value otherwise. +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) GetToolCalls() []map[string]interface{} { + if o == nil || IsNil(o.ToolCalls) { + var ret []map[string]interface{} + 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 *OaiChatCompletions200ResponseChoicesInnerMessage) GetToolCallsOk() ([]map[string]interface{}, 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 *OaiChatCompletions200ResponseChoicesInnerMessage) HasToolCalls() bool { + if o != nil && !IsNil(o.ToolCalls) { + return true + } + + return false +} + +// SetToolCalls gets a reference to the given []map[string]interface{} and assigns it to the ToolCalls field. +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) SetToolCalls(v []map[string]interface{}) { + o.ToolCalls = v +} + +func (o OaiChatCompletions200ResponseChoicesInnerMessage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiChatCompletions200ResponseChoicesInnerMessage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if o.Content.IsSet() { + toSerialize["content"] = o.Content.Get() + } + if !IsNil(o.ToolCalls) { + toSerialize["tool_calls"] = o.ToolCalls + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiChatCompletions200ResponseChoicesInnerMessage) UnmarshalJSON(data []byte) (err error) { + varOaiChatCompletions200ResponseChoicesInnerMessage := _OaiChatCompletions200ResponseChoicesInnerMessage{} + + err = json.Unmarshal(data, &varOaiChatCompletions200ResponseChoicesInnerMessage) + + if err != nil { + return err + } + + *o = OaiChatCompletions200ResponseChoicesInnerMessage(varOaiChatCompletions200ResponseChoicesInnerMessage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "role") + delete(additionalProperties, "content") + delete(additionalProperties, "tool_calls") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiChatCompletions200ResponseChoicesInnerMessage struct { + value *OaiChatCompletions200ResponseChoicesInnerMessage + isSet bool +} + +func (v NullableOaiChatCompletions200ResponseChoicesInnerMessage) Get() *OaiChatCompletions200ResponseChoicesInnerMessage { + return v.value +} + +func (v *NullableOaiChatCompletions200ResponseChoicesInnerMessage) Set(val *OaiChatCompletions200ResponseChoicesInnerMessage) { + v.value = val + v.isSet = true +} + +func (v NullableOaiChatCompletions200ResponseChoicesInnerMessage) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiChatCompletions200ResponseChoicesInnerMessage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiChatCompletions200ResponseChoicesInnerMessage(val *OaiChatCompletions200ResponseChoicesInnerMessage) *NullableOaiChatCompletions200ResponseChoicesInnerMessage { + return &NullableOaiChatCompletions200ResponseChoicesInnerMessage{value: val, isSet: true} +} + +func (v NullableOaiChatCompletions200ResponseChoicesInnerMessage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiChatCompletions200ResponseChoicesInnerMessage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_chat_completions_200_response_usage.go b/model_oai_chat_completions_200_response_usage.go new file mode 100644 index 0000000..38c045f --- /dev/null +++ b/model_oai_chat_completions_200_response_usage.go @@ -0,0 +1,229 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiChatCompletions200ResponseUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiChatCompletions200ResponseUsage{} + +// OaiChatCompletions200ResponseUsage struct for OaiChatCompletions200ResponseUsage +type OaiChatCompletions200ResponseUsage struct { + PromptTokens *int32 `json:"prompt_tokens,omitempty"` + CompletionTokens *int32 `json:"completion_tokens,omitempty"` + TotalTokens *int32 `json:"total_tokens,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiChatCompletions200ResponseUsage OaiChatCompletions200ResponseUsage + +// NewOaiChatCompletions200ResponseUsage instantiates a new OaiChatCompletions200ResponseUsage 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 NewOaiChatCompletions200ResponseUsage() *OaiChatCompletions200ResponseUsage { + this := OaiChatCompletions200ResponseUsage{} + return &this +} + +// NewOaiChatCompletions200ResponseUsageWithDefaults instantiates a new OaiChatCompletions200ResponseUsage 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 NewOaiChatCompletions200ResponseUsageWithDefaults() *OaiChatCompletions200ResponseUsage { + this := OaiChatCompletions200ResponseUsage{} + return &this +} + +// GetPromptTokens returns the PromptTokens field value if set, zero value otherwise. +func (o *OaiChatCompletions200ResponseUsage) GetPromptTokens() int32 { + if o == nil || IsNil(o.PromptTokens) { + var ret int32 + return ret + } + return *o.PromptTokens +} + +// GetPromptTokensOk returns a tuple with the PromptTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200ResponseUsage) GetPromptTokensOk() (*int32, bool) { + if o == nil || IsNil(o.PromptTokens) { + return nil, false + } + return o.PromptTokens, true +} + +// HasPromptTokens returns a boolean if a field has been set. +func (o *OaiChatCompletions200ResponseUsage) HasPromptTokens() bool { + if o != nil && !IsNil(o.PromptTokens) { + return true + } + + return false +} + +// SetPromptTokens gets a reference to the given int32 and assigns it to the PromptTokens field. +func (o *OaiChatCompletions200ResponseUsage) SetPromptTokens(v int32) { + o.PromptTokens = &v +} + +// GetCompletionTokens returns the CompletionTokens field value if set, zero value otherwise. +func (o *OaiChatCompletions200ResponseUsage) GetCompletionTokens() int32 { + if o == nil || IsNil(o.CompletionTokens) { + var ret int32 + return ret + } + return *o.CompletionTokens +} + +// GetCompletionTokensOk returns a tuple with the CompletionTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletions200ResponseUsage) GetCompletionTokensOk() (*int32, bool) { + if o == nil || IsNil(o.CompletionTokens) { + return nil, false + } + return o.CompletionTokens, true +} + +// HasCompletionTokens returns a boolean if a field has been set. +func (o *OaiChatCompletions200ResponseUsage) HasCompletionTokens() bool { + if o != nil && !IsNil(o.CompletionTokens) { + return true + } + + return false +} + +// SetCompletionTokens gets a reference to the given int32 and assigns it to the CompletionTokens field. +func (o *OaiChatCompletions200ResponseUsage) SetCompletionTokens(v int32) { + o.CompletionTokens = &v +} + +// GetTotalTokens returns the TotalTokens field value if set, zero value otherwise. +func (o *OaiChatCompletions200ResponseUsage) 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 *OaiChatCompletions200ResponseUsage) 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 *OaiChatCompletions200ResponseUsage) 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 *OaiChatCompletions200ResponseUsage) SetTotalTokens(v int32) { + o.TotalTokens = &v +} + +func (o OaiChatCompletions200ResponseUsage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiChatCompletions200ResponseUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PromptTokens) { + toSerialize["prompt_tokens"] = o.PromptTokens + } + if !IsNil(o.CompletionTokens) { + toSerialize["completion_tokens"] = o.CompletionTokens + } + if !IsNil(o.TotalTokens) { + toSerialize["total_tokens"] = o.TotalTokens + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiChatCompletions200ResponseUsage) UnmarshalJSON(data []byte) (err error) { + varOaiChatCompletions200ResponseUsage := _OaiChatCompletions200ResponseUsage{} + + err = json.Unmarshal(data, &varOaiChatCompletions200ResponseUsage) + + if err != nil { + return err + } + + *o = OaiChatCompletions200ResponseUsage(varOaiChatCompletions200ResponseUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "prompt_tokens") + delete(additionalProperties, "completion_tokens") + delete(additionalProperties, "total_tokens") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiChatCompletions200ResponseUsage struct { + value *OaiChatCompletions200ResponseUsage + isSet bool +} + +func (v NullableOaiChatCompletions200ResponseUsage) Get() *OaiChatCompletions200ResponseUsage { + return v.value +} + +func (v *NullableOaiChatCompletions200ResponseUsage) Set(val *OaiChatCompletions200ResponseUsage) { + v.value = val + v.isSet = true +} + +func (v NullableOaiChatCompletions200ResponseUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiChatCompletions200ResponseUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiChatCompletions200ResponseUsage(val *OaiChatCompletions200ResponseUsage) *NullableOaiChatCompletions200ResponseUsage { + return &NullableOaiChatCompletions200ResponseUsage{value: val, isSet: true} +} + +func (v NullableOaiChatCompletions200ResponseUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiChatCompletions200ResponseUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_chat_completions_request.go b/model_oai_chat_completions_request.go new file mode 100644 index 0000000..9bb0d6a --- /dev/null +++ b/model_oai_chat_completions_request.go @@ -0,0 +1,466 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" + "fmt" +) + +// checks if the OaiChatCompletionsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiChatCompletionsRequest{} + +// OaiChatCompletionsRequest struct for OaiChatCompletionsRequest +type OaiChatCompletionsRequest struct { + // A model id from GET /oai/v1/models + Model string `json:"model"` + Messages []OaiChatCompletionsRequestMessagesInner `json:"messages"` + // Stream the response as SSE chat.completion.chunk events + Stream *bool `json:"stream,omitempty"` + MaxTokens *int32 `json:"max_tokens,omitempty"` + Temperature *float32 `json:"temperature,omitempty"` + TopP *float32 `json:"top_p,omitempty"` + // OpenAI function tool definitions + Tools []map[string]interface{} `json:"tools,omitempty"` + // auto | none | required | {type:function, function:{name}} + ToolChoice interface{} `json:"tool_choice,omitempty"` + // {include_usage: true} to emit a final usage chunk when streaming + StreamOptions map[string]interface{} `json:"stream_options,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiChatCompletionsRequest OaiChatCompletionsRequest + +// NewOaiChatCompletionsRequest instantiates a new OaiChatCompletionsRequest 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 NewOaiChatCompletionsRequest(model string, messages []OaiChatCompletionsRequestMessagesInner) *OaiChatCompletionsRequest { + this := OaiChatCompletionsRequest{} + this.Model = model + this.Messages = messages + var stream bool = false + this.Stream = &stream + return &this +} + +// NewOaiChatCompletionsRequestWithDefaults instantiates a new OaiChatCompletionsRequest 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 NewOaiChatCompletionsRequestWithDefaults() *OaiChatCompletionsRequest { + this := OaiChatCompletionsRequest{} + var stream bool = false + this.Stream = &stream + return &this +} + +// GetModel returns the Model field value +func (o *OaiChatCompletionsRequest) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *OaiChatCompletionsRequest) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *OaiChatCompletionsRequest) SetModel(v string) { + o.Model = v +} + +// GetMessages returns the Messages field value +func (o *OaiChatCompletionsRequest) GetMessages() []OaiChatCompletionsRequestMessagesInner { + if o == nil { + var ret []OaiChatCompletionsRequestMessagesInner + return ret + } + + return o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *OaiChatCompletionsRequest) GetMessagesOk() ([]OaiChatCompletionsRequestMessagesInner, bool) { + if o == nil { + return nil, false + } + return o.Messages, true +} + +// SetMessages sets field value +func (o *OaiChatCompletionsRequest) SetMessages(v []OaiChatCompletionsRequestMessagesInner) { + o.Messages = v +} + +// GetStream returns the Stream field value if set, zero value otherwise. +func (o *OaiChatCompletionsRequest) GetStream() bool { + if o == nil || IsNil(o.Stream) { + var ret bool + return ret + } + return *o.Stream +} + +// GetStreamOk returns a tuple with the Stream field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletionsRequest) GetStreamOk() (*bool, bool) { + if o == nil || IsNil(o.Stream) { + return nil, false + } + return o.Stream, true +} + +// HasStream returns a boolean if a field has been set. +func (o *OaiChatCompletionsRequest) HasStream() bool { + if o != nil && !IsNil(o.Stream) { + return true + } + + return false +} + +// SetStream gets a reference to the given bool and assigns it to the Stream field. +func (o *OaiChatCompletionsRequest) SetStream(v bool) { + o.Stream = &v +} + +// GetMaxTokens returns the MaxTokens field value if set, zero value otherwise. +func (o *OaiChatCompletionsRequest) 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 *OaiChatCompletionsRequest) 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 *OaiChatCompletionsRequest) 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 *OaiChatCompletionsRequest) SetMaxTokens(v int32) { + o.MaxTokens = &v +} + +// GetTemperature returns the Temperature field value if set, zero value otherwise. +func (o *OaiChatCompletionsRequest) GetTemperature() float32 { + if o == nil || IsNil(o.Temperature) { + var ret float32 + return ret + } + return *o.Temperature +} + +// GetTemperatureOk returns a tuple with the Temperature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletionsRequest) GetTemperatureOk() (*float32, bool) { + if o == nil || IsNil(o.Temperature) { + return nil, false + } + return o.Temperature, true +} + +// HasTemperature returns a boolean if a field has been set. +func (o *OaiChatCompletionsRequest) HasTemperature() bool { + if o != nil && !IsNil(o.Temperature) { + return true + } + + return false +} + +// SetTemperature gets a reference to the given float32 and assigns it to the Temperature field. +func (o *OaiChatCompletionsRequest) SetTemperature(v float32) { + o.Temperature = &v +} + +// GetTopP returns the TopP field value if set, zero value otherwise. +func (o *OaiChatCompletionsRequest) GetTopP() float32 { + if o == nil || IsNil(o.TopP) { + var ret float32 + return ret + } + return *o.TopP +} + +// GetTopPOk returns a tuple with the TopP field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletionsRequest) GetTopPOk() (*float32, bool) { + if o == nil || IsNil(o.TopP) { + return nil, false + } + return o.TopP, true +} + +// HasTopP returns a boolean if a field has been set. +func (o *OaiChatCompletionsRequest) HasTopP() bool { + if o != nil && !IsNil(o.TopP) { + return true + } + + return false +} + +// SetTopP gets a reference to the given float32 and assigns it to the TopP field. +func (o *OaiChatCompletionsRequest) SetTopP(v float32) { + o.TopP = &v +} + +// GetTools returns the Tools field value if set, zero value otherwise. +func (o *OaiChatCompletionsRequest) GetTools() []map[string]interface{} { + if o == nil || IsNil(o.Tools) { + var ret []map[string]interface{} + return ret + } + return o.Tools +} + +// GetToolsOk returns a tuple with the Tools field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletionsRequest) GetToolsOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.Tools) { + return nil, false + } + return o.Tools, true +} + +// HasTools returns a boolean if a field has been set. +func (o *OaiChatCompletionsRequest) HasTools() bool { + if o != nil && !IsNil(o.Tools) { + return true + } + + return false +} + +// SetTools gets a reference to the given []map[string]interface{} and assigns it to the Tools field. +func (o *OaiChatCompletionsRequest) SetTools(v []map[string]interface{}) { + o.Tools = v +} + +// GetToolChoice returns the ToolChoice field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OaiChatCompletionsRequest) GetToolChoice() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.ToolChoice +} + +// GetToolChoiceOk returns a tuple with the ToolChoice 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 *OaiChatCompletionsRequest) GetToolChoiceOk() (*interface{}, bool) { + if o == nil || IsNil(o.ToolChoice) { + return nil, false + } + return &o.ToolChoice, true +} + +// HasToolChoice returns a boolean if a field has been set. +func (o *OaiChatCompletionsRequest) HasToolChoice() bool { + if o != nil && !IsNil(o.ToolChoice) { + return true + } + + return false +} + +// SetToolChoice gets a reference to the given interface{} and assigns it to the ToolChoice field. +func (o *OaiChatCompletionsRequest) SetToolChoice(v interface{}) { + o.ToolChoice = v +} + +// GetStreamOptions returns the StreamOptions field value if set, zero value otherwise. +func (o *OaiChatCompletionsRequest) GetStreamOptions() map[string]interface{} { + if o == nil || IsNil(o.StreamOptions) { + var ret map[string]interface{} + return ret + } + return o.StreamOptions +} + +// GetStreamOptionsOk returns a tuple with the StreamOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletionsRequest) GetStreamOptionsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.StreamOptions) { + return map[string]interface{}{}, false + } + return o.StreamOptions, true +} + +// HasStreamOptions returns a boolean if a field has been set. +func (o *OaiChatCompletionsRequest) HasStreamOptions() bool { + if o != nil && !IsNil(o.StreamOptions) { + return true + } + + return false +} + +// SetStreamOptions gets a reference to the given map[string]interface{} and assigns it to the StreamOptions field. +func (o *OaiChatCompletionsRequest) SetStreamOptions(v map[string]interface{}) { + o.StreamOptions = v +} + +func (o OaiChatCompletionsRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiChatCompletionsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["model"] = o.Model + toSerialize["messages"] = o.Messages + if !IsNil(o.Stream) { + toSerialize["stream"] = o.Stream + } + if !IsNil(o.MaxTokens) { + toSerialize["max_tokens"] = o.MaxTokens + } + if !IsNil(o.Temperature) { + toSerialize["temperature"] = o.Temperature + } + if !IsNil(o.TopP) { + toSerialize["top_p"] = o.TopP + } + if !IsNil(o.Tools) { + toSerialize["tools"] = o.Tools + } + if o.ToolChoice != nil { + toSerialize["tool_choice"] = o.ToolChoice + } + if !IsNil(o.StreamOptions) { + toSerialize["stream_options"] = o.StreamOptions + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiChatCompletionsRequest) 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{ + "model", + "messages", + } + + 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) + } + } + + varOaiChatCompletionsRequest := _OaiChatCompletionsRequest{} + + err = json.Unmarshal(data, &varOaiChatCompletionsRequest) + + if err != nil { + return err + } + + *o = OaiChatCompletionsRequest(varOaiChatCompletionsRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "model") + delete(additionalProperties, "messages") + delete(additionalProperties, "stream") + delete(additionalProperties, "max_tokens") + delete(additionalProperties, "temperature") + delete(additionalProperties, "top_p") + delete(additionalProperties, "tools") + delete(additionalProperties, "tool_choice") + delete(additionalProperties, "stream_options") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiChatCompletionsRequest struct { + value *OaiChatCompletionsRequest + isSet bool +} + +func (v NullableOaiChatCompletionsRequest) Get() *OaiChatCompletionsRequest { + return v.value +} + +func (v *NullableOaiChatCompletionsRequest) Set(val *OaiChatCompletionsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOaiChatCompletionsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiChatCompletionsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiChatCompletionsRequest(val *OaiChatCompletionsRequest) *NullableOaiChatCompletionsRequest { + return &NullableOaiChatCompletionsRequest{value: val, isSet: true} +} + +func (v NullableOaiChatCompletionsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiChatCompletionsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_chat_completions_request_messages_inner.go b/model_oai_chat_completions_request_messages_inner.go new file mode 100644 index 0000000..1b4186c --- /dev/null +++ b/model_oai_chat_completions_request_messages_inner.go @@ -0,0 +1,192 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiChatCompletionsRequestMessagesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiChatCompletionsRequestMessagesInner{} + +// OaiChatCompletionsRequestMessagesInner struct for OaiChatCompletionsRequestMessagesInner +type OaiChatCompletionsRequestMessagesInner struct { + Role *string `json:"role,omitempty"` + Content *string `json:"content,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiChatCompletionsRequestMessagesInner OaiChatCompletionsRequestMessagesInner + +// NewOaiChatCompletionsRequestMessagesInner instantiates a new OaiChatCompletionsRequestMessagesInner 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 NewOaiChatCompletionsRequestMessagesInner() *OaiChatCompletionsRequestMessagesInner { + this := OaiChatCompletionsRequestMessagesInner{} + return &this +} + +// NewOaiChatCompletionsRequestMessagesInnerWithDefaults instantiates a new OaiChatCompletionsRequestMessagesInner 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 NewOaiChatCompletionsRequestMessagesInnerWithDefaults() *OaiChatCompletionsRequestMessagesInner { + this := OaiChatCompletionsRequestMessagesInner{} + return &this +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *OaiChatCompletionsRequestMessagesInner) GetRole() string { + if o == nil || IsNil(o.Role) { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletionsRequestMessagesInner) GetRoleOk() (*string, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *OaiChatCompletionsRequestMessagesInner) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *OaiChatCompletionsRequestMessagesInner) SetRole(v string) { + o.Role = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *OaiChatCompletionsRequestMessagesInner) GetContent() string { + if o == nil || IsNil(o.Content) { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiChatCompletionsRequestMessagesInner) GetContentOk() (*string, bool) { + if o == nil || IsNil(o.Content) { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *OaiChatCompletionsRequestMessagesInner) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *OaiChatCompletionsRequestMessagesInner) SetContent(v string) { + o.Content = &v +} + +func (o OaiChatCompletionsRequestMessagesInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiChatCompletionsRequestMessagesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if !IsNil(o.Content) { + toSerialize["content"] = o.Content + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiChatCompletionsRequestMessagesInner) UnmarshalJSON(data []byte) (err error) { + varOaiChatCompletionsRequestMessagesInner := _OaiChatCompletionsRequestMessagesInner{} + + err = json.Unmarshal(data, &varOaiChatCompletionsRequestMessagesInner) + + if err != nil { + return err + } + + *o = OaiChatCompletionsRequestMessagesInner(varOaiChatCompletionsRequestMessagesInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "role") + delete(additionalProperties, "content") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiChatCompletionsRequestMessagesInner struct { + value *OaiChatCompletionsRequestMessagesInner + isSet bool +} + +func (v NullableOaiChatCompletionsRequestMessagesInner) Get() *OaiChatCompletionsRequestMessagesInner { + return v.value +} + +func (v *NullableOaiChatCompletionsRequestMessagesInner) Set(val *OaiChatCompletionsRequestMessagesInner) { + v.value = val + v.isSet = true +} + +func (v NullableOaiChatCompletionsRequestMessagesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiChatCompletionsRequestMessagesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiChatCompletionsRequestMessagesInner(val *OaiChatCompletionsRequestMessagesInner) *NullableOaiChatCompletionsRequestMessagesInner { + return &NullableOaiChatCompletionsRequestMessagesInner{value: val, isSet: true} +} + +func (v NullableOaiChatCompletionsRequestMessagesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiChatCompletionsRequestMessagesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_embeddings_200_response.go b/model_oai_embeddings_200_response.go new file mode 100644 index 0000000..0c91ea4 --- /dev/null +++ b/model_oai_embeddings_200_response.go @@ -0,0 +1,266 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiEmbeddings200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiEmbeddings200Response{} + +// OaiEmbeddings200Response struct for OaiEmbeddings200Response +type OaiEmbeddings200Response struct { + Object *string `json:"object,omitempty"` + Data []OaiEmbeddings200ResponseDataInner `json:"data,omitempty"` + Model *string `json:"model,omitempty"` + Usage *OaiEmbeddings200ResponseUsage `json:"usage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiEmbeddings200Response OaiEmbeddings200Response + +// NewOaiEmbeddings200Response instantiates a new OaiEmbeddings200Response 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 NewOaiEmbeddings200Response() *OaiEmbeddings200Response { + this := OaiEmbeddings200Response{} + return &this +} + +// NewOaiEmbeddings200ResponseWithDefaults instantiates a new OaiEmbeddings200Response 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 NewOaiEmbeddings200ResponseWithDefaults() *OaiEmbeddings200Response { + this := OaiEmbeddings200Response{} + return &this +} + +// GetObject returns the Object field value if set, zero value otherwise. +func (o *OaiEmbeddings200Response) GetObject() string { + if o == nil || IsNil(o.Object) { + var ret string + return ret + } + return *o.Object +} + +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiEmbeddings200Response) GetObjectOk() (*string, bool) { + if o == nil || IsNil(o.Object) { + return nil, false + } + return o.Object, true +} + +// HasObject returns a boolean if a field has been set. +func (o *OaiEmbeddings200Response) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given string and assigns it to the Object field. +func (o *OaiEmbeddings200Response) SetObject(v string) { + o.Object = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *OaiEmbeddings200Response) GetData() []OaiEmbeddings200ResponseDataInner { + if o == nil || IsNil(o.Data) { + var ret []OaiEmbeddings200ResponseDataInner + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiEmbeddings200Response) GetDataOk() ([]OaiEmbeddings200ResponseDataInner, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *OaiEmbeddings200Response) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []OaiEmbeddings200ResponseDataInner and assigns it to the Data field. +func (o *OaiEmbeddings200Response) SetData(v []OaiEmbeddings200ResponseDataInner) { + o.Data = v +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *OaiEmbeddings200Response) GetModel() string { + if o == nil || IsNil(o.Model) { + var ret string + return ret + } + return *o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiEmbeddings200Response) GetModelOk() (*string, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *OaiEmbeddings200Response) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given string and assigns it to the Model field. +func (o *OaiEmbeddings200Response) SetModel(v string) { + o.Model = &v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *OaiEmbeddings200Response) GetUsage() OaiEmbeddings200ResponseUsage { + if o == nil || IsNil(o.Usage) { + var ret OaiEmbeddings200ResponseUsage + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiEmbeddings200Response) GetUsageOk() (*OaiEmbeddings200ResponseUsage, bool) { + if o == nil || IsNil(o.Usage) { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *OaiEmbeddings200Response) HasUsage() bool { + if o != nil && !IsNil(o.Usage) { + return true + } + + return false +} + +// SetUsage gets a reference to the given OaiEmbeddings200ResponseUsage and assigns it to the Usage field. +func (o *OaiEmbeddings200Response) SetUsage(v OaiEmbeddings200ResponseUsage) { + o.Usage = &v +} + +func (o OaiEmbeddings200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiEmbeddings200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Object) { + toSerialize["object"] = o.Object + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.Usage) { + toSerialize["usage"] = o.Usage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiEmbeddings200Response) UnmarshalJSON(data []byte) (err error) { + varOaiEmbeddings200Response := _OaiEmbeddings200Response{} + + err = json.Unmarshal(data, &varOaiEmbeddings200Response) + + if err != nil { + return err + } + + *o = OaiEmbeddings200Response(varOaiEmbeddings200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "object") + delete(additionalProperties, "data") + delete(additionalProperties, "model") + delete(additionalProperties, "usage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiEmbeddings200Response struct { + value *OaiEmbeddings200Response + isSet bool +} + +func (v NullableOaiEmbeddings200Response) Get() *OaiEmbeddings200Response { + return v.value +} + +func (v *NullableOaiEmbeddings200Response) Set(val *OaiEmbeddings200Response) { + v.value = val + v.isSet = true +} + +func (v NullableOaiEmbeddings200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiEmbeddings200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiEmbeddings200Response(val *OaiEmbeddings200Response) *NullableOaiEmbeddings200Response { + return &NullableOaiEmbeddings200Response{value: val, isSet: true} +} + +func (v NullableOaiEmbeddings200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiEmbeddings200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_embeddings_200_response_data_inner.go b/model_oai_embeddings_200_response_data_inner.go new file mode 100644 index 0000000..ee824f1 --- /dev/null +++ b/model_oai_embeddings_200_response_data_inner.go @@ -0,0 +1,229 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiEmbeddings200ResponseDataInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiEmbeddings200ResponseDataInner{} + +// OaiEmbeddings200ResponseDataInner struct for OaiEmbeddings200ResponseDataInner +type OaiEmbeddings200ResponseDataInner struct { + Object *string `json:"object,omitempty"` + Index *int32 `json:"index,omitempty"` + Embedding []float32 `json:"embedding,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiEmbeddings200ResponseDataInner OaiEmbeddings200ResponseDataInner + +// NewOaiEmbeddings200ResponseDataInner instantiates a new OaiEmbeddings200ResponseDataInner 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 NewOaiEmbeddings200ResponseDataInner() *OaiEmbeddings200ResponseDataInner { + this := OaiEmbeddings200ResponseDataInner{} + return &this +} + +// NewOaiEmbeddings200ResponseDataInnerWithDefaults instantiates a new OaiEmbeddings200ResponseDataInner 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 NewOaiEmbeddings200ResponseDataInnerWithDefaults() *OaiEmbeddings200ResponseDataInner { + this := OaiEmbeddings200ResponseDataInner{} + return &this +} + +// GetObject returns the Object field value if set, zero value otherwise. +func (o *OaiEmbeddings200ResponseDataInner) GetObject() string { + if o == nil || IsNil(o.Object) { + var ret string + return ret + } + return *o.Object +} + +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiEmbeddings200ResponseDataInner) GetObjectOk() (*string, bool) { + if o == nil || IsNil(o.Object) { + return nil, false + } + return o.Object, true +} + +// HasObject returns a boolean if a field has been set. +func (o *OaiEmbeddings200ResponseDataInner) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given string and assigns it to the Object field. +func (o *OaiEmbeddings200ResponseDataInner) SetObject(v string) { + o.Object = &v +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *OaiEmbeddings200ResponseDataInner) GetIndex() int32 { + if o == nil || IsNil(o.Index) { + var ret int32 + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiEmbeddings200ResponseDataInner) GetIndexOk() (*int32, bool) { + if o == nil || IsNil(o.Index) { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *OaiEmbeddings200ResponseDataInner) HasIndex() bool { + if o != nil && !IsNil(o.Index) { + return true + } + + return false +} + +// SetIndex gets a reference to the given int32 and assigns it to the Index field. +func (o *OaiEmbeddings200ResponseDataInner) SetIndex(v int32) { + o.Index = &v +} + +// GetEmbedding returns the Embedding field value if set, zero value otherwise. +func (o *OaiEmbeddings200ResponseDataInner) GetEmbedding() []float32 { + if o == nil || IsNil(o.Embedding) { + var ret []float32 + return ret + } + return o.Embedding +} + +// GetEmbeddingOk returns a tuple with the Embedding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiEmbeddings200ResponseDataInner) GetEmbeddingOk() ([]float32, bool) { + if o == nil || IsNil(o.Embedding) { + return nil, false + } + return o.Embedding, true +} + +// HasEmbedding returns a boolean if a field has been set. +func (o *OaiEmbeddings200ResponseDataInner) HasEmbedding() bool { + if o != nil && !IsNil(o.Embedding) { + return true + } + + return false +} + +// SetEmbedding gets a reference to the given []float32 and assigns it to the Embedding field. +func (o *OaiEmbeddings200ResponseDataInner) SetEmbedding(v []float32) { + o.Embedding = v +} + +func (o OaiEmbeddings200ResponseDataInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiEmbeddings200ResponseDataInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Object) { + toSerialize["object"] = o.Object + } + if !IsNil(o.Index) { + toSerialize["index"] = o.Index + } + if !IsNil(o.Embedding) { + toSerialize["embedding"] = o.Embedding + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiEmbeddings200ResponseDataInner) UnmarshalJSON(data []byte) (err error) { + varOaiEmbeddings200ResponseDataInner := _OaiEmbeddings200ResponseDataInner{} + + err = json.Unmarshal(data, &varOaiEmbeddings200ResponseDataInner) + + if err != nil { + return err + } + + *o = OaiEmbeddings200ResponseDataInner(varOaiEmbeddings200ResponseDataInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "object") + delete(additionalProperties, "index") + delete(additionalProperties, "embedding") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiEmbeddings200ResponseDataInner struct { + value *OaiEmbeddings200ResponseDataInner + isSet bool +} + +func (v NullableOaiEmbeddings200ResponseDataInner) Get() *OaiEmbeddings200ResponseDataInner { + return v.value +} + +func (v *NullableOaiEmbeddings200ResponseDataInner) Set(val *OaiEmbeddings200ResponseDataInner) { + v.value = val + v.isSet = true +} + +func (v NullableOaiEmbeddings200ResponseDataInner) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiEmbeddings200ResponseDataInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiEmbeddings200ResponseDataInner(val *OaiEmbeddings200ResponseDataInner) *NullableOaiEmbeddings200ResponseDataInner { + return &NullableOaiEmbeddings200ResponseDataInner{value: val, isSet: true} +} + +func (v NullableOaiEmbeddings200ResponseDataInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiEmbeddings200ResponseDataInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_embeddings_200_response_usage.go b/model_oai_embeddings_200_response_usage.go new file mode 100644 index 0000000..8e399d8 --- /dev/null +++ b/model_oai_embeddings_200_response_usage.go @@ -0,0 +1,192 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiEmbeddings200ResponseUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiEmbeddings200ResponseUsage{} + +// OaiEmbeddings200ResponseUsage struct for OaiEmbeddings200ResponseUsage +type OaiEmbeddings200ResponseUsage struct { + PromptTokens *int32 `json:"prompt_tokens,omitempty"` + TotalTokens *int32 `json:"total_tokens,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiEmbeddings200ResponseUsage OaiEmbeddings200ResponseUsage + +// NewOaiEmbeddings200ResponseUsage instantiates a new OaiEmbeddings200ResponseUsage 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 NewOaiEmbeddings200ResponseUsage() *OaiEmbeddings200ResponseUsage { + this := OaiEmbeddings200ResponseUsage{} + return &this +} + +// NewOaiEmbeddings200ResponseUsageWithDefaults instantiates a new OaiEmbeddings200ResponseUsage 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 NewOaiEmbeddings200ResponseUsageWithDefaults() *OaiEmbeddings200ResponseUsage { + this := OaiEmbeddings200ResponseUsage{} + return &this +} + +// GetPromptTokens returns the PromptTokens field value if set, zero value otherwise. +func (o *OaiEmbeddings200ResponseUsage) GetPromptTokens() int32 { + if o == nil || IsNil(o.PromptTokens) { + var ret int32 + return ret + } + return *o.PromptTokens +} + +// GetPromptTokensOk returns a tuple with the PromptTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiEmbeddings200ResponseUsage) GetPromptTokensOk() (*int32, bool) { + if o == nil || IsNil(o.PromptTokens) { + return nil, false + } + return o.PromptTokens, true +} + +// HasPromptTokens returns a boolean if a field has been set. +func (o *OaiEmbeddings200ResponseUsage) HasPromptTokens() bool { + if o != nil && !IsNil(o.PromptTokens) { + return true + } + + return false +} + +// SetPromptTokens gets a reference to the given int32 and assigns it to the PromptTokens field. +func (o *OaiEmbeddings200ResponseUsage) SetPromptTokens(v int32) { + o.PromptTokens = &v +} + +// GetTotalTokens returns the TotalTokens field value if set, zero value otherwise. +func (o *OaiEmbeddings200ResponseUsage) 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 *OaiEmbeddings200ResponseUsage) 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 *OaiEmbeddings200ResponseUsage) 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 *OaiEmbeddings200ResponseUsage) SetTotalTokens(v int32) { + o.TotalTokens = &v +} + +func (o OaiEmbeddings200ResponseUsage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiEmbeddings200ResponseUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PromptTokens) { + toSerialize["prompt_tokens"] = o.PromptTokens + } + if !IsNil(o.TotalTokens) { + toSerialize["total_tokens"] = o.TotalTokens + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiEmbeddings200ResponseUsage) UnmarshalJSON(data []byte) (err error) { + varOaiEmbeddings200ResponseUsage := _OaiEmbeddings200ResponseUsage{} + + err = json.Unmarshal(data, &varOaiEmbeddings200ResponseUsage) + + if err != nil { + return err + } + + *o = OaiEmbeddings200ResponseUsage(varOaiEmbeddings200ResponseUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "prompt_tokens") + delete(additionalProperties, "total_tokens") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiEmbeddings200ResponseUsage struct { + value *OaiEmbeddings200ResponseUsage + isSet bool +} + +func (v NullableOaiEmbeddings200ResponseUsage) Get() *OaiEmbeddings200ResponseUsage { + return v.value +} + +func (v *NullableOaiEmbeddings200ResponseUsage) Set(val *OaiEmbeddings200ResponseUsage) { + v.value = val + v.isSet = true +} + +func (v NullableOaiEmbeddings200ResponseUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiEmbeddings200ResponseUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiEmbeddings200ResponseUsage(val *OaiEmbeddings200ResponseUsage) *NullableOaiEmbeddings200ResponseUsage { + return &NullableOaiEmbeddings200ResponseUsage{value: val, isSet: true} +} + +func (v NullableOaiEmbeddings200ResponseUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiEmbeddings200ResponseUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_embeddings_request.go b/model_oai_embeddings_request.go new file mode 100644 index 0000000..38fea67 --- /dev/null +++ b/model_oai_embeddings_request.go @@ -0,0 +1,202 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" + "fmt" +) + +// checks if the OaiEmbeddingsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiEmbeddingsRequest{} + +// OaiEmbeddingsRequest struct for OaiEmbeddingsRequest +type OaiEmbeddingsRequest struct { + Model string `json:"model"` + // A string or array of strings to embed + Input interface{} `json:"input"` + AdditionalProperties map[string]interface{} +} + +type _OaiEmbeddingsRequest OaiEmbeddingsRequest + +// NewOaiEmbeddingsRequest instantiates a new OaiEmbeddingsRequest 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 NewOaiEmbeddingsRequest(model string, input interface{}) *OaiEmbeddingsRequest { + this := OaiEmbeddingsRequest{} + this.Model = model + this.Input = input + return &this +} + +// NewOaiEmbeddingsRequestWithDefaults instantiates a new OaiEmbeddingsRequest 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 NewOaiEmbeddingsRequestWithDefaults() *OaiEmbeddingsRequest { + this := OaiEmbeddingsRequest{} + return &this +} + +// GetModel returns the Model field value +func (o *OaiEmbeddingsRequest) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *OaiEmbeddingsRequest) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *OaiEmbeddingsRequest) SetModel(v string) { + o.Model = v +} + +// GetInput returns the Input field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *OaiEmbeddingsRequest) GetInput() interface{} { + if o == nil { + var ret 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. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OaiEmbeddingsRequest) GetInputOk() (*interface{}, bool) { + if o == nil || IsNil(o.Input) { + return nil, false + } + return &o.Input, true +} + +// SetInput sets field value +func (o *OaiEmbeddingsRequest) SetInput(v interface{}) { + o.Input = v +} + +func (o OaiEmbeddingsRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiEmbeddingsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["model"] = o.Model + if o.Input != nil { + toSerialize["input"] = o.Input + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiEmbeddingsRequest) 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{ + "model", + "input", + } + + 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) + } + } + + varOaiEmbeddingsRequest := _OaiEmbeddingsRequest{} + + err = json.Unmarshal(data, &varOaiEmbeddingsRequest) + + if err != nil { + return err + } + + *o = OaiEmbeddingsRequest(varOaiEmbeddingsRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "model") + delete(additionalProperties, "input") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiEmbeddingsRequest struct { + value *OaiEmbeddingsRequest + isSet bool +} + +func (v NullableOaiEmbeddingsRequest) Get() *OaiEmbeddingsRequest { + return v.value +} + +func (v *NullableOaiEmbeddingsRequest) Set(val *OaiEmbeddingsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOaiEmbeddingsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiEmbeddingsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiEmbeddingsRequest(val *OaiEmbeddingsRequest) *NullableOaiEmbeddingsRequest { + return &NullableOaiEmbeddingsRequest{value: val, isSet: true} +} + +func (v NullableOaiEmbeddingsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiEmbeddingsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_get_model_200_response.go b/model_oai_get_model_200_response.go new file mode 100644 index 0000000..9b31149 --- /dev/null +++ b/model_oai_get_model_200_response.go @@ -0,0 +1,266 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiGetModel200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiGetModel200Response{} + +// OaiGetModel200Response struct for OaiGetModel200Response +type OaiGetModel200Response struct { + Id *string `json:"id,omitempty"` + Object *string `json:"object,omitempty"` + Created *int32 `json:"created,omitempty"` + OwnedBy *string `json:"owned_by,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiGetModel200Response OaiGetModel200Response + +// NewOaiGetModel200Response instantiates a new OaiGetModel200Response 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 NewOaiGetModel200Response() *OaiGetModel200Response { + this := OaiGetModel200Response{} + return &this +} + +// NewOaiGetModel200ResponseWithDefaults instantiates a new OaiGetModel200Response 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 NewOaiGetModel200ResponseWithDefaults() *OaiGetModel200Response { + this := OaiGetModel200Response{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *OaiGetModel200Response) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiGetModel200Response) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *OaiGetModel200Response) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *OaiGetModel200Response) SetId(v string) { + o.Id = &v +} + +// GetObject returns the Object field value if set, zero value otherwise. +func (o *OaiGetModel200Response) GetObject() string { + if o == nil || IsNil(o.Object) { + var ret string + return ret + } + return *o.Object +} + +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiGetModel200Response) GetObjectOk() (*string, bool) { + if o == nil || IsNil(o.Object) { + return nil, false + } + return o.Object, true +} + +// HasObject returns a boolean if a field has been set. +func (o *OaiGetModel200Response) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given string and assigns it to the Object field. +func (o *OaiGetModel200Response) SetObject(v string) { + o.Object = &v +} + +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *OaiGetModel200Response) GetCreated() int32 { + if o == nil || IsNil(o.Created) { + var ret int32 + return ret + } + return *o.Created +} + +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiGetModel200Response) GetCreatedOk() (*int32, bool) { + if o == nil || IsNil(o.Created) { + return nil, false + } + return o.Created, true +} + +// HasCreated returns a boolean if a field has been set. +func (o *OaiGetModel200Response) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false +} + +// SetCreated gets a reference to the given int32 and assigns it to the Created field. +func (o *OaiGetModel200Response) SetCreated(v int32) { + o.Created = &v +} + +// GetOwnedBy returns the OwnedBy field value if set, zero value otherwise. +func (o *OaiGetModel200Response) GetOwnedBy() string { + if o == nil || IsNil(o.OwnedBy) { + var ret string + return ret + } + return *o.OwnedBy +} + +// GetOwnedByOk returns a tuple with the OwnedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiGetModel200Response) GetOwnedByOk() (*string, bool) { + if o == nil || IsNil(o.OwnedBy) { + return nil, false + } + return o.OwnedBy, true +} + +// HasOwnedBy returns a boolean if a field has been set. +func (o *OaiGetModel200Response) HasOwnedBy() bool { + if o != nil && !IsNil(o.OwnedBy) { + return true + } + + return false +} + +// SetOwnedBy gets a reference to the given string and assigns it to the OwnedBy field. +func (o *OaiGetModel200Response) SetOwnedBy(v string) { + o.OwnedBy = &v +} + +func (o OaiGetModel200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiGetModel200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Object) { + toSerialize["object"] = o.Object + } + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } + if !IsNil(o.OwnedBy) { + toSerialize["owned_by"] = o.OwnedBy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiGetModel200Response) UnmarshalJSON(data []byte) (err error) { + varOaiGetModel200Response := _OaiGetModel200Response{} + + err = json.Unmarshal(data, &varOaiGetModel200Response) + + if err != nil { + return err + } + + *o = OaiGetModel200Response(varOaiGetModel200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "object") + delete(additionalProperties, "created") + delete(additionalProperties, "owned_by") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiGetModel200Response struct { + value *OaiGetModel200Response + isSet bool +} + +func (v NullableOaiGetModel200Response) Get() *OaiGetModel200Response { + return v.value +} + +func (v *NullableOaiGetModel200Response) Set(val *OaiGetModel200Response) { + v.value = val + v.isSet = true +} + +func (v NullableOaiGetModel200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiGetModel200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiGetModel200Response(val *OaiGetModel200Response) *NullableOaiGetModel200Response { + return &NullableOaiGetModel200Response{value: val, isSet: true} +} + +func (v NullableOaiGetModel200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiGetModel200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_list_models_200_response.go b/model_oai_list_models_200_response.go new file mode 100644 index 0000000..bf02405 --- /dev/null +++ b/model_oai_list_models_200_response.go @@ -0,0 +1,192 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiListModels200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiListModels200Response{} + +// OaiListModels200Response struct for OaiListModels200Response +type OaiListModels200Response struct { + Object *string `json:"object,omitempty"` + Data []OaiListModels200ResponseDataInner `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiListModels200Response OaiListModels200Response + +// NewOaiListModels200Response instantiates a new OaiListModels200Response 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 NewOaiListModels200Response() *OaiListModels200Response { + this := OaiListModels200Response{} + return &this +} + +// NewOaiListModels200ResponseWithDefaults instantiates a new OaiListModels200Response 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 NewOaiListModels200ResponseWithDefaults() *OaiListModels200Response { + this := OaiListModels200Response{} + return &this +} + +// GetObject returns the Object field value if set, zero value otherwise. +func (o *OaiListModels200Response) GetObject() string { + if o == nil || IsNil(o.Object) { + var ret string + return ret + } + return *o.Object +} + +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiListModels200Response) GetObjectOk() (*string, bool) { + if o == nil || IsNil(o.Object) { + return nil, false + } + return o.Object, true +} + +// HasObject returns a boolean if a field has been set. +func (o *OaiListModels200Response) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given string and assigns it to the Object field. +func (o *OaiListModels200Response) SetObject(v string) { + o.Object = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *OaiListModels200Response) GetData() []OaiListModels200ResponseDataInner { + if o == nil || IsNil(o.Data) { + var ret []OaiListModels200ResponseDataInner + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiListModels200Response) GetDataOk() ([]OaiListModels200ResponseDataInner, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *OaiListModels200Response) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []OaiListModels200ResponseDataInner and assigns it to the Data field. +func (o *OaiListModels200Response) SetData(v []OaiListModels200ResponseDataInner) { + o.Data = v +} + +func (o OaiListModels200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiListModels200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Object) { + toSerialize["object"] = o.Object + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiListModels200Response) UnmarshalJSON(data []byte) (err error) { + varOaiListModels200Response := _OaiListModels200Response{} + + err = json.Unmarshal(data, &varOaiListModels200Response) + + if err != nil { + return err + } + + *o = OaiListModels200Response(varOaiListModels200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "object") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiListModels200Response struct { + value *OaiListModels200Response + isSet bool +} + +func (v NullableOaiListModels200Response) Get() *OaiListModels200Response { + return v.value +} + +func (v *NullableOaiListModels200Response) Set(val *OaiListModels200Response) { + v.value = val + v.isSet = true +} + +func (v NullableOaiListModels200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiListModels200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiListModels200Response(val *OaiListModels200Response) *NullableOaiListModels200Response { + return &NullableOaiListModels200Response{value: val, isSet: true} +} + +func (v NullableOaiListModels200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiListModels200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_oai_list_models_200_response_data_inner.go b/model_oai_list_models_200_response_data_inner.go new file mode 100644 index 0000000..f2b5c4e --- /dev/null +++ b/model_oai_list_models_200_response_data_inner.go @@ -0,0 +1,266 @@ +/* +QuantCDN API + +Unified API for QuantCDN Admin and QuantCloud Platform services + +API version: 4.19.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package quantadmingo + +import ( + "encoding/json" +) + +// checks if the OaiListModels200ResponseDataInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OaiListModels200ResponseDataInner{} + +// OaiListModels200ResponseDataInner struct for OaiListModels200ResponseDataInner +type OaiListModels200ResponseDataInner struct { + Id *string `json:"id,omitempty"` + Object *string `json:"object,omitempty"` + Created *int32 `json:"created,omitempty"` + OwnedBy *string `json:"owned_by,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OaiListModels200ResponseDataInner OaiListModels200ResponseDataInner + +// NewOaiListModels200ResponseDataInner instantiates a new OaiListModels200ResponseDataInner 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 NewOaiListModels200ResponseDataInner() *OaiListModels200ResponseDataInner { + this := OaiListModels200ResponseDataInner{} + return &this +} + +// NewOaiListModels200ResponseDataInnerWithDefaults instantiates a new OaiListModels200ResponseDataInner 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 NewOaiListModels200ResponseDataInnerWithDefaults() *OaiListModels200ResponseDataInner { + this := OaiListModels200ResponseDataInner{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *OaiListModels200ResponseDataInner) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiListModels200ResponseDataInner) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *OaiListModels200ResponseDataInner) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *OaiListModels200ResponseDataInner) SetId(v string) { + o.Id = &v +} + +// GetObject returns the Object field value if set, zero value otherwise. +func (o *OaiListModels200ResponseDataInner) GetObject() string { + if o == nil || IsNil(o.Object) { + var ret string + return ret + } + return *o.Object +} + +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiListModels200ResponseDataInner) GetObjectOk() (*string, bool) { + if o == nil || IsNil(o.Object) { + return nil, false + } + return o.Object, true +} + +// HasObject returns a boolean if a field has been set. +func (o *OaiListModels200ResponseDataInner) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given string and assigns it to the Object field. +func (o *OaiListModels200ResponseDataInner) SetObject(v string) { + o.Object = &v +} + +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *OaiListModels200ResponseDataInner) GetCreated() int32 { + if o == nil || IsNil(o.Created) { + var ret int32 + return ret + } + return *o.Created +} + +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiListModels200ResponseDataInner) GetCreatedOk() (*int32, bool) { + if o == nil || IsNil(o.Created) { + return nil, false + } + return o.Created, true +} + +// HasCreated returns a boolean if a field has been set. +func (o *OaiListModels200ResponseDataInner) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false +} + +// SetCreated gets a reference to the given int32 and assigns it to the Created field. +func (o *OaiListModels200ResponseDataInner) SetCreated(v int32) { + o.Created = &v +} + +// GetOwnedBy returns the OwnedBy field value if set, zero value otherwise. +func (o *OaiListModels200ResponseDataInner) GetOwnedBy() string { + if o == nil || IsNil(o.OwnedBy) { + var ret string + return ret + } + return *o.OwnedBy +} + +// GetOwnedByOk returns a tuple with the OwnedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OaiListModels200ResponseDataInner) GetOwnedByOk() (*string, bool) { + if o == nil || IsNil(o.OwnedBy) { + return nil, false + } + return o.OwnedBy, true +} + +// HasOwnedBy returns a boolean if a field has been set. +func (o *OaiListModels200ResponseDataInner) HasOwnedBy() bool { + if o != nil && !IsNil(o.OwnedBy) { + return true + } + + return false +} + +// SetOwnedBy gets a reference to the given string and assigns it to the OwnedBy field. +func (o *OaiListModels200ResponseDataInner) SetOwnedBy(v string) { + o.OwnedBy = &v +} + +func (o OaiListModels200ResponseDataInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OaiListModels200ResponseDataInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Object) { + toSerialize["object"] = o.Object + } + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } + if !IsNil(o.OwnedBy) { + toSerialize["owned_by"] = o.OwnedBy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OaiListModels200ResponseDataInner) UnmarshalJSON(data []byte) (err error) { + varOaiListModels200ResponseDataInner := _OaiListModels200ResponseDataInner{} + + err = json.Unmarshal(data, &varOaiListModels200ResponseDataInner) + + if err != nil { + return err + } + + *o = OaiListModels200ResponseDataInner(varOaiListModels200ResponseDataInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "object") + delete(additionalProperties, "created") + delete(additionalProperties, "owned_by") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOaiListModels200ResponseDataInner struct { + value *OaiListModels200ResponseDataInner + isSet bool +} + +func (v NullableOaiListModels200ResponseDataInner) Get() *OaiListModels200ResponseDataInner { + return v.value +} + +func (v *NullableOaiListModels200ResponseDataInner) Set(val *OaiListModels200ResponseDataInner) { + v.value = val + v.isSet = true +} + +func (v NullableOaiListModels200ResponseDataInner) IsSet() bool { + return v.isSet +} + +func (v *NullableOaiListModels200ResponseDataInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOaiListModels200ResponseDataInner(val *OaiListModels200ResponseDataInner) *NullableOaiListModels200ResponseDataInner { + return &NullableOaiListModels200ResponseDataInner{value: val, isSet: true} +} + +func (v NullableOaiListModels200ResponseDataInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOaiListModels200ResponseDataInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_patch_environment_compose_request.go b/model_patch_environment_compose_request.go index f335216..0ad72cf 100644 --- a/model_patch_environment_compose_request.go +++ b/model_patch_environment_compose_request.go @@ -24,6 +24,10 @@ type PatchEnvironmentComposeRequest struct { TaskMemory NullableString `json:"taskMemory,omitempty"` MinCapacity NullableInt32 `json:"minCapacity,omitempty"` MaxCapacity NullableInt32 `json:"maxCapacity,omitempty"` + // Forces single-task mode (max one running task). Omitted = auto-detect from stateful containers. + SingleTaskOnly NullableBool `json:"singleTaskOnly,omitempty"` + // Seconds the load balancer waits after a task starts before an unhealthy health check can replace it. Default 120. + StartupGracePeriodSeconds NullableInt32 `json:"startupGracePeriodSeconds,omitempty"` Containers []map[string]interface{} `json:"containers,omitempty"` SpotConfiguration NullablePatchEnvironmentComposeRequestSpotConfiguration `json:"spotConfiguration,omitempty"` EnableCrossEnvNetworking NullableBool `json:"enableCrossEnvNetworking,omitempty"` @@ -260,6 +264,90 @@ func (o *PatchEnvironmentComposeRequest) UnsetMaxCapacity() { o.MaxCapacity.Unset() } +// GetSingleTaskOnly returns the SingleTaskOnly field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchEnvironmentComposeRequest) GetSingleTaskOnly() bool { + if o == nil || IsNil(o.SingleTaskOnly.Get()) { + var ret bool + return ret + } + return *o.SingleTaskOnly.Get() +} + +// GetSingleTaskOnlyOk returns a tuple with the SingleTaskOnly 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 *PatchEnvironmentComposeRequest) GetSingleTaskOnlyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.SingleTaskOnly.Get(), o.SingleTaskOnly.IsSet() +} + +// HasSingleTaskOnly returns a boolean if a field has been set. +func (o *PatchEnvironmentComposeRequest) HasSingleTaskOnly() bool { + if o != nil && o.SingleTaskOnly.IsSet() { + return true + } + + return false +} + +// SetSingleTaskOnly gets a reference to the given NullableBool and assigns it to the SingleTaskOnly field. +func (o *PatchEnvironmentComposeRequest) SetSingleTaskOnly(v bool) { + o.SingleTaskOnly.Set(&v) +} +// SetSingleTaskOnlyNil sets the value for SingleTaskOnly to be an explicit nil +func (o *PatchEnvironmentComposeRequest) SetSingleTaskOnlyNil() { + o.SingleTaskOnly.Set(nil) +} + +// UnsetSingleTaskOnly ensures that no value is present for SingleTaskOnly, not even an explicit nil +func (o *PatchEnvironmentComposeRequest) UnsetSingleTaskOnly() { + o.SingleTaskOnly.Unset() +} + +// GetStartupGracePeriodSeconds returns the StartupGracePeriodSeconds field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchEnvironmentComposeRequest) GetStartupGracePeriodSeconds() int32 { + if o == nil || IsNil(o.StartupGracePeriodSeconds.Get()) { + var ret int32 + return ret + } + return *o.StartupGracePeriodSeconds.Get() +} + +// GetStartupGracePeriodSecondsOk returns a tuple with the StartupGracePeriodSeconds 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 *PatchEnvironmentComposeRequest) GetStartupGracePeriodSecondsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.StartupGracePeriodSeconds.Get(), o.StartupGracePeriodSeconds.IsSet() +} + +// HasStartupGracePeriodSeconds returns a boolean if a field has been set. +func (o *PatchEnvironmentComposeRequest) HasStartupGracePeriodSeconds() bool { + if o != nil && o.StartupGracePeriodSeconds.IsSet() { + return true + } + + return false +} + +// SetStartupGracePeriodSeconds gets a reference to the given NullableInt32 and assigns it to the StartupGracePeriodSeconds field. +func (o *PatchEnvironmentComposeRequest) SetStartupGracePeriodSeconds(v int32) { + o.StartupGracePeriodSeconds.Set(&v) +} +// SetStartupGracePeriodSecondsNil sets the value for StartupGracePeriodSeconds to be an explicit nil +func (o *PatchEnvironmentComposeRequest) SetStartupGracePeriodSecondsNil() { + o.StartupGracePeriodSeconds.Set(nil) +} + +// UnsetStartupGracePeriodSeconds ensures that no value is present for StartupGracePeriodSeconds, not even an explicit nil +func (o *PatchEnvironmentComposeRequest) UnsetStartupGracePeriodSeconds() { + o.StartupGracePeriodSeconds.Unset() +} + // GetContainers returns the Containers field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PatchEnvironmentComposeRequest) GetContainers() []map[string]interface{} { if o == nil { @@ -444,6 +532,12 @@ func (o PatchEnvironmentComposeRequest) ToMap() (map[string]interface{}, error) if o.MaxCapacity.IsSet() { toSerialize["maxCapacity"] = o.MaxCapacity.Get() } + if o.SingleTaskOnly.IsSet() { + toSerialize["singleTaskOnly"] = o.SingleTaskOnly.Get() + } + if o.StartupGracePeriodSeconds.IsSet() { + toSerialize["startupGracePeriodSeconds"] = o.StartupGracePeriodSeconds.Get() + } if o.Containers != nil { toSerialize["containers"] = o.Containers } @@ -483,6 +577,8 @@ func (o *PatchEnvironmentComposeRequest) UnmarshalJSON(data []byte) (err error) delete(additionalProperties, "taskMemory") delete(additionalProperties, "minCapacity") delete(additionalProperties, "maxCapacity") + delete(additionalProperties, "singleTaskOnly") + delete(additionalProperties, "startupGracePeriodSeconds") delete(additionalProperties, "containers") delete(additionalProperties, "spotConfiguration") delete(additionalProperties, "enableCrossEnvNetworking") diff --git a/test/api_open_ai_compatibility_test.go b/test/api_open_ai_compatibility_test.go new file mode 100644 index 0000000..aa5d9b2 --- /dev/null +++ b/test/api_open_ai_compatibility_test.go @@ -0,0 +1,75 @@ +/* +QuantCDN API + +Testing OpenAICompatibilityAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package quantadmingo + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/quantcdn/quant-admin-go/v4" +) + +func Test_quantadmingo_OpenAICompatibilityAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test OpenAICompatibilityAPIService OaiChatCompletions", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OpenAICompatibilityAPI.OaiChatCompletions(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OpenAICompatibilityAPIService OaiEmbeddings", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OpenAICompatibilityAPI.OaiEmbeddings(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OpenAICompatibilityAPIService OaiGetModel", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var model string + + resp, httpRes, err := apiClient.OpenAICompatibilityAPI.OaiGetModel(context.Background(), model).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test OpenAICompatibilityAPIService OaiListModels", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OpenAICompatibilityAPI.OaiListModels(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +}