diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 23d3b7fb9b8..ccc8ce0550d 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -107467,6 +107467,287 @@ components:
required:
- type
type: object
+ OpenAIModelInferenceIntegrationAccountAuthenticationRequest:
+ description: Authentication for creating the OpenAI Model Inference integration account. Set exactly one method.
+ oneOf:
+ - $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest"
+ OpenAIModelInferenceIntegrationAccountAuthenticationResponse:
+ description: Authentication configured on the OpenAI Model Inference integration account.
+ oneOf:
+ - $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountBearerTokenAuthResponse"
+ OpenAIModelInferenceIntegrationAccountAuthenticationUpdate:
+ description: Authentication for updating the OpenAI Model Inference integration account. Set exactly one method.
+ oneOf:
+ - $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountBearerTokenAuthUpdate"
+ OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest:
+ additionalProperties: false
+ description: >-
+ Bearer token authentication. Use a project-scoped OpenAI API key with Write permission for model capabilities. While `openai-llm-completions` is enabled, the API returns a `422` response for a key that cannot call the OpenAI chat completions endpoint.
+ properties:
+ auth_type:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountBearerTokenAuthType"
+ token:
+ description: Secret token used to authenticate with OpenAI.
+ example: your-token
+ type: string
+ writeOnly: true
+ required:
+ - auth_type
+ - token
+ type: object
+ OpenAIModelInferenceIntegrationAccountBearerTokenAuthResponse:
+ description: The bearer token authentication method configured on the account.
+ properties:
+ auth_type:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountBearerTokenAuthType"
+ required:
+ - auth_type
+ type: object
+ OpenAIModelInferenceIntegrationAccountBearerTokenAuthType:
+ default: bearer_token
+ description: The authentication method type.
+ enum:
+ - bearer_token
+ example: bearer_token
+ type: string
+ x-enum-varnames:
+ - BEARER_TOKEN
+ OpenAIModelInferenceIntegrationAccountBearerTokenAuthUpdate:
+ additionalProperties: false
+ description: >-
+ Bearer token authentication. Use a project-scoped OpenAI API key with Write permission for model capabilities. While `openai-llm-completions` is enabled, the API returns a `422` response for a key that cannot call the OpenAI chat completions endpoint. Only the provided fields are changed. To keep the stored token, omit `token`.
+ properties:
+ auth_type:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountBearerTokenAuthType"
+ token:
+ description: Secret token used to authenticate with OpenAI.
+ example: your-token
+ type: string
+ writeOnly: true
+ required:
+ - auth_type
+ type: object
+ OpenAIModelInferenceIntegrationAccountCreateAttributes:
+ description: Writable attributes used to create an OpenAI Model Inference integration account.
+ properties:
+ authentication:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountAuthenticationRequest"
+ dataflows:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationDataflowsRequest"
+ name:
+ description: Human-readable name of the OpenAI Model Inference integration account.
+ example: openai-model-inference-acme
+ type: string
+ settings:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountSettingsRequest"
+ required:
+ - name
+ - authentication
+ - settings
+ type: object
+ OpenAIModelInferenceIntegrationAccountCreateData:
+ description: Data envelope for creating an OpenAI Model Inference integration account.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountCreateAttributes"
+ type:
+ $ref: "#/components/schemas/IntegrationAccountType"
+ required:
+ - type
+ - attributes
+ type: object
+ OpenAIModelInferenceIntegrationAccountCreateRequest:
+ description: Request payload to create an OpenAI Model Inference integration account.
+ properties:
+ data:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountCreateData"
+ required:
+ - data
+ type: object
+ OpenAIModelInferenceIntegrationAccountResponse:
+ description: Response payload for a single OpenAI Model Inference integration account.
+ properties:
+ data:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountResponseData"
+ required:
+ - data
+ type: object
+ OpenAIModelInferenceIntegrationAccountResponseAttributes:
+ description: Attributes of an OpenAI Model Inference integration account returned in responses.
+ properties:
+ authentication:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountAuthenticationResponse"
+ dataflows:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationDataflowsResponse"
+ name:
+ description: Human-readable name of the OpenAI Model Inference integration account.
+ example: openai-model-inference-acme
+ type: string
+ settings:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountSettingsResponse"
+ required:
+ - name
+ - settings
+ type: object
+ OpenAIModelInferenceIntegrationAccountResponseData:
+ description: Data envelope of an OpenAI Model Inference integration account, including server-assigned identity.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountResponseAttributes"
+ id:
+ description: Server-generated unique identifier of the OpenAI Model Inference integration account.
+ example: 3f8b2c1d-6e4a-4b9f-8c2d-1a7e5b9c0f63
+ readOnly: true
+ type: string
+ type:
+ $ref: "#/components/schemas/IntegrationAccountType"
+ required:
+ - id
+ - attributes
+ - type
+ type: object
+ OpenAIModelInferenceIntegrationAccountSettingsRequest:
+ additionalProperties: false
+ description: Settings for creating the OpenAI Model Inference integration account.
+ properties:
+ custom_tags:
+ description: >-
+ Comma-separated list of custom tags applied to the data collected for this account, for example `team:ai,env:prod`.
+ example: team:ai,env:prod
+ type: string
+ type: object
+ OpenAIModelInferenceIntegrationAccountSettingsResponse:
+ description: Settings configured on the OpenAI Model Inference integration account.
+ properties:
+ custom_tags:
+ description: >-
+ Comma-separated list of custom tags applied to the data collected for this account, for example `team:ai,env:prod`.
+ example: team:ai,env:prod
+ type: string
+ type: object
+ OpenAIModelInferenceIntegrationAccountSettingsUpdate:
+ additionalProperties: false
+ description: >-
+ Settings for updating the OpenAI Model Inference integration account. Only the fields provided are changed.
+ properties:
+ custom_tags:
+ description: >-
+ Comma-separated list of custom tags applied to the data collected for this account, for example `team:ai,env:prod`.
+ example: team:ai,env:prod
+ type: string
+ type: object
+ OpenAIModelInferenceIntegrationAccountUpdateAttributes:
+ description: >-
+ Writable attributes used to update an OpenAI Model Inference integration account. Every field is optional. Only the provided fields are changed. When `dataflows` is provided, only the dataflow IDs in the request are modified. Dataflows omitted from the map keep their current configuration.
+ properties:
+ authentication:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountAuthenticationUpdate"
+ dataflows:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationDataflowsRequest"
+ name:
+ description: Human-readable name of the OpenAI Model Inference integration account.
+ example: openai-model-inference-acme
+ type: string
+ settings:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountSettingsUpdate"
+ type: object
+ OpenAIModelInferenceIntegrationAccountUpdateData:
+ description: Data envelope for updating an OpenAI Model Inference integration account.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountUpdateAttributes"
+ id:
+ description: Unique identifier of the OpenAI Model Inference integration account to update.
+ example: 3f8b2c1d-6e4a-4b9f-8c2d-1a7e5b9c0f63
+ type: string
+ type:
+ $ref: "#/components/schemas/IntegrationAccountType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ OpenAIModelInferenceIntegrationAccountUpdateRequest:
+ description: Request payload to update an OpenAI Model Inference integration account.
+ properties:
+ data:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountUpdateData"
+ required:
+ - data
+ type: object
+ OpenAIModelInferenceIntegrationAccountsResponse:
+ description: Response payload for a list of OpenAI Model Inference integration accounts.
+ properties:
+ data:
+ description: List of OpenAI Model Inference integration accounts.
+ items:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountResponseData"
+ type: array
+ required:
+ - data
+ type: object
+ OpenAIModelInferenceIntegrationDataflowsRequest:
+ additionalProperties: false
+ description: >-
+ Data Datadog collects from OpenAI Model Inference, keyed by dataflow ID. Each dataflow turns on a distinct type of collection. Set `enabled` to start or stop a dataflow. The default for each dataflow applies when the account is created. On update, omitted fields keep their current values.
+ properties:
+ openai-llm-completions:
+ $ref: "#/components/schemas/OpenAIModelInferenceLLMCompletionsIntegrationDataflowRequest"
+ openai-project-cloud-cost-data:
+ $ref: "#/components/schemas/OpenAIModelInferenceProjectCloudCostDataIntegrationDataflowRequest"
+ type: object
+ OpenAIModelInferenceIntegrationDataflowsResponse:
+ description: Data Datadog collects from OpenAI Model Inference, keyed by dataflow ID.
+ properties:
+ openai-llm-completions:
+ $ref: "#/components/schemas/OpenAIModelInferenceLLMCompletionsIntegrationDataflowResponse"
+ openai-project-cloud-cost-data:
+ $ref: "#/components/schemas/OpenAIModelInferenceProjectCloudCostDataIntegrationDataflowResponse"
+ type: object
+ OpenAIModelInferenceLLMCompletionsIntegrationDataflowRequest:
+ additionalProperties: false
+ description: >-
+ Makes the key in `authentication` available to run evaluations in [LLM Observability](https://docs.datadoghq.com/llm_observability/). While this dataflow is enabled, the API returns a `422` response for a key that cannot call the OpenAI chat completions endpoint.
+ properties:
+ enabled:
+ description: >-
+ Whether Datadog collects this data. Defaults to `true`. Set to `false` to stop collection.
+ example: true
+ type: boolean
+ type: object
+ OpenAIModelInferenceLLMCompletionsIntegrationDataflowResponse:
+ description: >-
+ Makes the key in `authentication` available to run evaluations in [LLM Observability](https://docs.datadoghq.com/llm_observability/).
+ properties:
+ enabled:
+ description: Whether Datadog collects this data.
+ example: true
+ type: boolean
+ status:
+ $ref: "#/components/schemas/IntegrationAccountDataflowStatus"
+ type: object
+ OpenAIModelInferenceProjectCloudCostDataIntegrationDataflowRequest:
+ additionalProperties: false
+ description: >-
+ Costs of the OpenAI project that owns the key in `authentication`. Analyze these costs in [Cloud Cost Management](https://docs.datadoghq.com/cloud_cost_management/). Cost data appears in Cloud Cost Management within 24 hours after you enable this dataflow.
+ properties:
+ enabled:
+ description: >-
+ Whether Datadog collects this data. Defaults to `false`. Set to `true` to start collection.
+ example: true
+ type: boolean
+ type: object
+ OpenAIModelInferenceProjectCloudCostDataIntegrationDataflowResponse:
+ description: >-
+ Costs of the OpenAI project that owns the key in `authentication`. Analyze these costs in [Cloud Cost Management](https://docs.datadoghq.com/cloud_cost_management/).
+ properties:
+ enabled:
+ description: Whether Datadog collects this data.
+ example: true
+ type: boolean
+ status:
+ $ref: "#/components/schemas/IntegrationAccountDataflowStatus"
+ type: object
OpenAPIEndpoint:
description: Endpoint info extracted from an `OpenAPI` specification.
properties:
@@ -211412,6 +211693,260 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/integration-interfaces/openai-model-inference/accounts:
+ get:
+ description: List OpenAI Model Inference integration accounts.
+ operationId: ListOpenAIModelInferenceIntegrationAccounts
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ authentication:
+ auth_type: bearer_token
+ dataflows:
+ openai-llm-completions:
+ enabled: true
+ status:
+ health: DATAFLOW_HEALTH_OK
+ updated_at: "2026-11-10T08:30:50Z"
+ openai-project-cloud-cost-data:
+ enabled: true
+ status:
+ health: DATAFLOW_HEALTH_OK
+ updated_at: "2026-11-10T08:30:50Z"
+ name: openai-model-inference-acme
+ settings:
+ custom_tags: team:ai,env:prod
+ id: 3f8b2c1d-6e4a-4b9f-8c2d-1a7e5b9c0f63
+ type: integration-account
+ schema:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountsResponse"
+ description: OK
+ "400":
+ $ref: "#/components/responses/IntegrationAccountBadRequestResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/IntegrationAccountNotFoundResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: List OpenAI Model Inference accounts
+ tags:
+ - OpenAI Model Inference Integration
+ "x-permission":
+ operator: OR
+ permissions:
+ - integrations_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ post:
+ description: Create an OpenAI Model Inference integration account.
+ operationId: CreateOpenAIModelInferenceIntegrationAccount
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountCreateRequest"
+ required: true
+ responses:
+ "201":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ authentication:
+ auth_type: bearer_token
+ dataflows:
+ openai-llm-completions:
+ enabled: true
+ status:
+ health: DATAFLOW_HEALTH_OK
+ updated_at: "2026-11-10T08:30:50Z"
+ openai-project-cloud-cost-data:
+ enabled: true
+ status:
+ health: DATAFLOW_HEALTH_OK
+ updated_at: "2026-11-10T08:30:50Z"
+ name: openai-model-inference-acme
+ settings:
+ custom_tags: team:ai,env:prod
+ id: 3f8b2c1d-6e4a-4b9f-8c2d-1a7e5b9c0f63
+ type: integration-account
+ schema:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountResponse"
+ description: Created
+ "400":
+ $ref: "#/components/responses/IntegrationAccountBadRequestResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/IntegrationAccountNotFoundResponse"
+ "422":
+ $ref: "#/components/responses/UnprocessableEntityResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Create an OpenAI Model Inference account
+ tags:
+ - OpenAI Model Inference Integration
+ x-codegen-request-body-name: body
+ "x-permission":
+ operator: OR
+ permissions:
+ - manage_integrations
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ /api/v2/integration-interfaces/openai-model-inference/accounts/{account_id}:
+ delete:
+ description: Delete an OpenAI Model Inference integration account.
+ operationId: DeleteOpenAIModelInferenceIntegrationAccount
+ parameters:
+ - $ref: "#/components/parameters/IntegrationAccountIdParameter"
+ responses:
+ "200":
+ description: OK
+ "400":
+ $ref: "#/components/responses/IntegrationAccountBadRequestResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/IntegrationAccountNotFoundResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Delete an OpenAI Model Inference account
+ tags:
+ - OpenAI Model Inference Integration
+ "x-permission":
+ operator: OR
+ permissions:
+ - manage_integrations
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ get:
+ description: Get an OpenAI Model Inference integration account.
+ operationId: GetOpenAIModelInferenceIntegrationAccount
+ parameters:
+ - $ref: "#/components/parameters/IntegrationAccountIdParameter"
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ authentication:
+ auth_type: bearer_token
+ dataflows:
+ openai-llm-completions:
+ enabled: true
+ status:
+ health: DATAFLOW_HEALTH_OK
+ updated_at: "2026-11-10T08:30:50Z"
+ openai-project-cloud-cost-data:
+ enabled: true
+ status:
+ health: DATAFLOW_HEALTH_OK
+ updated_at: "2026-11-10T08:30:50Z"
+ name: openai-model-inference-acme
+ settings:
+ custom_tags: team:ai,env:prod
+ id: 3f8b2c1d-6e4a-4b9f-8c2d-1a7e5b9c0f63
+ type: integration-account
+ schema:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountResponse"
+ description: OK
+ "400":
+ $ref: "#/components/responses/IntegrationAccountBadRequestResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/IntegrationAccountNotFoundResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Get an OpenAI Model Inference account
+ tags:
+ - OpenAI Model Inference Integration
+ "x-permission":
+ operator: OR
+ permissions:
+ - integrations_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
+ patch:
+ description: Update an OpenAI Model Inference integration account. Only the fields provided are changed.
+ operationId: UpdateOpenAIModelInferenceIntegrationAccount
+ parameters:
+ - $ref: "#/components/parameters/IntegrationAccountIdParameter"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountUpdateRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ authentication:
+ auth_type: bearer_token
+ dataflows:
+ openai-llm-completions:
+ enabled: true
+ status:
+ health: DATAFLOW_HEALTH_OK
+ updated_at: "2026-11-10T08:30:50Z"
+ openai-project-cloud-cost-data:
+ enabled: true
+ status:
+ health: DATAFLOW_HEALTH_OK
+ updated_at: "2026-11-10T08:30:50Z"
+ name: openai-model-inference-acme
+ settings:
+ custom_tags: team:ai,env:prod
+ id: 3f8b2c1d-6e4a-4b9f-8c2d-1a7e5b9c0f63
+ type: integration-account
+ schema:
+ $ref: "#/components/schemas/OpenAIModelInferenceIntegrationAccountResponse"
+ description: OK
+ "400":
+ $ref: "#/components/responses/IntegrationAccountBadRequestResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/IntegrationAccountNotFoundResponse"
+ "422":
+ $ref: "#/components/responses/UnprocessableEntityResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Update an OpenAI Model Inference account
+ tags:
+ - OpenAI Model Inference Integration
+ x-codegen-request-body-name: body
+ "x-permission":
+ operator: OR
+ permissions:
+ - manage_integrations
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/integration-interfaces/snowflake/accounts:
get:
description: List Snowflake integration accounts.
@@ -288844,6 +289379,15 @@ tags:
description: OpenAI Codex integration.
url: https://docs.datadoghq.com/integrations/openai-codex/
name: OpenAI Codex Integration
+ - description: |-
+ Manage your Datadog OpenAI Model Inference integration accounts and account resources
+ directly through the Datadog API. See the
+ [OpenAI integration page](https://docs.datadoghq.com/integrations/openai/) for
+ more information.
+ externalDocs:
+ description: OpenAI integration.
+ url: https://docs.datadoghq.com/integrations/openai/
+ name: OpenAI Model Inference Integration
- description: |-
Configure your [Datadog Opsgenie integration](https://docs.datadoghq.com/integrations/opsgenie/)
directly through the Datadog API.
diff --git a/examples/v2/openai-model-inference-integration/CreateOpenAIModelInferenceIntegrationAccount.java b/examples/v2/openai-model-inference-integration/CreateOpenAIModelInferenceIntegrationAccount.java
new file mode 100644
index 00000000000..7acc4f57b70
--- /dev/null
+++ b/examples/v2/openai-model-inference-integration/CreateOpenAIModelInferenceIntegrationAccount.java
@@ -0,0 +1,69 @@
+// Create an OpenAI Model Inference account returns "Created" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.OpenAiModelInferenceIntegrationApi;
+import com.datadog.api.client.v2.model.IntegrationAccountType;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountAuthenticationRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountBearerTokenAuthType;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountCreateAttributes;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountCreateData;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountCreateRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountResponse;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountSettingsRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationDataflowsRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceLLMCompletionsIntegrationDataflowRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceProjectCloudCostDataIntegrationDataflowRequest;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ defaultClient.setUnstableOperationEnabled(
+ "v2.createOpenAIModelInferenceIntegrationAccount", true);
+ OpenAiModelInferenceIntegrationApi apiInstance =
+ new OpenAiModelInferenceIntegrationApi(defaultClient);
+
+ OpenAIModelInferenceIntegrationAccountCreateRequest body =
+ new OpenAIModelInferenceIntegrationAccountCreateRequest()
+ .data(
+ new OpenAIModelInferenceIntegrationAccountCreateData()
+ .attributes(
+ new OpenAIModelInferenceIntegrationAccountCreateAttributes()
+ .authentication(
+ new OpenAIModelInferenceIntegrationAccountAuthenticationRequest(
+ new OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest()
+ .authType(
+ OpenAIModelInferenceIntegrationAccountBearerTokenAuthType
+ .BEARER_TOKEN)
+ .token("your-token")))
+ .dataflows(
+ new OpenAIModelInferenceIntegrationDataflowsRequest()
+ .openaiLlmCompletions(
+ new OpenAIModelInferenceLLMCompletionsIntegrationDataflowRequest()
+ .enabled(true))
+ .openaiProjectCloudCostData(
+ new OpenAIModelInferenceProjectCloudCostDataIntegrationDataflowRequest()
+ .enabled(true)))
+ .name("openai-model-inference-acme")
+ .settings(
+ new OpenAIModelInferenceIntegrationAccountSettingsRequest()
+ .customTags("team:ai,env:prod")))
+ .type(IntegrationAccountType.INTEGRATION_ACCOUNT));
+
+ try {
+ OpenAIModelInferenceIntegrationAccountResponse result =
+ apiInstance.createOpenAIModelInferenceIntegrationAccount(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling"
+ + " OpenAiModelInferenceIntegrationApi#createOpenAIModelInferenceIntegrationAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/openai-model-inference-integration/DeleteOpenAIModelInferenceIntegrationAccount.java b/examples/v2/openai-model-inference-integration/DeleteOpenAIModelInferenceIntegrationAccount.java
new file mode 100644
index 00000000000..be196994c9a
--- /dev/null
+++ b/examples/v2/openai-model-inference-integration/DeleteOpenAIModelInferenceIntegrationAccount.java
@@ -0,0 +1,28 @@
+// Delete an OpenAI Model Inference account returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.OpenAiModelInferenceIntegrationApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ defaultClient.setUnstableOperationEnabled(
+ "v2.deleteOpenAIModelInferenceIntegrationAccount", true);
+ OpenAiModelInferenceIntegrationApi apiInstance =
+ new OpenAiModelInferenceIntegrationApi(defaultClient);
+
+ try {
+ apiInstance.deleteOpenAIModelInferenceIntegrationAccount("account_id");
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling"
+ + " OpenAiModelInferenceIntegrationApi#deleteOpenAIModelInferenceIntegrationAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/openai-model-inference-integration/GetOpenAIModelInferenceIntegrationAccount.java b/examples/v2/openai-model-inference-integration/GetOpenAIModelInferenceIntegrationAccount.java
new file mode 100644
index 00000000000..20f7986c740
--- /dev/null
+++ b/examples/v2/openai-model-inference-integration/GetOpenAIModelInferenceIntegrationAccount.java
@@ -0,0 +1,30 @@
+// Get an OpenAI Model Inference account returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.OpenAiModelInferenceIntegrationApi;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ defaultClient.setUnstableOperationEnabled("v2.getOpenAIModelInferenceIntegrationAccount", true);
+ OpenAiModelInferenceIntegrationApi apiInstance =
+ new OpenAiModelInferenceIntegrationApi(defaultClient);
+
+ try {
+ OpenAIModelInferenceIntegrationAccountResponse result =
+ apiInstance.getOpenAIModelInferenceIntegrationAccount("account_id");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling"
+ + " OpenAiModelInferenceIntegrationApi#getOpenAIModelInferenceIntegrationAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/openai-model-inference-integration/ListOpenAIModelInferenceIntegrationAccounts.java b/examples/v2/openai-model-inference-integration/ListOpenAIModelInferenceIntegrationAccounts.java
new file mode 100644
index 00000000000..6feec31a2b6
--- /dev/null
+++ b/examples/v2/openai-model-inference-integration/ListOpenAIModelInferenceIntegrationAccounts.java
@@ -0,0 +1,31 @@
+// List OpenAI Model Inference accounts returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.OpenAiModelInferenceIntegrationApi;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ defaultClient.setUnstableOperationEnabled(
+ "v2.listOpenAIModelInferenceIntegrationAccounts", true);
+ OpenAiModelInferenceIntegrationApi apiInstance =
+ new OpenAiModelInferenceIntegrationApi(defaultClient);
+
+ try {
+ OpenAIModelInferenceIntegrationAccountsResponse result =
+ apiInstance.listOpenAIModelInferenceIntegrationAccounts();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling"
+ + " OpenAiModelInferenceIntegrationApi#listOpenAIModelInferenceIntegrationAccounts");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/openai-model-inference-integration/UpdateOpenAIModelInferenceIntegrationAccount.java b/examples/v2/openai-model-inference-integration/UpdateOpenAIModelInferenceIntegrationAccount.java
new file mode 100644
index 00000000000..6850955b333
--- /dev/null
+++ b/examples/v2/openai-model-inference-integration/UpdateOpenAIModelInferenceIntegrationAccount.java
@@ -0,0 +1,70 @@
+// Update an OpenAI Model Inference account returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.OpenAiModelInferenceIntegrationApi;
+import com.datadog.api.client.v2.model.IntegrationAccountType;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountAuthenticationUpdate;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountBearerTokenAuthType;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountBearerTokenAuthUpdate;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountResponse;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountSettingsUpdate;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountUpdateAttributes;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountUpdateData;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountUpdateRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationDataflowsRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceLLMCompletionsIntegrationDataflowRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceProjectCloudCostDataIntegrationDataflowRequest;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ defaultClient.setUnstableOperationEnabled(
+ "v2.updateOpenAIModelInferenceIntegrationAccount", true);
+ OpenAiModelInferenceIntegrationApi apiInstance =
+ new OpenAiModelInferenceIntegrationApi(defaultClient);
+
+ OpenAIModelInferenceIntegrationAccountUpdateRequest body =
+ new OpenAIModelInferenceIntegrationAccountUpdateRequest()
+ .data(
+ new OpenAIModelInferenceIntegrationAccountUpdateData()
+ .attributes(
+ new OpenAIModelInferenceIntegrationAccountUpdateAttributes()
+ .authentication(
+ new OpenAIModelInferenceIntegrationAccountAuthenticationUpdate(
+ new OpenAIModelInferenceIntegrationAccountBearerTokenAuthUpdate()
+ .authType(
+ OpenAIModelInferenceIntegrationAccountBearerTokenAuthType
+ .BEARER_TOKEN)
+ .token("your-token")))
+ .dataflows(
+ new OpenAIModelInferenceIntegrationDataflowsRequest()
+ .openaiLlmCompletions(
+ new OpenAIModelInferenceLLMCompletionsIntegrationDataflowRequest()
+ .enabled(true))
+ .openaiProjectCloudCostData(
+ new OpenAIModelInferenceProjectCloudCostDataIntegrationDataflowRequest()
+ .enabled(true)))
+ .name("openai-model-inference-acme")
+ .settings(
+ new OpenAIModelInferenceIntegrationAccountSettingsUpdate()
+ .customTags("team:ai,env:prod")))
+ .id("3f8b2c1d-6e4a-4b9f-8c2d-1a7e5b9c0f63")
+ .type(IntegrationAccountType.INTEGRATION_ACCOUNT));
+
+ try {
+ OpenAIModelInferenceIntegrationAccountResponse result =
+ apiInstance.updateOpenAIModelInferenceIntegrationAccount("account_id", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling"
+ + " OpenAiModelInferenceIntegrationApi#updateOpenAIModelInferenceIntegrationAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java
index 5044cdd7ee4..5c95b027589 100644
--- a/src/main/java/com/datadog/api/client/ApiClient.java
+++ b/src/main/java/com/datadog/api/client/ApiClient.java
@@ -1586,6 +1586,11 @@ public class ApiClient {
put("v2.getOpenAICodexIntegrationAccount", false);
put("v2.listOpenAICodexIntegrationAccounts", false);
put("v2.updateOpenAICodexIntegrationAccount", false);
+ put("v2.createOpenAIModelInferenceIntegrationAccount", false);
+ put("v2.deleteOpenAIModelInferenceIntegrationAccount", false);
+ put("v2.getOpenAIModelInferenceIntegrationAccount", false);
+ put("v2.listOpenAIModelInferenceIntegrationAccounts", false);
+ put("v2.updateOpenAIModelInferenceIntegrationAccount", false);
put("v2.createSnowflakeIntegrationAccount", false);
put("v2.deleteSnowflakeIntegrationAccount", false);
put("v2.getSnowflakeIntegrationAccount", false);
diff --git a/src/main/java/com/datadog/api/client/v2/api/OpenAiModelInferenceIntegrationApi.java b/src/main/java/com/datadog/api/client/v2/api/OpenAiModelInferenceIntegrationApi.java
new file mode 100644
index 00000000000..b6daa492d2d
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/api/OpenAiModelInferenceIntegrationApi.java
@@ -0,0 +1,861 @@
+package com.datadog.api.client.v2.api;
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.ApiResponse;
+import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountCreateRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountResponse;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountUpdateRequest;
+import com.datadog.api.client.v2.model.OpenAIModelInferenceIntegrationAccountsResponse;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.core.GenericType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpenAiModelInferenceIntegrationApi {
+ private ApiClient apiClient;
+
+ public OpenAiModelInferenceIntegrationApi() {
+ this(ApiClient.getDefaultApiClient());
+ }
+
+ public OpenAiModelInferenceIntegrationApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the API client.
+ *
+ * @return API client
+ */
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ /**
+ * Set the API client.
+ *
+ * @param apiClient an instance of API client
+ */
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Create an OpenAI Model Inference account.
+ *
+ *
See {@link #createOpenAIModelInferenceIntegrationAccountWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return OpenAIModelInferenceIntegrationAccountResponse
+ * @throws ApiException if fails to make API call
+ */
+ public OpenAIModelInferenceIntegrationAccountResponse
+ createOpenAIModelInferenceIntegrationAccount(
+ OpenAIModelInferenceIntegrationAccountCreateRequest body) throws ApiException {
+ return createOpenAIModelInferenceIntegrationAccountWithHttpInfo(body).getData();
+ }
+
+ /**
+ * Create an OpenAI Model Inference account.
+ *
+ *
See {@link #createOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<OpenAIModelInferenceIntegrationAccountResponse>
+ */
+ public CompletableFuture
+ createOpenAIModelInferenceIntegrationAccountAsync(
+ OpenAIModelInferenceIntegrationAccountCreateRequest body) {
+ return createOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Create an OpenAI Model Inference integration account.
+ *
+ * @param body (required)
+ * @return ApiResponse<OpenAIModelInferenceIntegrationAccountResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 201 | Created | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 422 | The server cannot process the request because it contains invalid data. | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse
+ createOpenAIModelInferenceIntegrationAccountWithHttpInfo(
+ OpenAIModelInferenceIntegrationAccountCreateRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "createOpenAIModelInferenceIntegrationAccount";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " createOpenAIModelInferenceIntegrationAccount");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/integration-interfaces/openai-model-inference/accounts";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.createOpenAIModelInferenceIntegrationAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Create an OpenAI Model Inference account.
+ *
+ * See {@link #createOpenAIModelInferenceIntegrationAccountWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return
+ * CompletableFuture<ApiResponse<OpenAIModelInferenceIntegrationAccountResponse>>
+ */
+ public CompletableFuture>
+ createOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync(
+ OpenAIModelInferenceIntegrationAccountCreateRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "createOpenAIModelInferenceIntegrationAccount";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " createOpenAIModelInferenceIntegrationAccount"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/integration-interfaces/openai-model-inference/accounts";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.createOpenAIModelInferenceIntegrationAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Delete an OpenAI Model Inference account.
+ *
+ * See {@link #deleteOpenAIModelInferenceIntegrationAccountWithHttpInfo}.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteOpenAIModelInferenceIntegrationAccount(String accountId) throws ApiException {
+ deleteOpenAIModelInferenceIntegrationAccountWithHttpInfo(accountId);
+ }
+
+ /**
+ * Delete an OpenAI Model Inference account.
+ *
+ *
See {@link #deleteOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync}.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteOpenAIModelInferenceIntegrationAccountAsync(
+ String accountId) {
+ return deleteOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync(accountId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Delete an OpenAI Model Inference integration account.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse deleteOpenAIModelInferenceIntegrationAccountWithHttpInfo(
+ String accountId) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "deleteOpenAIModelInferenceIntegrationAccount";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'accountId' when calling"
+ + " deleteOpenAIModelInferenceIntegrationAccount");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration-interfaces/openai-model-inference/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.deleteOpenAIModelInferenceIntegrationAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete an OpenAI Model Inference account.
+ *
+ * See {@link #deleteOpenAIModelInferenceIntegrationAccountWithHttpInfo}.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture>
+ deleteOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync(String accountId) {
+ // Check if unstable operation is enabled
+ String operationId = "deleteOpenAIModelInferenceIntegrationAccount";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'accountId' when calling"
+ + " deleteOpenAIModelInferenceIntegrationAccount"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration-interfaces/openai-model-inference/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.deleteOpenAIModelInferenceIntegrationAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Get an OpenAI Model Inference account.
+ *
+ * See {@link #getOpenAIModelInferenceIntegrationAccountWithHttpInfo}.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @return OpenAIModelInferenceIntegrationAccountResponse
+ * @throws ApiException if fails to make API call
+ */
+ public OpenAIModelInferenceIntegrationAccountResponse getOpenAIModelInferenceIntegrationAccount(
+ String accountId) throws ApiException {
+ return getOpenAIModelInferenceIntegrationAccountWithHttpInfo(accountId).getData();
+ }
+
+ /**
+ * Get an OpenAI Model Inference account.
+ *
+ *
See {@link #getOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync}.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @return CompletableFuture<OpenAIModelInferenceIntegrationAccountResponse>
+ */
+ public CompletableFuture
+ getOpenAIModelInferenceIntegrationAccountAsync(String accountId) {
+ return getOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync(accountId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Get an OpenAI Model Inference integration account.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @return ApiResponse<OpenAIModelInferenceIntegrationAccountResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse
+ getOpenAIModelInferenceIntegrationAccountWithHttpInfo(String accountId) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "getOpenAIModelInferenceIntegrationAccount";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'accountId' when calling"
+ + " getOpenAIModelInferenceIntegrationAccount");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration-interfaces/openai-model-inference/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.getOpenAIModelInferenceIntegrationAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get an OpenAI Model Inference account.
+ *
+ * See {@link #getOpenAIModelInferenceIntegrationAccountWithHttpInfo}.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @return
+ * CompletableFuture<ApiResponse<OpenAIModelInferenceIntegrationAccountResponse>>
+ */
+ public CompletableFuture>
+ getOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync(String accountId) {
+ // Check if unstable operation is enabled
+ String operationId = "getOpenAIModelInferenceIntegrationAccount";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'accountId' when calling"
+ + " getOpenAIModelInferenceIntegrationAccount"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration-interfaces/openai-model-inference/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.getOpenAIModelInferenceIntegrationAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List OpenAI Model Inference accounts.
+ *
+ * See {@link #listOpenAIModelInferenceIntegrationAccountsWithHttpInfo}.
+ *
+ * @return OpenAIModelInferenceIntegrationAccountsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public OpenAIModelInferenceIntegrationAccountsResponse
+ listOpenAIModelInferenceIntegrationAccounts() throws ApiException {
+ return listOpenAIModelInferenceIntegrationAccountsWithHttpInfo().getData();
+ }
+
+ /**
+ * List OpenAI Model Inference accounts.
+ *
+ *
See {@link #listOpenAIModelInferenceIntegrationAccountsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<OpenAIModelInferenceIntegrationAccountsResponse>
+ */
+ public CompletableFuture
+ listOpenAIModelInferenceIntegrationAccountsAsync() {
+ return listOpenAIModelInferenceIntegrationAccountsWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List OpenAI Model Inference integration accounts.
+ *
+ * @return ApiResponse<OpenAIModelInferenceIntegrationAccountsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse
+ listOpenAIModelInferenceIntegrationAccountsWithHttpInfo() throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listOpenAIModelInferenceIntegrationAccounts";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/integration-interfaces/openai-model-inference/accounts";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.listOpenAIModelInferenceIntegrationAccounts",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List OpenAI Model Inference accounts.
+ *
+ * See {@link #listOpenAIModelInferenceIntegrationAccountsWithHttpInfo}.
+ *
+ * @return
+ * CompletableFuture<ApiResponse<OpenAIModelInferenceIntegrationAccountsResponse>>
+ */
+ public CompletableFuture>
+ listOpenAIModelInferenceIntegrationAccountsWithHttpInfoAsync() {
+ // Check if unstable operation is enabled
+ String operationId = "listOpenAIModelInferenceIntegrationAccounts";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/integration-interfaces/openai-model-inference/accounts";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.listOpenAIModelInferenceIntegrationAccounts",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update an OpenAI Model Inference account.
+ *
+ * See {@link #updateOpenAIModelInferenceIntegrationAccountWithHttpInfo}.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @param body (required)
+ * @return OpenAIModelInferenceIntegrationAccountResponse
+ * @throws ApiException if fails to make API call
+ */
+ public OpenAIModelInferenceIntegrationAccountResponse
+ updateOpenAIModelInferenceIntegrationAccount(
+ String accountId, OpenAIModelInferenceIntegrationAccountUpdateRequest body)
+ throws ApiException {
+ return updateOpenAIModelInferenceIntegrationAccountWithHttpInfo(accountId, body).getData();
+ }
+
+ /**
+ * Update an OpenAI Model Inference account.
+ *
+ *
See {@link #updateOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync}.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @param body (required)
+ * @return CompletableFuture<OpenAIModelInferenceIntegrationAccountResponse>
+ */
+ public CompletableFuture
+ updateOpenAIModelInferenceIntegrationAccountAsync(
+ String accountId, OpenAIModelInferenceIntegrationAccountUpdateRequest body) {
+ return updateOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync(accountId, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Update an OpenAI Model Inference integration account. Only the fields provided are changed.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @param body (required)
+ * @return ApiResponse<OpenAIModelInferenceIntegrationAccountResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 422 | The server cannot process the request because it contains invalid data. | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse
+ updateOpenAIModelInferenceIntegrationAccountWithHttpInfo(
+ String accountId, OpenAIModelInferenceIntegrationAccountUpdateRequest body)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "updateOpenAIModelInferenceIntegrationAccount";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'accountId' when calling"
+ + " updateOpenAIModelInferenceIntegrationAccount");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " updateOpenAIModelInferenceIntegrationAccount");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration-interfaces/openai-model-inference/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.updateOpenAIModelInferenceIntegrationAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update an OpenAI Model Inference account.
+ *
+ * See {@link #updateOpenAIModelInferenceIntegrationAccountWithHttpInfo}.
+ *
+ * @param accountId Unique identifier of the integration account. (required)
+ * @param body (required)
+ * @return
+ * CompletableFuture<ApiResponse<OpenAIModelInferenceIntegrationAccountResponse>>
+ */
+ public CompletableFuture>
+ updateOpenAIModelInferenceIntegrationAccountWithHttpInfoAsync(
+ String accountId, OpenAIModelInferenceIntegrationAccountUpdateRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "updateOpenAIModelInferenceIntegrationAccount";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'accountId' when calling"
+ + " updateOpenAIModelInferenceIntegrationAccount"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " updateOpenAIModelInferenceIntegrationAccount"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration-interfaces/openai-model-inference/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.OpenAiModelInferenceIntegrationApi.updateOpenAIModelInferenceIntegrationAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpenAIModelInferenceIntegrationAccountAuthenticationRequest.java b/src/main/java/com/datadog/api/client/v2/model/OpenAIModelInferenceIntegrationAccountAuthenticationRequest.java
new file mode 100644
index 00000000000..4cf0af7bd6b
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpenAIModelInferenceIntegrationAccountAuthenticationRequest.java
@@ -0,0 +1,260 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.datadog.api.client.AbstractOpenApiSchema;
+import com.datadog.api.client.JSON;
+import com.datadog.api.client.UnparsedObject;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.MapperFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import jakarta.ws.rs.core.GenericType;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+@JsonDeserialize(
+ using =
+ OpenAIModelInferenceIntegrationAccountAuthenticationRequest
+ .OpenAIModelInferenceIntegrationAccountAuthenticationRequestDeserializer.class)
+@JsonSerialize(
+ using =
+ OpenAIModelInferenceIntegrationAccountAuthenticationRequest
+ .OpenAIModelInferenceIntegrationAccountAuthenticationRequestSerializer.class)
+public class OpenAIModelInferenceIntegrationAccountAuthenticationRequest
+ extends AbstractOpenApiSchema {
+ private static final Logger log =
+ Logger.getLogger(OpenAIModelInferenceIntegrationAccountAuthenticationRequest.class.getName());
+
+ @JsonIgnore public boolean unparsed = false;
+
+ public static class OpenAIModelInferenceIntegrationAccountAuthenticationRequestSerializer
+ extends StdSerializer {
+ public OpenAIModelInferenceIntegrationAccountAuthenticationRequestSerializer(
+ Class t) {
+ super(t);
+ }
+
+ public OpenAIModelInferenceIntegrationAccountAuthenticationRequestSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ OpenAIModelInferenceIntegrationAccountAuthenticationRequest value,
+ JsonGenerator jgen,
+ SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.getActualInstance());
+ }
+ }
+
+ public static class OpenAIModelInferenceIntegrationAccountAuthenticationRequestDeserializer
+ extends StdDeserializer {
+ public OpenAIModelInferenceIntegrationAccountAuthenticationRequestDeserializer() {
+ this(OpenAIModelInferenceIntegrationAccountAuthenticationRequest.class);
+ }
+
+ public OpenAIModelInferenceIntegrationAccountAuthenticationRequestDeserializer(Class> vc) {
+ super(vc);
+ }
+
+ @Override
+ public OpenAIModelInferenceIntegrationAccountAuthenticationRequest deserialize(
+ JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
+ JsonNode tree = jp.readValueAsTree();
+ Object deserialized = null;
+ Object tmp = null;
+ boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
+ int match = 0;
+ JsonToken token = tree.traverse(jp.getCodec()).nextToken();
+ // deserialize OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest
+ try {
+ boolean attemptParsing = true;
+ // ensure that we respect type coercion as set on the client ObjectMapper
+ if (OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(Integer.class)
+ || OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(Long.class)
+ || OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(
+ Float.class)
+ || OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(
+ Double.class)
+ || OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(
+ Boolean.class)
+ || OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(
+ String.class)) {
+ attemptParsing = typeCoercion;
+ if (!attemptParsing) {
+ attemptParsing |=
+ ((OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(
+ Integer.class)
+ || OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class
+ .equals(Long.class))
+ && token == JsonToken.VALUE_NUMBER_INT);
+ attemptParsing |=
+ ((OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(
+ Float.class)
+ || OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class
+ .equals(Double.class))
+ && (token == JsonToken.VALUE_NUMBER_FLOAT
+ || token == JsonToken.VALUE_NUMBER_INT));
+ attemptParsing |=
+ (OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(
+ Boolean.class)
+ && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
+ attemptParsing |=
+ (OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class.equals(
+ String.class)
+ && token == JsonToken.VALUE_STRING);
+ }
+ }
+ if (attemptParsing) {
+ tmp =
+ tree.traverse(jp.getCodec())
+ .readValueAs(OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest.class);
+ // TODO: there is no validation against JSON schema constraints
+ // (min, max, enum, pattern...), this does not perform a strict JSON
+ // validation, which means the 'match' count may be higher than it should be.
+ if (!((OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest) tmp).unparsed) {
+ deserialized = tmp;
+ match++;
+ }
+ log.log(
+ Level.FINER,
+ "Input data matches schema"
+ + " 'OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest'");
+ }
+ } catch (Exception e) {
+ // deserialization failed, continue
+ log.log(
+ Level.FINER,
+ "Input data does not match schema"
+ + " 'OpenAIModelInferenceIntegrationAccountBearerTokenAuthRequest'",
+ e);
+ }
+
+ OpenAIModelInferenceIntegrationAccountAuthenticationRequest ret =
+ new OpenAIModelInferenceIntegrationAccountAuthenticationRequest();
+ if (match == 1) {
+ ret.setActualInstance(deserialized);
+ } else {
+ Map res =
+ new ObjectMapper()
+ .readValue(
+ tree.traverse(jp.getCodec()).readValueAsTree().toString(),
+ new TypeReference