From 551ad61b4ebd2bc44f082f03ab70d472d71b6226 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 27 May 2026 21:04:46 +0000 Subject: [PATCH] Regenerate client from commit 8292e96 of spec repo --- .generator/schemas/v2/openapi.yaml | 708 +++++------------- .../ListCostTagMetadataMonths.java | 25 + .../DeleteScopesRestriction.java | 24 - .../GetScopesRestriction.java | 27 - .../RegisterOAuthClient.java | 47 -- .../UpsertScopesRestriction.java | 44 -- .../com/datadog/api/client/ApiClient.java | 5 +- .../client/v2/api/CloudCostManagementApi.java | 180 +++++ .../client/v2/api/OAuth2ClientPublicApi.java | 695 ----------------- ...ionData.java => CostTagMetadataMonth.java} | 78 +- ...ype.java => CostTagMetadataMonthType.java} | 28 +- ...ava => CostTagMetadataMonthsResponse.java} | 54 +- .../model/OAuthClientRegistrationError.java | 176 ----- .../OAuthClientRegistrationGrantType.java | 60 -- .../model/OAuthClientRegistrationRequest.java | 465 ------------ .../OAuthClientRegistrationResponse.java | 325 -------- .../OAuthClientRegistrationResponseType.java | 58 -- .../api/client/v2/model/OAuthOidcScope.java | 57 -- .../v2/model/OAuthScopesRestriction.java | 188 ----- .../model/OAuthScopesRestrictionResponse.java | 148 ---- ...thScopesRestrictionResponseAttributes.java | 204 ----- .../OAuthScopesRestrictionResponseData.java | 213 ------ ...vabilityPipelineConfigDestinationItem.java | 96 ++- ...tyPipelineSplunkHecMetricsDestination.java | 499 ++++++++++++ ...plunkHecMetricsDestinationCompression.java | 66 ++ ...pelineSplunkHecMetricsDestinationType.java | 63 ++ ...tOAuthScopesRestrictionDataAttributes.java | 192 ----- .../UpsertOAuthScopesRestrictionType.java | 58 -- .../v2/api/cloud_cost_management.feature | 16 + .../v2/api/oauth2_client_public.feature | 100 --- .../com/datadog/api/client/v2/api/undo.json | 30 +- 31 files changed, 1206 insertions(+), 3723 deletions(-) create mode 100644 examples/v2/cloud-cost-management/ListCostTagMetadataMonths.java delete mode 100644 examples/v2/oauth2-client-public/DeleteScopesRestriction.java delete mode 100644 examples/v2/oauth2-client-public/GetScopesRestriction.java delete mode 100644 examples/v2/oauth2-client-public/RegisterOAuthClient.java delete mode 100644 examples/v2/oauth2-client-public/UpsertScopesRestriction.java delete mode 100644 src/main/java/com/datadog/api/client/v2/api/OAuth2ClientPublicApi.java rename src/main/java/com/datadog/api/client/v2/model/{UpsertOAuthScopesRestrictionData.java => CostTagMetadataMonth.java} (59%) rename src/main/java/com/datadog/api/client/v2/model/{OAuthScopesRestrictionType.java => CostTagMetadataMonthType.java} (53%) rename src/main/java/com/datadog/api/client/v2/model/{UpsertOAuthScopesRestrictionRequest.java => CostTagMetadataMonthsResponse.java} (69%) delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationError.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationGrantType.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationRequest.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponse.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponseType.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthOidcScope.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestriction.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponse.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseAttributes.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestination.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestinationCompression.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestinationType.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionDataAttributes.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionType.java delete mode 100644 src/test/resources/com/datadog/api/client/v2/api/oauth2_client_public.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 453a74bab79..4afc8ca399d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1026,15 +1026,6 @@ components: required: true schema: type: string - OAuthClientUUIDPathParameter: - description: UUID of the OAuth2 client. - in: path - name: client_uuid - required: true - schema: - example: fafa8e1c-36a5-11f0-a83d-da7ad0900001 - format: uuid - type: string OnDemandTaskId: description: The UUID of the task. example: "6d09294c-9ad9-42fd-a759-a0c1599b4828" @@ -19906,6 +19897,45 @@ components: x-enum-varnames: - "TRUE" - "FALSE" + CostTagMetadataMonth: + description: A month that has Cloud Cost Management tag metadata available for a given provider. + properties: + id: + description: The month, in `YYYY-MM` format. + example: "2026-04" + type: string + type: + $ref: "#/components/schemas/CostTagMetadataMonthType" + required: + - id + - type + type: object + CostTagMetadataMonthType: + default: cost_tag_metadata_month + description: Type of the Cloud Cost Management tag metadata month resource. + enum: + - cost_tag_metadata_month + example: cost_tag_metadata_month + type: string + x-enum-varnames: + - COST_TAG_METADATA_MONTH + CostTagMetadataMonthsResponse: + description: List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months. + example: + data: + - id: "2026-04" + type: cost_tag_metadata_month + - id: "2026-03" + type: cost_tag_metadata_month + properties: + data: + description: List of months that have tag metadata available. + items: + $ref: "#/components/schemas/CostTagMetadataMonth" + type: array + required: + - data + type: object CostTagType: default: cost_tag description: Type of the Cloud Cost Management tag resource. @@ -54605,256 +54635,6 @@ components: - id - type type: object - OAuthClientRegistrationError: - description: Error payload returned by OAuth2 dynamic client registration as defined by RFC 7591. - properties: - error: - description: Single ASCII error code per RFC 7591, such as `invalid_request` or `invalid_client_metadata`. - example: invalid_client_metadata - type: string - error_description: - description: Human-readable description of the error. - example: redirect URI is not well-formed - type: string - required: - - error - - error_description - type: object - OAuthClientRegistrationGrantType: - description: OAuth 2.0 grant type that a registered client may use. - enum: - - authorization_code - - refresh_token - example: authorization_code - type: string - x-enum-varnames: - - AUTHORIZATION_CODE - - REFRESH_TOKEN - OAuthClientRegistrationRequest: - description: Request payload for OAuth2 dynamic client registration as defined by RFC 7591. - properties: - client_name: - description: Human-readable name of the client. Control characters are rejected. - example: Example MCP Client - maxLength: 1000 - type: string - client_uri: - description: URL of the home page of the client. - example: https://example.com - maxLength: 1000 - type: string - grant_types: - description: |- - OAuth 2.0 grant types the client may use. - Defaults to `authorization_code` and `refresh_token` when omitted. - example: - - authorization_code - - refresh_token - items: - $ref: "#/components/schemas/OAuthClientRegistrationGrantType" - type: array - jwks_uri: - description: URL referencing the client's JSON Web Key Set. - example: https://example.com/.well-known/jwks.json - maxLength: 1000 - type: string - logo_uri: - description: URL referencing a logo for the client. - example: https://example.com/logo.png - maxLength: 1000 - type: string - policy_uri: - description: URL pointing to the client's privacy policy. - example: https://example.com/privacy - maxLength: 1000 - type: string - redirect_uris: - description: Array of redirection URI strings used by the client in redirect-based flows. - example: - - https://example.com/oauth/callback - items: - description: Redirection URI registered for the client. - example: https://example.com/oauth/callback - maxLength: 1000 - type: string - type: array - response_types: - description: OAuth 2.0 response types the client may use. Only `code` is supported. - example: - - code - items: - $ref: "#/components/schemas/OAuthClientRegistrationResponseType" - type: array - scope: - description: Space-separated list of scope values the client may request. - example: openid profile - maxLength: 1000 - type: string - token_endpoint_auth_method: - description: Requested authentication method for the token endpoint. Only `none` is supported. - example: none - maxLength: 20 - type: string - tos_uri: - description: URL pointing to the client's terms of service. - example: https://example.com/tos - maxLength: 1000 - type: string - required: - - client_name - - redirect_uris - type: object - OAuthClientRegistrationResponse: - description: Response payload for a successful OAuth2 dynamic client registration as defined by RFC 7591. - properties: - client_id: - description: Unique identifier assigned to the registered client. - example: 72b68208-36a6-11f0-b21b-da7ad0900002 - format: uuid - type: string - client_name: - description: Human-readable name of the client. - example: Example MCP Client - type: string - grant_types: - description: OAuth 2.0 grant types registered for the client. - example: - - authorization_code - - refresh_token - items: - $ref: "#/components/schemas/OAuthClientRegistrationGrantType" - type: array - redirect_uris: - description: Redirection URIs registered for the client. - example: - - https://example.com/oauth/callback - items: - description: Redirection URI registered for the client. - example: https://example.com/oauth/callback - type: string - type: array - response_types: - description: OAuth 2.0 response types registered for the client. - example: - - code - items: - $ref: "#/components/schemas/OAuthClientRegistrationResponseType" - type: array - token_endpoint_auth_method: - description: Authentication method registered for the token endpoint. Always `none`. - example: none - type: string - required: - - client_id - - client_name - - redirect_uris - - token_endpoint_auth_method - - grant_types - - response_types - type: object - OAuthClientRegistrationResponseType: - description: OAuth 2.0 response type that a registered client may use. - enum: - - code - example: code - type: string - x-enum-varnames: - - CODE - OAuthOidcScope: - description: OIDC scope a client may be restricted to. - enum: - - openid - - profile - - email - - offline_access - example: openid - type: string - x-enum-varnames: - - OPENID - - PROFILE - - EMAIL - - OFFLINE_ACCESS - OAuthScopesRestriction: - description: Allowlist of OIDC and permission scopes enforced for the OAuth2 client. - nullable: true - properties: - oidc_scopes: - description: OIDC scopes the client is restricted to. - example: - - openid - - email - items: - $ref: "#/components/schemas/OAuthOidcScope" - type: array - permission_scopes: - description: Datadog permission scopes the client is restricted to. - example: - - dashboards_read - - metrics_read - items: - description: Datadog permission scope name. - example: dashboards_read - type: string - type: array - required: - - oidc_scopes - - permission_scopes - type: object - OAuthScopesRestrictionResponse: - description: Response payload describing the scopes restriction of an OAuth2 client. - properties: - data: - $ref: "#/components/schemas/OAuthScopesRestrictionResponseData" - required: - - data - type: object - OAuthScopesRestrictionResponseAttributes: - description: Attributes of an OAuth2 client scopes restriction. - properties: - required_permission_scopes: - description: |- - Permission scopes automatically required for this client (for example, mobile-app permission scopes). - Returns `null` when no scopes are required. - example: - - mobile_app_access - items: - description: Datadog permission scope name. - example: mobile_app_access - type: string - nullable: true - type: array - scopes_restriction: - $ref: "#/components/schemas/OAuthScopesRestriction" - required: - - scopes_restriction - - required_permission_scopes - type: object - OAuthScopesRestrictionResponseData: - description: Data object of an OAuth2 client scopes restriction response. - properties: - attributes: - $ref: "#/components/schemas/OAuthScopesRestrictionResponseAttributes" - id: - description: UUID of the OAuth2 client this restriction applies to. - example: fafa8e1c-36a5-11f0-a83d-da7ad0900001 - format: uuid - type: string - type: - $ref: "#/components/schemas/OAuthScopesRestrictionType" - required: - - id - - type - - attributes - type: object - OAuthScopesRestrictionType: - default: scopes_restriction - description: JSON:API resource type for an OAuth2 client scopes restriction. - enum: - - scopes_restriction - example: scopes_restriction - type: string - x-enum-varnames: - - SCOPES_RESTRICTION OCIConfig: description: OCI config. properties: @@ -55844,6 +55624,7 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineSyslogNgDestination" - $ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestination" - $ref: "#/components/schemas/ObservabilityPipelineDatadogMetricsDestination" + - $ref: "#/components/schemas/ObservabilityPipelineSplunkHecMetricsDestination" ObservabilityPipelineConfigPipelineType: default: logs description: The type of data being ingested. Defaults to `logs` if not specified. @@ -59965,6 +59746,81 @@ components: type: string x-enum-varnames: - SPLUNK_HEC + ObservabilityPipelineSplunkHecMetricsDestination: + description: |- + The `splunk_hec_metrics` destination forwards metrics to Splunk using the HTTP Event Collector (HEC). + + **Supported pipeline types:** metrics + properties: + buffer: + $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" + compression: + $ref: "#/components/schemas/ObservabilityPipelineSplunkHecMetricsDestinationCompression" + default_namespace: + description: Optional default namespace for metrics sent to Splunk HEC. + example: "custom_namespace" + type: string + endpoint_url_key: + description: Name of the environment variable or secret that holds the Splunk HEC endpoint URL. + example: SPLUNK_HEC_ENDPOINT_URL + type: string + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: splunk-hec-metrics-destination + type: string + index: + description: Optional name of the Splunk index where metrics are written. + example: "metrics" + type: string + inputs: + description: A list of component IDs whose output is used as the `input` for this component. + example: ["metrics-filter-processor"] + items: + description: The ID of a component whose output is used as input for this destination. + type: string + type: array + source: + description: The Splunk source field value for metric events. + example: "observability_pipelines" + type: string + sourcetype: + description: The Splunk sourcetype to assign to metric events. + example: "custom_sourcetype" + type: string + tls: + $ref: "#/components/schemas/ObservabilityPipelineTls" + token_key: + description: Name of the environment variable or secret that holds the Splunk HEC token. + example: SPLUNK_HEC_TOKEN + type: string + type: + $ref: "#/components/schemas/ObservabilityPipelineSplunkHecMetricsDestinationType" + required: + - id + - type + - inputs + type: object + x-pipeline-types: [metrics] + ObservabilityPipelineSplunkHecMetricsDestinationCompression: + default: none + description: Compression algorithm applied when sending metrics to Splunk HEC. + enum: + - none + - gzip + example: none + type: string + x-enum-varnames: + - NONE + - GZIP + ObservabilityPipelineSplunkHecMetricsDestinationType: + default: splunk_hec_metrics + description: The destination type. Always `splunk_hec_metrics`. + enum: + - splunk_hec_metrics + example: splunk_hec_metrics + type: string + x-enum-varnames: + - SPLUNK_HEC_METRICS ObservabilityPipelineSplunkHecSource: description: |- The `splunk_hec` source implements the Splunk HTTP Event Collector (HEC) API. @@ -92399,57 +92255,6 @@ components: - id - attributes type: object - UpsertOAuthScopesRestrictionData: - description: Data object of an upsert OAuth2 scopes restriction request. - properties: - attributes: - $ref: "#/components/schemas/UpsertOAuthScopesRestrictionDataAttributes" - type: - $ref: "#/components/schemas/UpsertOAuthScopesRestrictionType" - required: - - type - type: object - UpsertOAuthScopesRestrictionDataAttributes: - description: Attributes of an upsert OAuth2 scopes restriction request. - properties: - oidc_scopes: - description: OIDC scopes the client is allowed to request. - example: - - openid - - email - items: - $ref: "#/components/schemas/OAuthOidcScope" - type: array - permission_scopes: - description: |- - Datadog permission scopes the client is allowed to request. - Each value must be a valid permission name. - example: - - dashboards_read - - metrics_read - items: - description: Datadog permission scope name. - example: dashboards_read - type: string - type: array - type: object - UpsertOAuthScopesRestrictionRequest: - description: Request payload for creating or updating the scopes restriction of an OAuth2 client. - properties: - data: - $ref: "#/components/schemas/UpsertOAuthScopesRestrictionData" - required: - - data - type: object - UpsertOAuthScopesRestrictionType: - default: upsert_scopes_restriction - description: JSON:API resource type for an upsert OAuth2 client scopes restriction request. - enum: - - upsert_scopes_restriction - example: upsert_scopes_restriction - type: string - x-enum-varnames: - - UPSERT_SCOPES_RESTRICTION Urgency: description: Specifies the level of urgency for a routing rule (low, high, or dynamic). enum: @@ -111445,6 +111250,68 @@ 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/cost/tag_metadata/months: + get: + description: |- + List months that have Cloud Cost Management tag metadata for a given provider, + ordered most-recent first. The response is capped at 36 months. + operationId: ListCostTagMetadataMonths + parameters: + - description: |- + Provider to scope the query to. Use the value of the `providername` tag in CCM + (for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`). + For costs uploaded through the Custom Costs API, use `custom`. + Values are case-sensitive. + example: aws + in: query + name: filter[provider] + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "2026-04" + type: cost_tag_metadata_month + - id: "2026-03" + type: cost_tag_metadata_month + schema: + $ref: "#/components/schemas/CostTagMetadataMonthsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management tag metadata months + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_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/). /api/v2/cost/tag_metadata/orchestrators: get: description: List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period. @@ -134520,223 +134387,6 @@ paths: summary: Get all aggregated DNS traffic tags: - Cloud Network Monitoring - /api/v2/oauth2/clients/{client_uuid}/scopes_restriction: - delete: - description: Delete the scopes restriction configured for the OAuth2 client. - operationId: DeleteScopesRestriction - parameters: - - $ref: "#/components/parameters/OAuthClientUUIDPathParameter" - responses: - "204": - description: No Content - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Delete an OAuth2 client scopes restriction - tags: - - OAuth2 Client Public - x-permission: - operator: OR - permissions: - - org_authorized_apps_write - 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 the scopes restriction configured for the OAuth2 client. - operationId: GetScopesRestriction - parameters: - - $ref: "#/components/parameters/OAuthClientUUIDPathParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - required_permission_scopes: - scopes_restriction: - oidc_scopes: - - openid - - email - permission_scopes: - - dashboards_read - - metrics_read - id: fafa8e1c-36a5-11f0-a83d-da7ad0900001 - type: scopes_restriction - schema: - $ref: "#/components/schemas/OAuthScopesRestrictionResponse" - description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Get an OAuth2 client scopes restriction - tags: - - OAuth2 Client Public - x-permission: - operator: OR - permissions: - - org_authorized_apps_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 or update the scopes restriction configured for the OAuth2 client. - operationId: UpsertScopesRestriction - parameters: - - $ref: "#/components/parameters/OAuthClientUUIDPathParameter" - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - oidc_scopes: - - openid - - email - permission_scopes: - - dashboards_read - - metrics_read - type: upsert_scopes_restriction - schema: - $ref: "#/components/schemas/UpsertOAuthScopesRestrictionRequest" - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - required_permission_scopes: - scopes_restriction: - oidc_scopes: - - openid - - email - permission_scopes: - - dashboards_read - - metrics_read - id: fafa8e1c-36a5-11f0-a83d-da7ad0900001 - type: scopes_restriction - schema: - $ref: "#/components/schemas/OAuthScopesRestrictionResponse" - description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Upsert an OAuth2 client scopes restriction - tags: - - OAuth2 Client Public - x-codegen-request-body-name: body - x-permission: - operator: OR - permissions: - - org_authorized_apps_write - 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/oauth2/register: - post: - description: Register an OAuth2 client using the Dynamic Client Registration protocol defined in RFC 7591. - operationId: RegisterOAuthClient - requestBody: - content: - application/json: - examples: - default: - value: - client_name: Example MCP Client - grant_types: - - authorization_code - - refresh_token - redirect_uris: - - https://example.com/oauth/callback - response_types: - - code - token_endpoint_auth_method: none - schema: - $ref: "#/components/schemas/OAuthClientRegistrationRequest" - required: true - responses: - "201": - content: - application/json: - examples: - default: - value: - client_id: 72b68208-36a6-11f0-b21b-da7ad0900002 - client_name: Example MCP Client - grant_types: - - authorization_code - - refresh_token - redirect_uris: - - https://example.com/oauth/callback - response_types: - - code - token_endpoint_auth_method: none - schema: - $ref: "#/components/schemas/OAuthClientRegistrationResponse" - description: Created - "400": - content: - application/json: - examples: - default: - value: - error: invalid_client_metadata - error_description: redirect URI is not well-formed - schema: - $ref: "#/components/schemas/OAuthClientRegistrationError" - description: Bad Request - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: [] - summary: Register an OAuth2 client - tags: - - OAuth2 Client Public - x-codegen-request-body-name: body - 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/obs-pipelines/pipelines: get: description: Retrieve a list of pipelines. @@ -168153,10 +167803,6 @@ tags: - description: |- The Network Device Monitoring API allows you to fetch devices and interfaces and their attributes. See the [Network Device Monitoring page](https://docs.datadoghq.com/network_monitoring/) for more information. name: Network Device Monitoring - - description: |- - Configure OAuth2 clients for Datadog. - Supports RFC 7591 Dynamic Client Registration and management of OAuth2 client scopes restrictions. - name: OAuth2 Client Public - description: Auto-generated tag OCI Integration name: OCI Integration - description: |- diff --git a/examples/v2/cloud-cost-management/ListCostTagMetadataMonths.java b/examples/v2/cloud-cost-management/ListCostTagMetadataMonths.java new file mode 100644 index 00000000000..aeb96ecbd3b --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadataMonths.java @@ -0,0 +1,25 @@ +// List Cloud Cost Management tag metadata months returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CostTagMetadataMonthsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCostTagMetadataMonths", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostTagMetadataMonthsResponse result = apiInstance.listCostTagMetadataMonths("aws"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#listCostTagMetadataMonths"); + 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/oauth2-client-public/DeleteScopesRestriction.java b/examples/v2/oauth2-client-public/DeleteScopesRestriction.java deleted file mode 100644 index 602fee9fd1f..00000000000 --- a/examples/v2/oauth2-client-public/DeleteScopesRestriction.java +++ /dev/null @@ -1,24 +0,0 @@ -// Delete an OAuth2 client scopes restriction returns "No Content" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.OAuth2ClientPublicApi; -import java.util.UUID; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.deleteScopesRestriction", true); - OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient); - - try { - apiInstance.deleteScopesRestriction(UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001")); - } catch (ApiException e) { - System.err.println("Exception when calling OAuth2ClientPublicApi#deleteScopesRestriction"); - 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/oauth2-client-public/GetScopesRestriction.java b/examples/v2/oauth2-client-public/GetScopesRestriction.java deleted file mode 100644 index b5292323a93..00000000000 --- a/examples/v2/oauth2-client-public/GetScopesRestriction.java +++ /dev/null @@ -1,27 +0,0 @@ -// Get an OAuth2 client scopes restriction returns "OK" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.OAuth2ClientPublicApi; -import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse; -import java.util.UUID; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.getScopesRestriction", true); - OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient); - - try { - OAuthScopesRestrictionResponse result = - apiInstance.getScopesRestriction(UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001")); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OAuth2ClientPublicApi#getScopesRestriction"); - 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/oauth2-client-public/RegisterOAuthClient.java b/examples/v2/oauth2-client-public/RegisterOAuthClient.java deleted file mode 100644 index efb5b182175..00000000000 --- a/examples/v2/oauth2-client-public/RegisterOAuthClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Register an OAuth2 client returns "Created" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.OAuth2ClientPublicApi; -import com.datadog.api.client.v2.model.OAuthClientRegistrationGrantType; -import com.datadog.api.client.v2.model.OAuthClientRegistrationRequest; -import com.datadog.api.client.v2.model.OAuthClientRegistrationResponse; -import com.datadog.api.client.v2.model.OAuthClientRegistrationResponseType; -import java.util.Arrays; -import java.util.Collections; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.registerOAuthClient", true); - OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient); - - OAuthClientRegistrationRequest body = - new OAuthClientRegistrationRequest() - .clientName("Example MCP Client") - .clientUri("https://example.com") - .grantTypes( - Arrays.asList( - OAuthClientRegistrationGrantType.AUTHORIZATION_CODE, - OAuthClientRegistrationGrantType.REFRESH_TOKEN)) - .jwksUri("https://example.com/.well-known/jwks.json") - .logoUri("https://example.com/logo.png") - .policyUri("https://example.com/privacy") - .redirectUris(Collections.singletonList("https://example.com/oauth/callback")) - .responseTypes(Collections.singletonList(OAuthClientRegistrationResponseType.CODE)) - .scope("openid profile") - .tokenEndpointAuthMethod("none") - .tosUri("https://example.com/tos"); - - try { - OAuthClientRegistrationResponse result = apiInstance.registerOAuthClient(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OAuth2ClientPublicApi#registerOAuthClient"); - 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/oauth2-client-public/UpsertScopesRestriction.java b/examples/v2/oauth2-client-public/UpsertScopesRestriction.java deleted file mode 100644 index 7a94c0d1f16..00000000000 --- a/examples/v2/oauth2-client-public/UpsertScopesRestriction.java +++ /dev/null @@ -1,44 +0,0 @@ -// Upsert an OAuth2 client scopes restriction returns "OK" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.OAuth2ClientPublicApi; -import com.datadog.api.client.v2.model.OAuthOidcScope; -import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse; -import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionData; -import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionDataAttributes; -import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionRequest; -import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionType; -import java.util.Arrays; -import java.util.UUID; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.upsertScopesRestriction", true); - OAuth2ClientPublicApi apiInstance = new OAuth2ClientPublicApi(defaultClient); - - UpsertOAuthScopesRestrictionRequest body = - new UpsertOAuthScopesRestrictionRequest() - .data( - new UpsertOAuthScopesRestrictionData() - .attributes( - new UpsertOAuthScopesRestrictionDataAttributes() - .oidcScopes(Arrays.asList(OAuthOidcScope.OPENID, OAuthOidcScope.EMAIL)) - .permissionScopes(Arrays.asList("dashboards_read", "metrics_read"))) - .type(UpsertOAuthScopesRestrictionType.UPSERT_SCOPES_RESTRICTION)); - - try { - OAuthScopesRestrictionResponse result = - apiInstance.upsertScopesRestriction( - UUID.fromString("fafa8e1c-36a5-11f0-a83d-da7ad0900001"), body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OAuth2ClientPublicApi#upsertScopesRestriction"); - 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 c56de03b269..c172f090b44 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -953,6 +953,7 @@ public class ApiClient { put("v2.listCostTagKeySources", false); put("v2.listCostTagMetadata", false); put("v2.listCostTagMetadataMetrics", false); + put("v2.listCostTagMetadataMonths", false); put("v2.listCostTagMetadataOrchestrators", false); put("v2.searchCostRecommendations", false); put("v2.createDashboardSecureEmbed", false); @@ -1086,10 +1087,6 @@ public class ApiClient { put("v2.updateMonitorUserTemplate", false); put("v2.validateExistingMonitorUserTemplate", false); put("v2.validateMonitorUserTemplate", false); - put("v2.deleteScopesRestriction", false); - put("v2.getScopesRestriction", false); - put("v2.registerOAuthClient", false); - put("v2.upsertScopesRestriction", false); put("v2.bulkUpdateOrgGroupMemberships", false); put("v2.createOrgGroup", false); put("v2.createOrgGroupPolicy", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java index 482720c505b..940a2bbaac5 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java @@ -42,6 +42,7 @@ import com.datadog.api.client.v2.model.CostTagKeySourcesResponse; import com.datadog.api.client.v2.model.CostTagKeysResponse; import com.datadog.api.client.v2.model.CostTagMetadataDailyFilter; +import com.datadog.api.client.v2.model.CostTagMetadataMonthsResponse; import com.datadog.api.client.v2.model.CostTagsResponse; import com.datadog.api.client.v2.model.CreateRulesetRequest; import com.datadog.api.client.v2.model.CustomCostsFileGetResponse; @@ -7919,6 +7920,185 @@ public ApiResponse listCostTagMetadataMetricsWithHttpInfo( new GenericType() {}); } + /** + * List Cloud Cost Management tag metadata months. + * + *

See {@link #listCostTagMetadataMonthsWithHttpInfo}. + * + * @param filterProvider Provider to scope the query to. Use the value of the providername + * tag in CCM (for example, aws, azure, gcp, + * Oracle, Confluent Cloud, Snowflake). For costs + * uploaded through the Custom Costs API, use custom. Values are case-sensitive. + * (required) + * @return CostTagMetadataMonthsResponse + * @throws ApiException if fails to make API call + */ + public CostTagMetadataMonthsResponse listCostTagMetadataMonths(String filterProvider) + throws ApiException { + return listCostTagMetadataMonthsWithHttpInfo(filterProvider).getData(); + } + + /** + * List Cloud Cost Management tag metadata months. + * + *

See {@link #listCostTagMetadataMonthsWithHttpInfoAsync}. + * + * @param filterProvider Provider to scope the query to. Use the value of the providername + * tag in CCM (for example, aws, azure, gcp, + * Oracle, Confluent Cloud, Snowflake). For costs + * uploaded through the Custom Costs API, use custom. Values are case-sensitive. + * (required) + * @return CompletableFuture<CostTagMetadataMonthsResponse> + */ + public CompletableFuture listCostTagMetadataMonthsAsync( + String filterProvider) { + return listCostTagMetadataMonthsWithHttpInfoAsync(filterProvider) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List months that have Cloud Cost Management tag metadata for a given provider, ordered + * most-recent first. The response is capped at 36 months. + * + * @param filterProvider Provider to scope the query to. Use the value of the providername + * tag in CCM (for example, aws, azure, gcp, + * Oracle, Confluent Cloud, Snowflake). For costs + * uploaded through the Custom Costs API, use custom. Values are case-sensitive. + * (required) + * @return ApiResponse<CostTagMetadataMonthsResponse> + * @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 -
429 Too many requests -
+ */ + public ApiResponse listCostTagMetadataMonthsWithHttpInfo( + String filterProvider) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCostTagMetadataMonths"; + 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 'filterProvider' is set + if (filterProvider == null) { + throw new ApiException( + 400, + "Missing the required parameter 'filterProvider' when calling listCostTagMetadataMonths"); + } + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/months"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagMetadataMonths", + localVarPath, + localVarQueryParams, + 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 Cloud Cost Management tag metadata months. + * + *

See {@link #listCostTagMetadataMonthsWithHttpInfo}. + * + * @param filterProvider Provider to scope the query to. Use the value of the providername + * tag in CCM (for example, aws, azure, gcp, + * Oracle, Confluent Cloud, Snowflake). For costs + * uploaded through the Custom Costs API, use custom. Values are case-sensitive. + * (required) + * @return CompletableFuture<ApiResponse<CostTagMetadataMonthsResponse>> + */ + public CompletableFuture> + listCostTagMetadataMonthsWithHttpInfoAsync(String filterProvider) { + // Check if unstable operation is enabled + String operationId = "listCostTagMetadataMonths"; + 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 'filterProvider' is set + if (filterProvider == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'filterProvider' when calling" + + " listCostTagMetadataMonths")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cost/tag_metadata/months"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[provider]", filterProvider)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostTagMetadataMonths", + localVarPath, + localVarQueryParams, + 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() {}); + } + /** Manage optional parameters to listCostTagMetadataOrchestrators. */ public static class ListCostTagMetadataOrchestratorsOptionalParameters { private String filterProvider; diff --git a/src/main/java/com/datadog/api/client/v2/api/OAuth2ClientPublicApi.java b/src/main/java/com/datadog/api/client/v2/api/OAuth2ClientPublicApi.java deleted file mode 100644 index 37c81a86c5c..00000000000 --- a/src/main/java/com/datadog/api/client/v2/api/OAuth2ClientPublicApi.java +++ /dev/null @@ -1,695 +0,0 @@ -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.OAuthClientRegistrationRequest; -import com.datadog.api.client.v2.model.OAuthClientRegistrationResponse; -import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse; -import com.datadog.api.client.v2.model.UpsertOAuthScopesRestrictionRequest; -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.UUID; -import java.util.concurrent.CompletableFuture; - -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class OAuth2ClientPublicApi { - private ApiClient apiClient; - - public OAuth2ClientPublicApi() { - this(ApiClient.getDefaultApiClient()); - } - - public OAuth2ClientPublicApi(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; - } - - /** - * Delete an OAuth2 client scopes restriction. - * - *

See {@link #deleteScopesRestrictionWithHttpInfo}. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @throws ApiException if fails to make API call - */ - public void deleteScopesRestriction(UUID clientUuid) throws ApiException { - deleteScopesRestrictionWithHttpInfo(clientUuid); - } - - /** - * Delete an OAuth2 client scopes restriction. - * - *

See {@link #deleteScopesRestrictionWithHttpInfoAsync}. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @return CompletableFuture - */ - public CompletableFuture deleteScopesRestrictionAsync(UUID clientUuid) { - return deleteScopesRestrictionWithHttpInfoAsync(clientUuid) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Delete the scopes restriction configured for the OAuth2 client. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
404 Not Found -
429 Too many requests -
- */ - public ApiResponse deleteScopesRestrictionWithHttpInfo(UUID clientUuid) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "deleteScopesRestriction"; - 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 'clientUuid' is set - if (clientUuid == null) { - throw new ApiException( - 400, "Missing the required parameter 'clientUuid' when calling deleteScopesRestriction"); - } - // create path and map variables - String localVarPath = - "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" - .replaceAll( - "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.OAuth2ClientPublicApi.deleteScopesRestriction", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - return apiClient.invokeAPI( - "DELETE", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - null); - } - - /** - * Delete an OAuth2 client scopes restriction. - * - *

See {@link #deleteScopesRestrictionWithHttpInfo}. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @return CompletableFuture<ApiResponse<Void>> - */ - public CompletableFuture> deleteScopesRestrictionWithHttpInfoAsync( - UUID clientUuid) { - // Check if unstable operation is enabled - String operationId = "deleteScopesRestriction"; - 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 'clientUuid' is set - if (clientUuid == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'clientUuid' when calling deleteScopesRestriction")); - return result; - } - // create path and map variables - String localVarPath = - "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" - .replaceAll( - "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.OAuth2ClientPublicApi.deleteScopesRestriction", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - } 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 OAuth2 client scopes restriction. - * - *

See {@link #getScopesRestrictionWithHttpInfo}. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @return OAuthScopesRestrictionResponse - * @throws ApiException if fails to make API call - */ - public OAuthScopesRestrictionResponse getScopesRestriction(UUID clientUuid) throws ApiException { - return getScopesRestrictionWithHttpInfo(clientUuid).getData(); - } - - /** - * Get an OAuth2 client scopes restriction. - * - *

See {@link #getScopesRestrictionWithHttpInfoAsync}. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @return CompletableFuture<OAuthScopesRestrictionResponse> - */ - public CompletableFuture getScopesRestrictionAsync( - UUID clientUuid) { - return getScopesRestrictionWithHttpInfoAsync(clientUuid) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Get the scopes restriction configured for the OAuth2 client. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @return ApiResponse<OAuthScopesRestrictionResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
- */ - public ApiResponse getScopesRestrictionWithHttpInfo( - UUID clientUuid) throws ApiException { - // Check if unstable operation is enabled - String operationId = "getScopesRestriction"; - 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 'clientUuid' is set - if (clientUuid == null) { - throw new ApiException( - 400, "Missing the required parameter 'clientUuid' when calling getScopesRestriction"); - } - // create path and map variables - String localVarPath = - "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" - .replaceAll( - "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.OAuth2ClientPublicApi.getScopesRestriction", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Get an OAuth2 client scopes restriction. - * - *

See {@link #getScopesRestrictionWithHttpInfo}. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @return CompletableFuture<ApiResponse<OAuthScopesRestrictionResponse>> - */ - public CompletableFuture> - getScopesRestrictionWithHttpInfoAsync(UUID clientUuid) { - // Check if unstable operation is enabled - String operationId = "getScopesRestriction"; - 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 'clientUuid' is set - if (clientUuid == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'clientUuid' when calling getScopesRestriction")); - return result; - } - // create path and map variables - String localVarPath = - "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" - .replaceAll( - "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.OAuth2ClientPublicApi.getScopesRestriction", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - } 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() {}); - } - - /** - * Register an OAuth2 client. - * - *

See {@link #registerOAuthClientWithHttpInfo}. - * - * @param body (required) - * @return OAuthClientRegistrationResponse - * @throws ApiException if fails to make API call - */ - public OAuthClientRegistrationResponse registerOAuthClient(OAuthClientRegistrationRequest body) - throws ApiException { - return registerOAuthClientWithHttpInfo(body).getData(); - } - - /** - * Register an OAuth2 client. - * - *

See {@link #registerOAuthClientWithHttpInfoAsync}. - * - * @param body (required) - * @return CompletableFuture<OAuthClientRegistrationResponse> - */ - public CompletableFuture registerOAuthClientAsync( - OAuthClientRegistrationRequest body) { - return registerOAuthClientWithHttpInfoAsync(body) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Register an OAuth2 client using the Dynamic Client Registration protocol defined in RFC 7591. - * - * @param body (required) - * @return ApiResponse<OAuthClientRegistrationResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
429 Too many requests -
- */ - public ApiResponse registerOAuthClientWithHttpInfo( - OAuthClientRegistrationRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "registerOAuthClient"; - 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 registerOAuthClient"); - } - // create path and map variables - String localVarPath = "/api/v2/oauth2/register"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.OAuth2ClientPublicApi.registerOAuthClient", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {}); - return apiClient.invokeAPI( - "POST", - builder, - localVarHeaderParams, - new String[] {"application/json"}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Register an OAuth2 client. - * - *

See {@link #registerOAuthClientWithHttpInfo}. - * - * @param body (required) - * @return CompletableFuture<ApiResponse<OAuthClientRegistrationResponse>> - */ - public CompletableFuture> - registerOAuthClientWithHttpInfoAsync(OAuthClientRegistrationRequest body) { - // Check if unstable operation is enabled - String operationId = "registerOAuthClient"; - 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 registerOAuthClient")); - return result; - } - // create path and map variables - String localVarPath = "/api/v2/oauth2/register"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.OAuth2ClientPublicApi.registerOAuthClient", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {}); - } 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() {}); - } - - /** - * Upsert an OAuth2 client scopes restriction. - * - *

See {@link #upsertScopesRestrictionWithHttpInfo}. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @param body (required) - * @return OAuthScopesRestrictionResponse - * @throws ApiException if fails to make API call - */ - public OAuthScopesRestrictionResponse upsertScopesRestriction( - UUID clientUuid, UpsertOAuthScopesRestrictionRequest body) throws ApiException { - return upsertScopesRestrictionWithHttpInfo(clientUuid, body).getData(); - } - - /** - * Upsert an OAuth2 client scopes restriction. - * - *

See {@link #upsertScopesRestrictionWithHttpInfoAsync}. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @param body (required) - * @return CompletableFuture<OAuthScopesRestrictionResponse> - */ - public CompletableFuture upsertScopesRestrictionAsync( - UUID clientUuid, UpsertOAuthScopesRestrictionRequest body) { - return upsertScopesRestrictionWithHttpInfoAsync(clientUuid, body) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Create or update the scopes restriction configured for the OAuth2 client. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @param body (required) - * @return ApiResponse<OAuthScopesRestrictionResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
- */ - public ApiResponse upsertScopesRestrictionWithHttpInfo( - UUID clientUuid, UpsertOAuthScopesRestrictionRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "upsertScopesRestriction"; - 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 'clientUuid' is set - if (clientUuid == null) { - throw new ApiException( - 400, "Missing the required parameter 'clientUuid' when calling upsertScopesRestriction"); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException( - 400, "Missing the required parameter 'body' when calling upsertScopesRestriction"); - } - // create path and map variables - String localVarPath = - "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" - .replaceAll( - "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.OAuth2ClientPublicApi.upsertScopesRestriction", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - return apiClient.invokeAPI( - "POST", - builder, - localVarHeaderParams, - new String[] {"application/json"}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Upsert an OAuth2 client scopes restriction. - * - *

See {@link #upsertScopesRestrictionWithHttpInfo}. - * - * @param clientUuid UUID of the OAuth2 client. (required) - * @param body (required) - * @return CompletableFuture<ApiResponse<OAuthScopesRestrictionResponse>> - */ - public CompletableFuture> - upsertScopesRestrictionWithHttpInfoAsync( - UUID clientUuid, UpsertOAuthScopesRestrictionRequest body) { - // Check if unstable operation is enabled - String operationId = "upsertScopesRestriction"; - 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 'clientUuid' is set - if (clientUuid == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'clientUuid' when calling upsertScopesRestriction")); - 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 upsertScopesRestriction")); - return result; - } - // create path and map variables - String localVarPath = - "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction" - .replaceAll( - "\\{" + "client_uuid" + "\\}", apiClient.escapeString(clientUuid.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.OAuth2ClientPublicApi.upsertScopesRestriction", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - } 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() {}); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java b/src/main/java/com/datadog/api/client/v2/model/CostTagMetadataMonth.java similarity index 59% rename from src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java rename to src/main/java/com/datadog/api/client/v2/model/CostTagMetadataMonth.java index e776f317ec0..59b82384051 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagMetadataMonth.java @@ -17,73 +17,67 @@ import java.util.Map; import java.util.Objects; -/** Data object of an upsert OAuth2 scopes restriction request. */ -@JsonPropertyOrder({ - UpsertOAuthScopesRestrictionData.JSON_PROPERTY_ATTRIBUTES, - UpsertOAuthScopesRestrictionData.JSON_PROPERTY_TYPE -}) +/** A month that has Cloud Cost Management tag metadata available for a given provider. */ +@JsonPropertyOrder({CostTagMetadataMonth.JSON_PROPERTY_ID, CostTagMetadataMonth.JSON_PROPERTY_TYPE}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class UpsertOAuthScopesRestrictionData { +public class CostTagMetadataMonth { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private UpsertOAuthScopesRestrictionDataAttributes attributes; + public static final String JSON_PROPERTY_ID = "id"; + private String id; public static final String JSON_PROPERTY_TYPE = "type"; - private UpsertOAuthScopesRestrictionType type = - UpsertOAuthScopesRestrictionType.UPSERT_SCOPES_RESTRICTION; + private CostTagMetadataMonthType type = CostTagMetadataMonthType.COST_TAG_METADATA_MONTH; - public UpsertOAuthScopesRestrictionData() {} + public CostTagMetadataMonth() {} @JsonCreator - public UpsertOAuthScopesRestrictionData( - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) - UpsertOAuthScopesRestrictionType type) { + public CostTagMetadataMonth( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostTagMetadataMonthType type) { + this.id = id; this.type = type; this.unparsed |= !type.isValid(); } - public UpsertOAuthScopesRestrictionData attributes( - UpsertOAuthScopesRestrictionDataAttributes attributes) { - this.attributes = attributes; - this.unparsed |= attributes.unparsed; + public CostTagMetadataMonth id(String id) { + this.id = id; return this; } /** - * Attributes of an upsert OAuth2 scopes restriction request. + * The month, in YYYY-MM format. * - * @return attributes + * @return id */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTRIBUTES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UpsertOAuthScopesRestrictionDataAttributes getAttributes() { - return attributes; + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; } - public void setAttributes(UpsertOAuthScopesRestrictionDataAttributes attributes) { - this.attributes = attributes; + public void setId(String id) { + this.id = id; } - public UpsertOAuthScopesRestrictionData type(UpsertOAuthScopesRestrictionType type) { + public CostTagMetadataMonth type(CostTagMetadataMonthType type) { this.type = type; this.unparsed |= !type.isValid(); return this; } /** - * JSON:API resource type for an upsert OAuth2 client scopes restriction request. + * Type of the Cloud Cost Management tag metadata month resource. * * @return type */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public UpsertOAuthScopesRestrictionType getType() { + public CostTagMetadataMonthType getType() { return type; } - public void setType(UpsertOAuthScopesRestrictionType type) { + public void setType(CostTagMetadataMonthType type) { if (!type.isValid()) { this.unparsed = true; } @@ -102,10 +96,10 @@ public void setType(UpsertOAuthScopesRestrictionType type) { * * @param key The arbitrary key to set * @param value The associated value - * @return UpsertOAuthScopesRestrictionData + * @return CostTagMetadataMonth */ @JsonAnySetter - public UpsertOAuthScopesRestrictionData putAdditionalProperty(String key, Object value) { + public CostTagMetadataMonth putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -136,7 +130,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this UpsertOAuthScopesRestrictionData object is equal to o. */ + /** Return true if this CostTagMetadataMonth object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -145,24 +139,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - UpsertOAuthScopesRestrictionData upsertOAuthScopesRestrictionData = - (UpsertOAuthScopesRestrictionData) o; - return Objects.equals(this.attributes, upsertOAuthScopesRestrictionData.attributes) - && Objects.equals(this.type, upsertOAuthScopesRestrictionData.type) - && Objects.equals( - this.additionalProperties, upsertOAuthScopesRestrictionData.additionalProperties); + CostTagMetadataMonth costTagMetadataMonth = (CostTagMetadataMonth) o; + return Objects.equals(this.id, costTagMetadataMonth.id) + && Objects.equals(this.type, costTagMetadataMonth.type) + && Objects.equals(this.additionalProperties, costTagMetadataMonth.additionalProperties); } @Override public int hashCode() { - return Objects.hash(attributes, type, additionalProperties); + return Objects.hash(id, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class UpsertOAuthScopesRestrictionData {\n"); - sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append("class CostTagMetadataMonth {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionType.java b/src/main/java/com/datadog/api/client/v2/model/CostTagMetadataMonthType.java similarity index 53% rename from src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionType.java rename to src/main/java/com/datadog/api/client/v2/model/CostTagMetadataMonthType.java index 508de8c3c98..94cd58a5cf0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionType.java +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagMetadataMonthType.java @@ -18,40 +18,40 @@ import java.util.HashSet; import java.util.Set; -/** JSON:API resource type for an OAuth2 client scopes restriction. */ -@JsonSerialize(using = OAuthScopesRestrictionType.OAuthScopesRestrictionTypeSerializer.class) -public class OAuthScopesRestrictionType extends ModelEnum { +/** Type of the Cloud Cost Management tag metadata month resource. */ +@JsonSerialize(using = CostTagMetadataMonthType.CostTagMetadataMonthTypeSerializer.class) +public class CostTagMetadataMonthType extends ModelEnum { private static final Set allowedValues = - new HashSet(Arrays.asList("scopes_restriction")); + new HashSet(Arrays.asList("cost_tag_metadata_month")); - public static final OAuthScopesRestrictionType SCOPES_RESTRICTION = - new OAuthScopesRestrictionType("scopes_restriction"); + public static final CostTagMetadataMonthType COST_TAG_METADATA_MONTH = + new CostTagMetadataMonthType("cost_tag_metadata_month"); - OAuthScopesRestrictionType(String value) { + CostTagMetadataMonthType(String value) { super(value, allowedValues); } - public static class OAuthScopesRestrictionTypeSerializer - extends StdSerializer { - public OAuthScopesRestrictionTypeSerializer(Class t) { + public static class CostTagMetadataMonthTypeSerializer + extends StdSerializer { + public CostTagMetadataMonthTypeSerializer(Class t) { super(t); } - public OAuthScopesRestrictionTypeSerializer() { + public CostTagMetadataMonthTypeSerializer() { this(null); } @Override public void serialize( - OAuthScopesRestrictionType value, JsonGenerator jgen, SerializerProvider provider) + CostTagMetadataMonthType value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { jgen.writeObject(value.value); } } @JsonCreator - public static OAuthScopesRestrictionType fromValue(String value) { - return new OAuthScopesRestrictionType(value); + public static CostTagMetadataMonthType fromValue(String value) { + return new CostTagMetadataMonthType(value); } } diff --git a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionRequest.java b/src/main/java/com/datadog/api/client/v2/model/CostTagMetadataMonthsResponse.java similarity index 69% rename from src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionRequest.java rename to src/main/java/com/datadog/api/client/v2/model/CostTagMetadataMonthsResponse.java index 0708a864f4f..e42a485bcee 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagMetadataMonthsResponse.java @@ -13,47 +13,58 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; -/** Request payload for creating or updating the scopes restriction of an OAuth2 client. */ -@JsonPropertyOrder({UpsertOAuthScopesRestrictionRequest.JSON_PROPERTY_DATA}) +/** + * List of months that have Cloud Cost Management tag metadata for the requested provider, ordered + * most-recent first and capped at 36 months. + */ +@JsonPropertyOrder({CostTagMetadataMonthsResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class UpsertOAuthScopesRestrictionRequest { +public class CostTagMetadataMonthsResponse { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private UpsertOAuthScopesRestrictionData data; + private List data = new ArrayList<>(); - public UpsertOAuthScopesRestrictionRequest() {} + public CostTagMetadataMonthsResponse() {} @JsonCreator - public UpsertOAuthScopesRestrictionRequest( - @JsonProperty(required = true, value = JSON_PROPERTY_DATA) - UpsertOAuthScopesRestrictionData data) { + public CostTagMetadataMonthsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { this.data = data; - this.unparsed |= data.unparsed; } - public UpsertOAuthScopesRestrictionRequest data(UpsertOAuthScopesRestrictionData data) { + public CostTagMetadataMonthsResponse data(List data) { this.data = data; - this.unparsed |= data.unparsed; + for (CostTagMetadataMonth item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CostTagMetadataMonthsResponse addDataItem(CostTagMetadataMonth dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; return this; } /** - * Data object of an upsert OAuth2 scopes restriction request. + * List of months that have tag metadata available. * * @return data */ @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public UpsertOAuthScopesRestrictionData getData() { + public List getData() { return data; } - public void setData(UpsertOAuthScopesRestrictionData data) { + public void setData(List data) { this.data = data; } @@ -69,10 +80,10 @@ public void setData(UpsertOAuthScopesRestrictionData data) { * * @param key The arbitrary key to set * @param value The associated value - * @return UpsertOAuthScopesRestrictionRequest + * @return CostTagMetadataMonthsResponse */ @JsonAnySetter - public UpsertOAuthScopesRestrictionRequest putAdditionalProperty(String key, Object value) { + public CostTagMetadataMonthsResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -103,7 +114,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this UpsertOAuthScopesRestrictionRequest object is equal to o. */ + /** Return true if this CostTagMetadataMonthsResponse object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -112,11 +123,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - UpsertOAuthScopesRestrictionRequest upsertOAuthScopesRestrictionRequest = - (UpsertOAuthScopesRestrictionRequest) o; - return Objects.equals(this.data, upsertOAuthScopesRestrictionRequest.data) + CostTagMetadataMonthsResponse costTagMetadataMonthsResponse = (CostTagMetadataMonthsResponse) o; + return Objects.equals(this.data, costTagMetadataMonthsResponse.data) && Objects.equals( - this.additionalProperties, upsertOAuthScopesRestrictionRequest.additionalProperties); + this.additionalProperties, costTagMetadataMonthsResponse.additionalProperties); } @Override @@ -127,7 +137,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class UpsertOAuthScopesRestrictionRequest {\n"); + sb.append("class CostTagMetadataMonthsResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationError.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationError.java deleted file mode 100644 index f2c50db5d17..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationError.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Error payload returned by OAuth2 dynamic client registration as defined by RFC 7591. */ -@JsonPropertyOrder({ - OAuthClientRegistrationError.JSON_PROPERTY_ERROR, - OAuthClientRegistrationError.JSON_PROPERTY_ERROR_DESCRIPTION -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class OAuthClientRegistrationError { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ERROR = "error"; - private String error; - - public static final String JSON_PROPERTY_ERROR_DESCRIPTION = "error_description"; - private String errorDescription; - - public OAuthClientRegistrationError() {} - - @JsonCreator - public OAuthClientRegistrationError( - @JsonProperty(required = true, value = JSON_PROPERTY_ERROR) String error, - @JsonProperty(required = true, value = JSON_PROPERTY_ERROR_DESCRIPTION) - String errorDescription) { - this.error = error; - this.errorDescription = errorDescription; - } - - public OAuthClientRegistrationError error(String error) { - this.error = error; - return this; - } - - /** - * Single ASCII error code per RFC 7591, such as invalid_request or - * invalid_client_metadata. - * - * @return error - */ - @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - public OAuthClientRegistrationError errorDescription(String errorDescription) { - this.errorDescription = errorDescription; - return this; - } - - /** - * Human-readable description of the error. - * - * @return errorDescription - */ - @JsonProperty(JSON_PROPERTY_ERROR_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getErrorDescription() { - return errorDescription; - } - - public void setErrorDescription(String errorDescription) { - this.errorDescription = errorDescription; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return OAuthClientRegistrationError - */ - @JsonAnySetter - public OAuthClientRegistrationError putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this OAuthClientRegistrationError object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthClientRegistrationError oAuthClientRegistrationError = (OAuthClientRegistrationError) o; - return Objects.equals(this.error, oAuthClientRegistrationError.error) - && Objects.equals(this.errorDescription, oAuthClientRegistrationError.errorDescription) - && Objects.equals( - this.additionalProperties, oAuthClientRegistrationError.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(error, errorDescription, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthClientRegistrationError {\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append(" errorDescription: ").append(toIndentedString(errorDescription)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationGrantType.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationGrantType.java deleted file mode 100644 index 2a29ed6a981..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationGrantType.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.ModelEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** OAuth 2.0 grant type that a registered client may use. */ -@JsonSerialize( - using = OAuthClientRegistrationGrantType.OAuthClientRegistrationGrantTypeSerializer.class) -public class OAuthClientRegistrationGrantType extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("authorization_code", "refresh_token")); - - public static final OAuthClientRegistrationGrantType AUTHORIZATION_CODE = - new OAuthClientRegistrationGrantType("authorization_code"); - public static final OAuthClientRegistrationGrantType REFRESH_TOKEN = - new OAuthClientRegistrationGrantType("refresh_token"); - - OAuthClientRegistrationGrantType(String value) { - super(value, allowedValues); - } - - public static class OAuthClientRegistrationGrantTypeSerializer - extends StdSerializer { - public OAuthClientRegistrationGrantTypeSerializer(Class t) { - super(t); - } - - public OAuthClientRegistrationGrantTypeSerializer() { - this(null); - } - - @Override - public void serialize( - OAuthClientRegistrationGrantType value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static OAuthClientRegistrationGrantType fromValue(String value) { - return new OAuthClientRegistrationGrantType(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationRequest.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationRequest.java deleted file mode 100644 index f3930a72c81..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationRequest.java +++ /dev/null @@ -1,465 +0,0 @@ -/* - * 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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Request payload for OAuth2 dynamic client registration as defined by RFC 7591. */ -@JsonPropertyOrder({ - OAuthClientRegistrationRequest.JSON_PROPERTY_CLIENT_NAME, - OAuthClientRegistrationRequest.JSON_PROPERTY_CLIENT_URI, - OAuthClientRegistrationRequest.JSON_PROPERTY_GRANT_TYPES, - OAuthClientRegistrationRequest.JSON_PROPERTY_JWKS_URI, - OAuthClientRegistrationRequest.JSON_PROPERTY_LOGO_URI, - OAuthClientRegistrationRequest.JSON_PROPERTY_POLICY_URI, - OAuthClientRegistrationRequest.JSON_PROPERTY_REDIRECT_URIS, - OAuthClientRegistrationRequest.JSON_PROPERTY_RESPONSE_TYPES, - OAuthClientRegistrationRequest.JSON_PROPERTY_SCOPE, - OAuthClientRegistrationRequest.JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD, - OAuthClientRegistrationRequest.JSON_PROPERTY_TOS_URI -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class OAuthClientRegistrationRequest { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_CLIENT_NAME = "client_name"; - private String clientName; - - public static final String JSON_PROPERTY_CLIENT_URI = "client_uri"; - private String clientUri; - - public static final String JSON_PROPERTY_GRANT_TYPES = "grant_types"; - private List grantTypes = null; - - public static final String JSON_PROPERTY_JWKS_URI = "jwks_uri"; - private String jwksUri; - - public static final String JSON_PROPERTY_LOGO_URI = "logo_uri"; - private String logoUri; - - public static final String JSON_PROPERTY_POLICY_URI = "policy_uri"; - private String policyUri; - - public static final String JSON_PROPERTY_REDIRECT_URIS = "redirect_uris"; - private List redirectUris = new ArrayList<>(); - - public static final String JSON_PROPERTY_RESPONSE_TYPES = "response_types"; - private List responseTypes = null; - - public static final String JSON_PROPERTY_SCOPE = "scope"; - private String scope; - - public static final String JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD = - "token_endpoint_auth_method"; - private String tokenEndpointAuthMethod; - - public static final String JSON_PROPERTY_TOS_URI = "tos_uri"; - private String tosUri; - - public OAuthClientRegistrationRequest() {} - - @JsonCreator - public OAuthClientRegistrationRequest( - @JsonProperty(required = true, value = JSON_PROPERTY_CLIENT_NAME) String clientName, - @JsonProperty(required = true, value = JSON_PROPERTY_REDIRECT_URIS) - List redirectUris) { - this.clientName = clientName; - this.redirectUris = redirectUris; - } - - public OAuthClientRegistrationRequest clientName(String clientName) { - this.clientName = clientName; - return this; - } - - /** - * Human-readable name of the client. Control characters are rejected. - * - * @return clientName - */ - @JsonProperty(JSON_PROPERTY_CLIENT_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public OAuthClientRegistrationRequest clientUri(String clientUri) { - this.clientUri = clientUri; - return this; - } - - /** - * URL of the home page of the client. - * - * @return clientUri - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CLIENT_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientUri() { - return clientUri; - } - - public void setClientUri(String clientUri) { - this.clientUri = clientUri; - } - - public OAuthClientRegistrationRequest grantTypes( - List grantTypes) { - this.grantTypes = grantTypes; - return this; - } - - public OAuthClientRegistrationRequest addGrantTypesItem( - OAuthClientRegistrationGrantType grantTypesItem) { - if (this.grantTypes == null) { - this.grantTypes = new ArrayList<>(); - } - this.grantTypes.add(grantTypesItem); - this.unparsed |= !grantTypesItem.isValid(); - return this; - } - - /** - * OAuth 2.0 grant types the client may use. Defaults to authorization_code and - * refresh_token when omitted. - * - * @return grantTypes - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_GRANT_TYPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getGrantTypes() { - return grantTypes; - } - - public void setGrantTypes(List grantTypes) { - this.grantTypes = grantTypes; - } - - public OAuthClientRegistrationRequest jwksUri(String jwksUri) { - this.jwksUri = jwksUri; - return this; - } - - /** - * URL referencing the client's JSON Web Key Set. - * - * @return jwksUri - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_JWKS_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getJwksUri() { - return jwksUri; - } - - public void setJwksUri(String jwksUri) { - this.jwksUri = jwksUri; - } - - public OAuthClientRegistrationRequest logoUri(String logoUri) { - this.logoUri = logoUri; - return this; - } - - /** - * URL referencing a logo for the client. - * - * @return logoUri - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LOGO_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLogoUri() { - return logoUri; - } - - public void setLogoUri(String logoUri) { - this.logoUri = logoUri; - } - - public OAuthClientRegistrationRequest policyUri(String policyUri) { - this.policyUri = policyUri; - return this; - } - - /** - * URL pointing to the client's privacy policy. - * - * @return policyUri - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_POLICY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPolicyUri() { - return policyUri; - } - - public void setPolicyUri(String policyUri) { - this.policyUri = policyUri; - } - - public OAuthClientRegistrationRequest redirectUris(List redirectUris) { - this.redirectUris = redirectUris; - return this; - } - - public OAuthClientRegistrationRequest addRedirectUrisItem(String redirectUrisItem) { - this.redirectUris.add(redirectUrisItem); - return this; - } - - /** - * Array of redirection URI strings used by the client in redirect-based flows. - * - * @return redirectUris - */ - @JsonProperty(JSON_PROPERTY_REDIRECT_URIS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getRedirectUris() { - return redirectUris; - } - - public void setRedirectUris(List redirectUris) { - this.redirectUris = redirectUris; - } - - public OAuthClientRegistrationRequest responseTypes( - List responseTypes) { - this.responseTypes = responseTypes; - return this; - } - - public OAuthClientRegistrationRequest addResponseTypesItem( - OAuthClientRegistrationResponseType responseTypesItem) { - if (this.responseTypes == null) { - this.responseTypes = new ArrayList<>(); - } - this.responseTypes.add(responseTypesItem); - this.unparsed |= !responseTypesItem.isValid(); - return this; - } - - /** - * OAuth 2.0 response types the client may use. Only code is supported. - * - * @return responseTypes - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RESPONSE_TYPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getResponseTypes() { - return responseTypes; - } - - public void setResponseTypes(List responseTypes) { - this.responseTypes = responseTypes; - } - - public OAuthClientRegistrationRequest scope(String scope) { - this.scope = scope; - return this; - } - - /** - * Space-separated list of scope values the client may request. - * - * @return scope - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SCOPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getScope() { - return scope; - } - - public void setScope(String scope) { - this.scope = scope; - } - - public OAuthClientRegistrationRequest tokenEndpointAuthMethod(String tokenEndpointAuthMethod) { - this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; - return this; - } - - /** - * Requested authentication method for the token endpoint. Only none is supported. - * - * @return tokenEndpointAuthMethod - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTokenEndpointAuthMethod() { - return tokenEndpointAuthMethod; - } - - public void setTokenEndpointAuthMethod(String tokenEndpointAuthMethod) { - this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; - } - - public OAuthClientRegistrationRequest tosUri(String tosUri) { - this.tosUri = tosUri; - return this; - } - - /** - * URL pointing to the client's terms of service. - * - * @return tosUri - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TOS_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTosUri() { - return tosUri; - } - - public void setTosUri(String tosUri) { - this.tosUri = tosUri; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return OAuthClientRegistrationRequest - */ - @JsonAnySetter - public OAuthClientRegistrationRequest putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this OAuthClientRegistrationRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthClientRegistrationRequest oAuthClientRegistrationRequest = - (OAuthClientRegistrationRequest) o; - return Objects.equals(this.clientName, oAuthClientRegistrationRequest.clientName) - && Objects.equals(this.clientUri, oAuthClientRegistrationRequest.clientUri) - && Objects.equals(this.grantTypes, oAuthClientRegistrationRequest.grantTypes) - && Objects.equals(this.jwksUri, oAuthClientRegistrationRequest.jwksUri) - && Objects.equals(this.logoUri, oAuthClientRegistrationRequest.logoUri) - && Objects.equals(this.policyUri, oAuthClientRegistrationRequest.policyUri) - && Objects.equals(this.redirectUris, oAuthClientRegistrationRequest.redirectUris) - && Objects.equals(this.responseTypes, oAuthClientRegistrationRequest.responseTypes) - && Objects.equals(this.scope, oAuthClientRegistrationRequest.scope) - && Objects.equals( - this.tokenEndpointAuthMethod, oAuthClientRegistrationRequest.tokenEndpointAuthMethod) - && Objects.equals(this.tosUri, oAuthClientRegistrationRequest.tosUri) - && Objects.equals( - this.additionalProperties, oAuthClientRegistrationRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - clientName, - clientUri, - grantTypes, - jwksUri, - logoUri, - policyUri, - redirectUris, - responseTypes, - scope, - tokenEndpointAuthMethod, - tosUri, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthClientRegistrationRequest {\n"); - sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); - sb.append(" clientUri: ").append(toIndentedString(clientUri)).append("\n"); - sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); - sb.append(" jwksUri: ").append(toIndentedString(jwksUri)).append("\n"); - sb.append(" logoUri: ").append(toIndentedString(logoUri)).append("\n"); - sb.append(" policyUri: ").append(toIndentedString(policyUri)).append("\n"); - sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); - sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" tokenEndpointAuthMethod: ") - .append(toIndentedString(tokenEndpointAuthMethod)) - .append("\n"); - sb.append(" tosUri: ").append(toIndentedString(tosUri)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponse.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponse.java deleted file mode 100644 index c94ae40ce70..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponse.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * 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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Response payload for a successful OAuth2 dynamic client registration as defined by RFC 7591. */ -@JsonPropertyOrder({ - OAuthClientRegistrationResponse.JSON_PROPERTY_CLIENT_ID, - OAuthClientRegistrationResponse.JSON_PROPERTY_CLIENT_NAME, - OAuthClientRegistrationResponse.JSON_PROPERTY_GRANT_TYPES, - OAuthClientRegistrationResponse.JSON_PROPERTY_REDIRECT_URIS, - OAuthClientRegistrationResponse.JSON_PROPERTY_RESPONSE_TYPES, - OAuthClientRegistrationResponse.JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class OAuthClientRegistrationResponse { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private UUID clientId; - - public static final String JSON_PROPERTY_CLIENT_NAME = "client_name"; - private String clientName; - - public static final String JSON_PROPERTY_GRANT_TYPES = "grant_types"; - private List grantTypes = new ArrayList<>(); - - public static final String JSON_PROPERTY_REDIRECT_URIS = "redirect_uris"; - private List redirectUris = new ArrayList<>(); - - public static final String JSON_PROPERTY_RESPONSE_TYPES = "response_types"; - private List responseTypes = new ArrayList<>(); - - public static final String JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD = - "token_endpoint_auth_method"; - private String tokenEndpointAuthMethod; - - public OAuthClientRegistrationResponse() {} - - @JsonCreator - public OAuthClientRegistrationResponse( - @JsonProperty(required = true, value = JSON_PROPERTY_CLIENT_ID) UUID clientId, - @JsonProperty(required = true, value = JSON_PROPERTY_CLIENT_NAME) String clientName, - @JsonProperty(required = true, value = JSON_PROPERTY_GRANT_TYPES) - List grantTypes, - @JsonProperty(required = true, value = JSON_PROPERTY_REDIRECT_URIS) List redirectUris, - @JsonProperty(required = true, value = JSON_PROPERTY_RESPONSE_TYPES) - List responseTypes, - @JsonProperty(required = true, value = JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD) - String tokenEndpointAuthMethod) { - this.clientId = clientId; - this.clientName = clientName; - this.grantTypes = grantTypes; - this.redirectUris = redirectUris; - this.responseTypes = responseTypes; - this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; - } - - public OAuthClientRegistrationResponse clientId(UUID clientId) { - this.clientId = clientId; - return this; - } - - /** - * Unique identifier assigned to the registered client. - * - * @return clientId - */ - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public UUID getClientId() { - return clientId; - } - - public void setClientId(UUID clientId) { - this.clientId = clientId; - } - - public OAuthClientRegistrationResponse clientName(String clientName) { - this.clientName = clientName; - return this; - } - - /** - * Human-readable name of the client. - * - * @return clientName - */ - @JsonProperty(JSON_PROPERTY_CLIENT_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public OAuthClientRegistrationResponse grantTypes( - List grantTypes) { - this.grantTypes = grantTypes; - return this; - } - - public OAuthClientRegistrationResponse addGrantTypesItem( - OAuthClientRegistrationGrantType grantTypesItem) { - this.grantTypes.add(grantTypesItem); - this.unparsed |= !grantTypesItem.isValid(); - return this; - } - - /** - * OAuth 2.0 grant types registered for the client. - * - * @return grantTypes - */ - @JsonProperty(JSON_PROPERTY_GRANT_TYPES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getGrantTypes() { - return grantTypes; - } - - public void setGrantTypes(List grantTypes) { - this.grantTypes = grantTypes; - } - - public OAuthClientRegistrationResponse redirectUris(List redirectUris) { - this.redirectUris = redirectUris; - return this; - } - - public OAuthClientRegistrationResponse addRedirectUrisItem(String redirectUrisItem) { - this.redirectUris.add(redirectUrisItem); - return this; - } - - /** - * Redirection URIs registered for the client. - * - * @return redirectUris - */ - @JsonProperty(JSON_PROPERTY_REDIRECT_URIS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getRedirectUris() { - return redirectUris; - } - - public void setRedirectUris(List redirectUris) { - this.redirectUris = redirectUris; - } - - public OAuthClientRegistrationResponse responseTypes( - List responseTypes) { - this.responseTypes = responseTypes; - return this; - } - - public OAuthClientRegistrationResponse addResponseTypesItem( - OAuthClientRegistrationResponseType responseTypesItem) { - this.responseTypes.add(responseTypesItem); - this.unparsed |= !responseTypesItem.isValid(); - return this; - } - - /** - * OAuth 2.0 response types registered for the client. - * - * @return responseTypes - */ - @JsonProperty(JSON_PROPERTY_RESPONSE_TYPES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getResponseTypes() { - return responseTypes; - } - - public void setResponseTypes(List responseTypes) { - this.responseTypes = responseTypes; - } - - public OAuthClientRegistrationResponse tokenEndpointAuthMethod(String tokenEndpointAuthMethod) { - this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; - return this; - } - - /** - * Authentication method registered for the token endpoint. Always none. - * - * @return tokenEndpointAuthMethod - */ - @JsonProperty(JSON_PROPERTY_TOKEN_ENDPOINT_AUTH_METHOD) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTokenEndpointAuthMethod() { - return tokenEndpointAuthMethod; - } - - public void setTokenEndpointAuthMethod(String tokenEndpointAuthMethod) { - this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return OAuthClientRegistrationResponse - */ - @JsonAnySetter - public OAuthClientRegistrationResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this OAuthClientRegistrationResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthClientRegistrationResponse oAuthClientRegistrationResponse = - (OAuthClientRegistrationResponse) o; - return Objects.equals(this.clientId, oAuthClientRegistrationResponse.clientId) - && Objects.equals(this.clientName, oAuthClientRegistrationResponse.clientName) - && Objects.equals(this.grantTypes, oAuthClientRegistrationResponse.grantTypes) - && Objects.equals(this.redirectUris, oAuthClientRegistrationResponse.redirectUris) - && Objects.equals(this.responseTypes, oAuthClientRegistrationResponse.responseTypes) - && Objects.equals( - this.tokenEndpointAuthMethod, oAuthClientRegistrationResponse.tokenEndpointAuthMethod) - && Objects.equals( - this.additionalProperties, oAuthClientRegistrationResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - clientId, - clientName, - grantTypes, - redirectUris, - responseTypes, - tokenEndpointAuthMethod, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthClientRegistrationResponse {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); - sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); - sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); - sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); - sb.append(" tokenEndpointAuthMethod: ") - .append(toIndentedString(tokenEndpointAuthMethod)) - .append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponseType.java b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponseType.java deleted file mode 100644 index 88dcd37fa6a..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponseType.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.ModelEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** OAuth 2.0 response type that a registered client may use. */ -@JsonSerialize( - using = OAuthClientRegistrationResponseType.OAuthClientRegistrationResponseTypeSerializer.class) -public class OAuthClientRegistrationResponseType extends ModelEnum { - - private static final Set allowedValues = new HashSet(Arrays.asList("code")); - - public static final OAuthClientRegistrationResponseType CODE = - new OAuthClientRegistrationResponseType("code"); - - OAuthClientRegistrationResponseType(String value) { - super(value, allowedValues); - } - - public static class OAuthClientRegistrationResponseTypeSerializer - extends StdSerializer { - public OAuthClientRegistrationResponseTypeSerializer( - Class t) { - super(t); - } - - public OAuthClientRegistrationResponseTypeSerializer() { - this(null); - } - - @Override - public void serialize( - OAuthClientRegistrationResponseType value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static OAuthClientRegistrationResponseType fromValue(String value) { - return new OAuthClientRegistrationResponseType(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthOidcScope.java b/src/main/java/com/datadog/api/client/v2/model/OAuthOidcScope.java deleted file mode 100644 index b6e806250ed..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthOidcScope.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.ModelEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** OIDC scope a client may be restricted to. */ -@JsonSerialize(using = OAuthOidcScope.OAuthOidcScopeSerializer.class) -public class OAuthOidcScope extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("openid", "profile", "email", "offline_access")); - - public static final OAuthOidcScope OPENID = new OAuthOidcScope("openid"); - public static final OAuthOidcScope PROFILE = new OAuthOidcScope("profile"); - public static final OAuthOidcScope EMAIL = new OAuthOidcScope("email"); - public static final OAuthOidcScope OFFLINE_ACCESS = new OAuthOidcScope("offline_access"); - - OAuthOidcScope(String value) { - super(value, allowedValues); - } - - public static class OAuthOidcScopeSerializer extends StdSerializer { - public OAuthOidcScopeSerializer(Class t) { - super(t); - } - - public OAuthOidcScopeSerializer() { - this(null); - } - - @Override - public void serialize(OAuthOidcScope value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static OAuthOidcScope fromValue(String value) { - return new OAuthOidcScope(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestriction.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestriction.java deleted file mode 100644 index 6aba1109382..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestriction.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * 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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Allowlist of OIDC and permission scopes enforced for the OAuth2 client. */ -@JsonPropertyOrder({ - OAuthScopesRestriction.JSON_PROPERTY_OIDC_SCOPES, - OAuthScopesRestriction.JSON_PROPERTY_PERMISSION_SCOPES -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class OAuthScopesRestriction { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_OIDC_SCOPES = "oidc_scopes"; - private List oidcScopes = new ArrayList<>(); - - public static final String JSON_PROPERTY_PERMISSION_SCOPES = "permission_scopes"; - private List permissionScopes = new ArrayList<>(); - - public OAuthScopesRestriction() {} - - @JsonCreator - public OAuthScopesRestriction( - @JsonProperty(required = true, value = JSON_PROPERTY_OIDC_SCOPES) - List oidcScopes, - @JsonProperty(required = true, value = JSON_PROPERTY_PERMISSION_SCOPES) - List permissionScopes) { - this.oidcScopes = oidcScopes; - this.permissionScopes = permissionScopes; - } - - public OAuthScopesRestriction oidcScopes(List oidcScopes) { - this.oidcScopes = oidcScopes; - return this; - } - - public OAuthScopesRestriction addOidcScopesItem(OAuthOidcScope oidcScopesItem) { - this.oidcScopes.add(oidcScopesItem); - this.unparsed |= !oidcScopesItem.isValid(); - return this; - } - - /** - * OIDC scopes the client is restricted to. - * - * @return oidcScopes - */ - @JsonProperty(JSON_PROPERTY_OIDC_SCOPES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getOidcScopes() { - return oidcScopes; - } - - public void setOidcScopes(List oidcScopes) { - this.oidcScopes = oidcScopes; - } - - public OAuthScopesRestriction permissionScopes(List permissionScopes) { - this.permissionScopes = permissionScopes; - return this; - } - - public OAuthScopesRestriction addPermissionScopesItem(String permissionScopesItem) { - this.permissionScopes.add(permissionScopesItem); - return this; - } - - /** - * Datadog permission scopes the client is restricted to. - * - * @return permissionScopes - */ - @JsonProperty(JSON_PROPERTY_PERMISSION_SCOPES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPermissionScopes() { - return permissionScopes; - } - - public void setPermissionScopes(List permissionScopes) { - this.permissionScopes = permissionScopes; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return OAuthScopesRestriction - */ - @JsonAnySetter - public OAuthScopesRestriction putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this OAuthScopesRestriction object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthScopesRestriction oAuthScopesRestriction = (OAuthScopesRestriction) o; - return Objects.equals(this.oidcScopes, oAuthScopesRestriction.oidcScopes) - && Objects.equals(this.permissionScopes, oAuthScopesRestriction.permissionScopes) - && Objects.equals(this.additionalProperties, oAuthScopesRestriction.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(oidcScopes, permissionScopes, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthScopesRestriction {\n"); - sb.append(" oidcScopes: ").append(toIndentedString(oidcScopes)).append("\n"); - sb.append(" permissionScopes: ").append(toIndentedString(permissionScopes)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponse.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponse.java deleted file mode 100644 index db5c5756cd6..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponse.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Response payload describing the scopes restriction of an OAuth2 client. */ -@JsonPropertyOrder({OAuthScopesRestrictionResponse.JSON_PROPERTY_DATA}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class OAuthScopesRestrictionResponse { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_DATA = "data"; - private OAuthScopesRestrictionResponseData data; - - public OAuthScopesRestrictionResponse() {} - - @JsonCreator - public OAuthScopesRestrictionResponse( - @JsonProperty(required = true, value = JSON_PROPERTY_DATA) - OAuthScopesRestrictionResponseData data) { - this.data = data; - this.unparsed |= data.unparsed; - } - - public OAuthScopesRestrictionResponse data(OAuthScopesRestrictionResponseData data) { - this.data = data; - this.unparsed |= data.unparsed; - return this; - } - - /** - * Data object of an OAuth2 client scopes restriction response. - * - * @return data - */ - @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OAuthScopesRestrictionResponseData getData() { - return data; - } - - public void setData(OAuthScopesRestrictionResponseData data) { - this.data = data; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return OAuthScopesRestrictionResponse - */ - @JsonAnySetter - public OAuthScopesRestrictionResponse putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this OAuthScopesRestrictionResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthScopesRestrictionResponse oAuthScopesRestrictionResponse = - (OAuthScopesRestrictionResponse) o; - return Objects.equals(this.data, oAuthScopesRestrictionResponse.data) - && Objects.equals( - this.additionalProperties, oAuthScopesRestrictionResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(data, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthScopesRestrictionResponse {\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseAttributes.java deleted file mode 100644 index 19e3469cce1..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseAttributes.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Attributes of an OAuth2 client scopes restriction. */ -@JsonPropertyOrder({ - OAuthScopesRestrictionResponseAttributes.JSON_PROPERTY_REQUIRED_PERMISSION_SCOPES, - OAuthScopesRestrictionResponseAttributes.JSON_PROPERTY_SCOPES_RESTRICTION -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class OAuthScopesRestrictionResponseAttributes { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_REQUIRED_PERMISSION_SCOPES = - "required_permission_scopes"; - private List requiredPermissionScopes = new ArrayList<>(); - - public static final String JSON_PROPERTY_SCOPES_RESTRICTION = "scopes_restriction"; - private OAuthScopesRestriction scopesRestriction; - - public OAuthScopesRestrictionResponseAttributes() {} - - @JsonCreator - public OAuthScopesRestrictionResponseAttributes( - @JsonProperty(required = true, value = JSON_PROPERTY_REQUIRED_PERMISSION_SCOPES) - List requiredPermissionScopes, - @JsonProperty(required = true, value = JSON_PROPERTY_SCOPES_RESTRICTION) - OAuthScopesRestriction scopesRestriction) { - this.requiredPermissionScopes = requiredPermissionScopes; - if (requiredPermissionScopes != null) {} - this.scopesRestriction = scopesRestriction; - if (scopesRestriction != null) { - this.unparsed |= scopesRestriction.unparsed; - } - } - - public OAuthScopesRestrictionResponseAttributes requiredPermissionScopes( - List requiredPermissionScopes) { - this.requiredPermissionScopes = requiredPermissionScopes; - return this; - } - - public OAuthScopesRestrictionResponseAttributes addRequiredPermissionScopesItem( - String requiredPermissionScopesItem) { - this.requiredPermissionScopes.add(requiredPermissionScopesItem); - return this; - } - - /** - * Permission scopes automatically required for this client (for example, mobile-app permission - * scopes). Returns null when no scopes are required. - * - * @return requiredPermissionScopes - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUIRED_PERMISSION_SCOPES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getRequiredPermissionScopes() { - return requiredPermissionScopes; - } - - public void setRequiredPermissionScopes(List requiredPermissionScopes) { - this.requiredPermissionScopes = requiredPermissionScopes; - } - - public OAuthScopesRestrictionResponseAttributes scopesRestriction( - OAuthScopesRestriction scopesRestriction) { - this.scopesRestriction = scopesRestriction; - if (scopesRestriction != null) { - this.unparsed |= scopesRestriction.unparsed; - } - return this; - } - - /** - * Allowlist of OIDC and permission scopes enforced for the OAuth2 client. - * - * @return scopesRestriction - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SCOPES_RESTRICTION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OAuthScopesRestriction getScopesRestriction() { - return scopesRestriction; - } - - public void setScopesRestriction(OAuthScopesRestriction scopesRestriction) { - this.scopesRestriction = scopesRestriction; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return OAuthScopesRestrictionResponseAttributes - */ - @JsonAnySetter - public OAuthScopesRestrictionResponseAttributes putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this OAuthScopesRestrictionResponseAttributes object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthScopesRestrictionResponseAttributes oAuthScopesRestrictionResponseAttributes = - (OAuthScopesRestrictionResponseAttributes) o; - return Objects.equals( - this.requiredPermissionScopes, - oAuthScopesRestrictionResponseAttributes.requiredPermissionScopes) - && Objects.equals( - this.scopesRestriction, oAuthScopesRestrictionResponseAttributes.scopesRestriction) - && Objects.equals( - this.additionalProperties, - oAuthScopesRestrictionResponseAttributes.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(requiredPermissionScopes, scopesRestriction, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthScopesRestrictionResponseAttributes {\n"); - sb.append(" requiredPermissionScopes: ") - .append(toIndentedString(requiredPermissionScopes)) - .append("\n"); - sb.append(" scopesRestriction: ").append(toIndentedString(scopesRestriction)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseData.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseData.java deleted file mode 100644 index a9b84072a20..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseData.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * 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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; - -/** Data object of an OAuth2 client scopes restriction response. */ -@JsonPropertyOrder({ - OAuthScopesRestrictionResponseData.JSON_PROPERTY_ATTRIBUTES, - OAuthScopesRestrictionResponseData.JSON_PROPERTY_ID, - OAuthScopesRestrictionResponseData.JSON_PROPERTY_TYPE -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class OAuthScopesRestrictionResponseData { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private OAuthScopesRestrictionResponseAttributes attributes; - - public static final String JSON_PROPERTY_ID = "id"; - private UUID id; - - public static final String JSON_PROPERTY_TYPE = "type"; - private OAuthScopesRestrictionType type = OAuthScopesRestrictionType.SCOPES_RESTRICTION; - - public OAuthScopesRestrictionResponseData() {} - - @JsonCreator - public OAuthScopesRestrictionResponseData( - @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) - OAuthScopesRestrictionResponseAttributes attributes, - @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OAuthScopesRestrictionType type) { - this.attributes = attributes; - this.unparsed |= attributes.unparsed; - this.id = id; - this.type = type; - this.unparsed |= !type.isValid(); - } - - public OAuthScopesRestrictionResponseData attributes( - OAuthScopesRestrictionResponseAttributes attributes) { - this.attributes = attributes; - this.unparsed |= attributes.unparsed; - return this; - } - - /** - * Attributes of an OAuth2 client scopes restriction. - * - * @return attributes - */ - @JsonProperty(JSON_PROPERTY_ATTRIBUTES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OAuthScopesRestrictionResponseAttributes getAttributes() { - return attributes; - } - - public void setAttributes(OAuthScopesRestrictionResponseAttributes attributes) { - this.attributes = attributes; - } - - public OAuthScopesRestrictionResponseData id(UUID id) { - this.id = id; - return this; - } - - /** - * UUID of the OAuth2 client this restriction applies to. - * - * @return id - */ - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public UUID getId() { - return id; - } - - public void setId(UUID id) { - this.id = id; - } - - public OAuthScopesRestrictionResponseData type(OAuthScopesRestrictionType type) { - this.type = type; - this.unparsed |= !type.isValid(); - return this; - } - - /** - * JSON:API resource type for an OAuth2 client scopes restriction. - * - * @return type - */ - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OAuthScopesRestrictionType getType() { - return type; - } - - public void setType(OAuthScopesRestrictionType type) { - if (!type.isValid()) { - this.unparsed = true; - } - this.type = type; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return OAuthScopesRestrictionResponseData - */ - @JsonAnySetter - public OAuthScopesRestrictionResponseData putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this OAuthScopesRestrictionResponseData object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthScopesRestrictionResponseData oAuthScopesRestrictionResponseData = - (OAuthScopesRestrictionResponseData) o; - return Objects.equals(this.attributes, oAuthScopesRestrictionResponseData.attributes) - && Objects.equals(this.id, oAuthScopesRestrictionResponseData.id) - && Objects.equals(this.type, oAuthScopesRestrictionResponseData.type) - && Objects.equals( - this.additionalProperties, oAuthScopesRestrictionResponseData.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(attributes, id, type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthScopesRestrictionResponseData {\n"); - sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfigDestinationItem.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfigDestinationItem.java index da4cff438ab..5193145c7e6 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfigDestinationItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfigDestinationItem.java @@ -1379,6 +1379,60 @@ public ObservabilityPipelineConfigDestinationItem deserialize( e); } + // deserialize ObservabilityPipelineSplunkHecMetricsDestination + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ObservabilityPipelineSplunkHecMetricsDestination.class.equals(Integer.class) + || ObservabilityPipelineSplunkHecMetricsDestination.class.equals(Long.class) + || ObservabilityPipelineSplunkHecMetricsDestination.class.equals(Float.class) + || ObservabilityPipelineSplunkHecMetricsDestination.class.equals(Double.class) + || ObservabilityPipelineSplunkHecMetricsDestination.class.equals(Boolean.class) + || ObservabilityPipelineSplunkHecMetricsDestination.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ObservabilityPipelineSplunkHecMetricsDestination.class.equals(Integer.class) + || ObservabilityPipelineSplunkHecMetricsDestination.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ObservabilityPipelineSplunkHecMetricsDestination.class.equals(Float.class) + || ObservabilityPipelineSplunkHecMetricsDestination.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ObservabilityPipelineSplunkHecMetricsDestination.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ObservabilityPipelineSplunkHecMetricsDestination.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(ObservabilityPipelineSplunkHecMetricsDestination.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 (!((ObservabilityPipelineSplunkHecMetricsDestination) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'ObservabilityPipelineSplunkHecMetricsDestination'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'ObservabilityPipelineSplunkHecMetricsDestination'", + e); + } + ObservabilityPipelineConfigDestinationItem ret = new ObservabilityPipelineConfigDestinationItem(); if (match == 1) { @@ -1545,6 +1599,12 @@ public ObservabilityPipelineConfigDestinationItem( setActualInstance(o); } + public ObservabilityPipelineConfigDestinationItem( + ObservabilityPipelineSplunkHecMetricsDestination o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put( "ObservabilityPipelineElasticsearchDestination", @@ -1617,6 +1677,9 @@ public ObservabilityPipelineConfigDestinationItem( schemas.put( "ObservabilityPipelineDatadogMetricsDestination", new GenericType() {}); + schemas.put( + "ObservabilityPipelineSplunkHecMetricsDestination", + new GenericType() {}); JSON.registerDescendants( ObservabilityPipelineConfigDestinationItem.class, Collections.unmodifiableMap(schemas)); } @@ -1642,7 +1705,8 @@ public Map getSchemas() { * ObservabilityPipelineSentinelOneDestination, ObservabilityPipelineSocketDestination, * ObservabilityPipelineSplunkHecDestination, ObservabilityPipelineSumoLogicDestination, * ObservabilityPipelineSyslogNgDestination, ObservabilityPipelineDatabricksZerobusDestination, - * ObservabilityPipelineDatadogMetricsDestination + * ObservabilityPipelineDatadogMetricsDestination, + * ObservabilityPipelineSplunkHecMetricsDestination * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -1782,6 +1846,13 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf( + ObservabilityPipelineSplunkHecMetricsDestination.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { super.setActualInstance(instance); @@ -1809,7 +1880,8 @@ public void setActualInstance(Object instance) { + " ObservabilityPipelineSumoLogicDestination," + " ObservabilityPipelineSyslogNgDestination," + " ObservabilityPipelineDatabricksZerobusDestination," - + " ObservabilityPipelineDatadogMetricsDestination"); + + " ObservabilityPipelineDatadogMetricsDestination," + + " ObservabilityPipelineSplunkHecMetricsDestination"); } /** @@ -1828,7 +1900,8 @@ public void setActualInstance(Object instance) { * ObservabilityPipelineSentinelOneDestination, ObservabilityPipelineSocketDestination, * ObservabilityPipelineSplunkHecDestination, ObservabilityPipelineSumoLogicDestination, * ObservabilityPipelineSyslogNgDestination, ObservabilityPipelineDatabricksZerobusDestination, - * ObservabilityPipelineDatadogMetricsDestination + * ObservabilityPipelineDatadogMetricsDestination, + * ObservabilityPipelineSplunkHecMetricsDestination * * @return The actual instance (ObservabilityPipelineElasticsearchDestination, * ObservabilityPipelineHttpClientDestination, @@ -1847,7 +1920,8 @@ public void setActualInstance(Object instance) { * ObservabilityPipelineSplunkHecDestination, ObservabilityPipelineSumoLogicDestination, * ObservabilityPipelineSyslogNgDestination, * ObservabilityPipelineDatabricksZerobusDestination, - * ObservabilityPipelineDatadogMetricsDestination) + * ObservabilityPipelineDatadogMetricsDestination, + * ObservabilityPipelineSplunkHecMetricsDestination) */ @Override public Object getActualInstance() { @@ -2173,4 +2247,18 @@ public ObservabilityPipelineSyslogNgDestination getObservabilityPipelineSyslogNg getObservabilityPipelineDatadogMetricsDestination() throws ClassCastException { return (ObservabilityPipelineDatadogMetricsDestination) super.getActualInstance(); } + + /** + * Get the actual instance of `ObservabilityPipelineSplunkHecMetricsDestination`. If the actual + * instance is not `ObservabilityPipelineSplunkHecMetricsDestination`, the ClassCastException will + * be thrown. + * + * @return The actual instance of `ObservabilityPipelineSplunkHecMetricsDestination` + * @throws ClassCastException if the instance is not + * `ObservabilityPipelineSplunkHecMetricsDestination` + */ + public ObservabilityPipelineSplunkHecMetricsDestination + getObservabilityPipelineSplunkHecMetricsDestination() throws ClassCastException { + return (ObservabilityPipelineSplunkHecMetricsDestination) super.getActualInstance(); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestination.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestination.java new file mode 100644 index 00000000000..82d2586f1b4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestination.java @@ -0,0 +1,499 @@ +/* + * 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.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * The splunk_hec_metrics destination forwards metrics to Splunk using the HTTP Event + * Collector (HEC). + * + *

Supported pipeline types: metrics + */ +@JsonPropertyOrder({ + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_BUFFER, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_COMPRESSION, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_DEFAULT_NAMESPACE, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_ENDPOINT_URL_KEY, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_ID, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_INDEX, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_INPUTS, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_SOURCE, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_SOURCETYPE, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_TLS, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_TOKEN_KEY, + ObservabilityPipelineSplunkHecMetricsDestination.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineSplunkHecMetricsDestination { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BUFFER = "buffer"; + private ObservabilityPipelineBufferOptions buffer; + + public static final String JSON_PROPERTY_COMPRESSION = "compression"; + private ObservabilityPipelineSplunkHecMetricsDestinationCompression compression = + ObservabilityPipelineSplunkHecMetricsDestinationCompression.NONE; + + public static final String JSON_PROPERTY_DEFAULT_NAMESPACE = "default_namespace"; + private String defaultNamespace; + + public static final String JSON_PROPERTY_ENDPOINT_URL_KEY = "endpoint_url_key"; + private String endpointUrlKey; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_INDEX = "index"; + private String index; + + public static final String JSON_PROPERTY_INPUTS = "inputs"; + private List inputs = new ArrayList<>(); + + public static final String JSON_PROPERTY_SOURCE = "source"; + private String source; + + public static final String JSON_PROPERTY_SOURCETYPE = "sourcetype"; + private String sourcetype; + + public static final String JSON_PROPERTY_TLS = "tls"; + private ObservabilityPipelineTls tls; + + public static final String JSON_PROPERTY_TOKEN_KEY = "token_key"; + private String tokenKey; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ObservabilityPipelineSplunkHecMetricsDestinationType type = + ObservabilityPipelineSplunkHecMetricsDestinationType.SPLUNK_HEC_METRICS; + + public ObservabilityPipelineSplunkHecMetricsDestination() {} + + @JsonCreator + public ObservabilityPipelineSplunkHecMetricsDestination( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_INPUTS) List inputs, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ObservabilityPipelineSplunkHecMetricsDestinationType type) { + this.id = id; + this.inputs = inputs; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ObservabilityPipelineSplunkHecMetricsDestination buffer( + ObservabilityPipelineBufferOptions buffer) { + this.buffer = buffer; + this.unparsed |= buffer.unparsed; + return this; + } + + /** + * Configuration for buffer settings on destination components. + * + * @return buffer + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUFFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ObservabilityPipelineBufferOptions getBuffer() { + return buffer; + } + + public void setBuffer(ObservabilityPipelineBufferOptions buffer) { + this.buffer = buffer; + } + + public ObservabilityPipelineSplunkHecMetricsDestination compression( + ObservabilityPipelineSplunkHecMetricsDestinationCompression compression) { + this.compression = compression; + this.unparsed |= !compression.isValid(); + return this; + } + + /** + * Compression algorithm applied when sending metrics to Splunk HEC. + * + * @return compression + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPRESSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ObservabilityPipelineSplunkHecMetricsDestinationCompression getCompression() { + return compression; + } + + public void setCompression( + ObservabilityPipelineSplunkHecMetricsDestinationCompression compression) { + if (!compression.isValid()) { + this.unparsed = true; + } + this.compression = compression; + } + + public ObservabilityPipelineSplunkHecMetricsDestination defaultNamespace( + String defaultNamespace) { + this.defaultNamespace = defaultNamespace; + return this; + } + + /** + * Optional default namespace for metrics sent to Splunk HEC. + * + * @return defaultNamespace + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_NAMESPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefaultNamespace() { + return defaultNamespace; + } + + public void setDefaultNamespace(String defaultNamespace) { + this.defaultNamespace = defaultNamespace; + } + + public ObservabilityPipelineSplunkHecMetricsDestination endpointUrlKey(String endpointUrlKey) { + this.endpointUrlKey = endpointUrlKey; + return this; + } + + /** + * Name of the environment variable or secret that holds the Splunk HEC endpoint URL. + * + * @return endpointUrlKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDPOINT_URL_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndpointUrlKey() { + return endpointUrlKey; + } + + public void setEndpointUrlKey(String endpointUrlKey) { + this.endpointUrlKey = endpointUrlKey; + } + + public ObservabilityPipelineSplunkHecMetricsDestination id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier for this component. Used in other parts of the pipeline to reference this + * component (for example, as the input to downstream components). + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ObservabilityPipelineSplunkHecMetricsDestination index(String index) { + this.index = index; + return this; + } + + /** + * Optional name of the Splunk index where metrics are written. + * + * @return index + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndex() { + return index; + } + + public void setIndex(String index) { + this.index = index; + } + + public ObservabilityPipelineSplunkHecMetricsDestination inputs(List inputs) { + this.inputs = inputs; + return this; + } + + public ObservabilityPipelineSplunkHecMetricsDestination addInputsItem(String inputsItem) { + this.inputs.add(inputsItem); + return this; + } + + /** + * A list of component IDs whose output is used as the input for this component. + * + * @return inputs + */ + @JsonProperty(JSON_PROPERTY_INPUTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getInputs() { + return inputs; + } + + public void setInputs(List inputs) { + this.inputs = inputs; + } + + public ObservabilityPipelineSplunkHecMetricsDestination source(String source) { + this.source = source; + return this; + } + + /** + * The Splunk source field value for metric events. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public ObservabilityPipelineSplunkHecMetricsDestination sourcetype(String sourcetype) { + this.sourcetype = sourcetype; + return this; + } + + /** + * The Splunk sourcetype to assign to metric events. + * + * @return sourcetype + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCETYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourcetype() { + return sourcetype; + } + + public void setSourcetype(String sourcetype) { + this.sourcetype = sourcetype; + } + + public ObservabilityPipelineSplunkHecMetricsDestination tls(ObservabilityPipelineTls tls) { + this.tls = tls; + this.unparsed |= tls.unparsed; + return this; + } + + /** + * Configuration for enabling TLS encryption between the pipeline component and external services. + * + * @return tls + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ObservabilityPipelineTls getTls() { + return tls; + } + + public void setTls(ObservabilityPipelineTls tls) { + this.tls = tls; + } + + public ObservabilityPipelineSplunkHecMetricsDestination tokenKey(String tokenKey) { + this.tokenKey = tokenKey; + return this; + } + + /** + * Name of the environment variable or secret that holds the Splunk HEC token. + * + * @return tokenKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOKEN_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTokenKey() { + return tokenKey; + } + + public void setTokenKey(String tokenKey) { + this.tokenKey = tokenKey; + } + + public ObservabilityPipelineSplunkHecMetricsDestination type( + ObservabilityPipelineSplunkHecMetricsDestinationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The destination type. Always splunk_hec_metrics. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineSplunkHecMetricsDestinationType getType() { + return type; + } + + public void setType(ObservabilityPipelineSplunkHecMetricsDestinationType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ObservabilityPipelineSplunkHecMetricsDestination + */ + @JsonAnySetter + public ObservabilityPipelineSplunkHecMetricsDestination putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ObservabilityPipelineSplunkHecMetricsDestination object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineSplunkHecMetricsDestination + observabilityPipelineSplunkHecMetricsDestination = + (ObservabilityPipelineSplunkHecMetricsDestination) o; + return Objects.equals(this.buffer, observabilityPipelineSplunkHecMetricsDestination.buffer) + && Objects.equals( + this.compression, observabilityPipelineSplunkHecMetricsDestination.compression) + && Objects.equals( + this.defaultNamespace, + observabilityPipelineSplunkHecMetricsDestination.defaultNamespace) + && Objects.equals( + this.endpointUrlKey, observabilityPipelineSplunkHecMetricsDestination.endpointUrlKey) + && Objects.equals(this.id, observabilityPipelineSplunkHecMetricsDestination.id) + && Objects.equals(this.index, observabilityPipelineSplunkHecMetricsDestination.index) + && Objects.equals(this.inputs, observabilityPipelineSplunkHecMetricsDestination.inputs) + && Objects.equals(this.source, observabilityPipelineSplunkHecMetricsDestination.source) + && Objects.equals( + this.sourcetype, observabilityPipelineSplunkHecMetricsDestination.sourcetype) + && Objects.equals(this.tls, observabilityPipelineSplunkHecMetricsDestination.tls) + && Objects.equals(this.tokenKey, observabilityPipelineSplunkHecMetricsDestination.tokenKey) + && Objects.equals(this.type, observabilityPipelineSplunkHecMetricsDestination.type) + && Objects.equals( + this.additionalProperties, + observabilityPipelineSplunkHecMetricsDestination.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + buffer, + compression, + defaultNamespace, + endpointUrlKey, + id, + index, + inputs, + source, + sourcetype, + tls, + tokenKey, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineSplunkHecMetricsDestination {\n"); + sb.append(" buffer: ").append(toIndentedString(buffer)).append("\n"); + sb.append(" compression: ").append(toIndentedString(compression)).append("\n"); + sb.append(" defaultNamespace: ").append(toIndentedString(defaultNamespace)).append("\n"); + sb.append(" endpointUrlKey: ").append(toIndentedString(endpointUrlKey)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" sourcetype: ").append(toIndentedString(sourcetype)).append("\n"); + sb.append(" tls: ").append(toIndentedString(tls)).append("\n"); + sb.append(" tokenKey: ").append(toIndentedString(tokenKey)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestinationCompression.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestinationCompression.java new file mode 100644 index 00000000000..b955aa651fd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestinationCompression.java @@ -0,0 +1,66 @@ +/* + * 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.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Compression algorithm applied when sending metrics to Splunk HEC. */ +@JsonSerialize( + using = + ObservabilityPipelineSplunkHecMetricsDestinationCompression + .ObservabilityPipelineSplunkHecMetricsDestinationCompressionSerializer.class) +public class ObservabilityPipelineSplunkHecMetricsDestinationCompression extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("none", "gzip")); + + public static final ObservabilityPipelineSplunkHecMetricsDestinationCompression NONE = + new ObservabilityPipelineSplunkHecMetricsDestinationCompression("none"); + public static final ObservabilityPipelineSplunkHecMetricsDestinationCompression GZIP = + new ObservabilityPipelineSplunkHecMetricsDestinationCompression("gzip"); + + ObservabilityPipelineSplunkHecMetricsDestinationCompression(String value) { + super(value, allowedValues); + } + + public static class ObservabilityPipelineSplunkHecMetricsDestinationCompressionSerializer + extends StdSerializer { + public ObservabilityPipelineSplunkHecMetricsDestinationCompressionSerializer( + Class t) { + super(t); + } + + public ObservabilityPipelineSplunkHecMetricsDestinationCompressionSerializer() { + this(null); + } + + @Override + public void serialize( + ObservabilityPipelineSplunkHecMetricsDestinationCompression value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ObservabilityPipelineSplunkHecMetricsDestinationCompression fromValue( + String value) { + return new ObservabilityPipelineSplunkHecMetricsDestinationCompression(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestinationType.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestinationType.java new file mode 100644 index 00000000000..bfe5654796e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineSplunkHecMetricsDestinationType.java @@ -0,0 +1,63 @@ +/* + * 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.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The destination type. Always splunk_hec_metrics. */ +@JsonSerialize( + using = + ObservabilityPipelineSplunkHecMetricsDestinationType + .ObservabilityPipelineSplunkHecMetricsDestinationTypeSerializer.class) +public class ObservabilityPipelineSplunkHecMetricsDestinationType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("splunk_hec_metrics")); + + public static final ObservabilityPipelineSplunkHecMetricsDestinationType SPLUNK_HEC_METRICS = + new ObservabilityPipelineSplunkHecMetricsDestinationType("splunk_hec_metrics"); + + ObservabilityPipelineSplunkHecMetricsDestinationType(String value) { + super(value, allowedValues); + } + + public static class ObservabilityPipelineSplunkHecMetricsDestinationTypeSerializer + extends StdSerializer { + public ObservabilityPipelineSplunkHecMetricsDestinationTypeSerializer( + Class t) { + super(t); + } + + public ObservabilityPipelineSplunkHecMetricsDestinationTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ObservabilityPipelineSplunkHecMetricsDestinationType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ObservabilityPipelineSplunkHecMetricsDestinationType fromValue(String value) { + return new ObservabilityPipelineSplunkHecMetricsDestinationType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionDataAttributes.java deleted file mode 100644 index fe96f0090b6..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionDataAttributes.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Attributes of an upsert OAuth2 scopes restriction request. */ -@JsonPropertyOrder({ - UpsertOAuthScopesRestrictionDataAttributes.JSON_PROPERTY_OIDC_SCOPES, - UpsertOAuthScopesRestrictionDataAttributes.JSON_PROPERTY_PERMISSION_SCOPES -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class UpsertOAuthScopesRestrictionDataAttributes { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_OIDC_SCOPES = "oidc_scopes"; - private List oidcScopes = null; - - public static final String JSON_PROPERTY_PERMISSION_SCOPES = "permission_scopes"; - private List permissionScopes = null; - - public UpsertOAuthScopesRestrictionDataAttributes oidcScopes(List oidcScopes) { - this.oidcScopes = oidcScopes; - return this; - } - - public UpsertOAuthScopesRestrictionDataAttributes addOidcScopesItem( - OAuthOidcScope oidcScopesItem) { - if (this.oidcScopes == null) { - this.oidcScopes = new ArrayList<>(); - } - this.oidcScopes.add(oidcScopesItem); - this.unparsed |= !oidcScopesItem.isValid(); - return this; - } - - /** - * OIDC scopes the client is allowed to request. - * - * @return oidcScopes - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OIDC_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getOidcScopes() { - return oidcScopes; - } - - public void setOidcScopes(List oidcScopes) { - this.oidcScopes = oidcScopes; - } - - public UpsertOAuthScopesRestrictionDataAttributes permissionScopes( - List permissionScopes) { - this.permissionScopes = permissionScopes; - return this; - } - - public UpsertOAuthScopesRestrictionDataAttributes addPermissionScopesItem( - String permissionScopesItem) { - if (this.permissionScopes == null) { - this.permissionScopes = new ArrayList<>(); - } - this.permissionScopes.add(permissionScopesItem); - return this; - } - - /** - * Datadog permission scopes the client is allowed to request. Each value must be a valid - * permission name. - * - * @return permissionScopes - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PERMISSION_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPermissionScopes() { - return permissionScopes; - } - - public void setPermissionScopes(List permissionScopes) { - this.permissionScopes = permissionScopes; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return UpsertOAuthScopesRestrictionDataAttributes - */ - @JsonAnySetter - public UpsertOAuthScopesRestrictionDataAttributes putAdditionalProperty( - String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - * - * @return The additional properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * - * @param key The arbitrary key to get - * @return The specific additional property for the given key - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this UpsertOAuthScopesRestrictionDataAttributes object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpsertOAuthScopesRestrictionDataAttributes upsertOAuthScopesRestrictionDataAttributes = - (UpsertOAuthScopesRestrictionDataAttributes) o; - return Objects.equals(this.oidcScopes, upsertOAuthScopesRestrictionDataAttributes.oidcScopes) - && Objects.equals( - this.permissionScopes, upsertOAuthScopesRestrictionDataAttributes.permissionScopes) - && Objects.equals( - this.additionalProperties, - upsertOAuthScopesRestrictionDataAttributes.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(oidcScopes, permissionScopes, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpsertOAuthScopesRestrictionDataAttributes {\n"); - sb.append(" oidcScopes: ").append(toIndentedString(oidcScopes)).append("\n"); - sb.append(" permissionScopes: ").append(toIndentedString(permissionScopes)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionType.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionType.java deleted file mode 100644 index 496c21c8947..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionType.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.ModelEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** JSON:API resource type for an upsert OAuth2 client scopes restriction request. */ -@JsonSerialize( - using = UpsertOAuthScopesRestrictionType.UpsertOAuthScopesRestrictionTypeSerializer.class) -public class UpsertOAuthScopesRestrictionType extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("upsert_scopes_restriction")); - - public static final UpsertOAuthScopesRestrictionType UPSERT_SCOPES_RESTRICTION = - new UpsertOAuthScopesRestrictionType("upsert_scopes_restriction"); - - UpsertOAuthScopesRestrictionType(String value) { - super(value, allowedValues); - } - - public static class UpsertOAuthScopesRestrictionTypeSerializer - extends StdSerializer { - public UpsertOAuthScopesRestrictionTypeSerializer(Class t) { - super(t); - } - - public UpsertOAuthScopesRestrictionTypeSerializer() { - this(null); - } - - @Override - public void serialize( - UpsertOAuthScopesRestrictionType value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static UpsertOAuthScopesRestrictionType fromValue(String value) { - return new UpsertOAuthScopesRestrictionType(value); - } -} diff --git a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature index 17779e4599e..b41928f4cb9 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature @@ -606,6 +606,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag metadata months returns "Bad Request" response + Given operation "ListCostTagMetadataMonths" enabled + And new "ListCostTagMetadataMonths" request + And request contains "filter[provider]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag metadata months returns "OK" response + Given operation "ListCostTagMetadataMonths" enabled + And new "ListCostTagMetadataMonths" request + And request contains "filter[provider]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management tag sources returns "Bad Request" response Given operation "ListCostTagKeySources" enabled diff --git a/src/test/resources/com/datadog/api/client/v2/api/oauth2_client_public.feature b/src/test/resources/com/datadog/api/client/v2/api/oauth2_client_public.feature deleted file mode 100644 index a5c7d195efa..00000000000 --- a/src/test/resources/com/datadog/api/client/v2/api/oauth2_client_public.feature +++ /dev/null @@ -1,100 +0,0 @@ -@endpoint(oauth2-client-public) @endpoint(oauth2-client-public-v2) -Feature: OAuth2 Client Public - Configure OAuth2 clients for Datadog. Supports RFC 7591 Dynamic Client - Registration and management of OAuth2 client scopes restrictions. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "OAuth2ClientPublic" API - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Delete an OAuth2 client scopes restriction returns "Bad Request" response - Given operation "DeleteScopesRestriction" enabled - And new "DeleteScopesRestriction" request - And request contains "client_uuid" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Delete an OAuth2 client scopes restriction returns "No Content" response - Given operation "DeleteScopesRestriction" enabled - And new "DeleteScopesRestriction" request - And request contains "client_uuid" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 204 No Content - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Delete an OAuth2 client scopes restriction returns "Not Found" response - Given operation "DeleteScopesRestriction" enabled - And new "DeleteScopesRestriction" request - And request contains "client_uuid" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Get an OAuth2 client scopes restriction returns "Bad Request" response - Given operation "GetScopesRestriction" enabled - And new "GetScopesRestriction" request - And request contains "client_uuid" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Get an OAuth2 client scopes restriction returns "Not Found" response - Given operation "GetScopesRestriction" enabled - And new "GetScopesRestriction" request - And request contains "client_uuid" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Get an OAuth2 client scopes restriction returns "OK" response - Given operation "GetScopesRestriction" enabled - And new "GetScopesRestriction" request - And request contains "client_uuid" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Register an OAuth2 client returns "Bad Request" response - Given operation "RegisterOAuthClient" enabled - And new "RegisterOAuthClient" request - And body with value {"client_name": "Example MCP Client", "client_uri": "https://example.com", "grant_types": ["authorization_code", "refresh_token"], "jwks_uri": "https://example.com/.well-known/jwks.json", "logo_uri": "https://example.com/logo.png", "policy_uri": "https://example.com/privacy", "redirect_uris": ["https://example.com/oauth/callback"], "response_types": ["code"], "scope": "openid profile", "token_endpoint_auth_method": "none", "tos_uri": "https://example.com/tos"} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Register an OAuth2 client returns "Created" response - Given operation "RegisterOAuthClient" enabled - And new "RegisterOAuthClient" request - And body with value {"client_name": "Example MCP Client", "client_uri": "https://example.com", "grant_types": ["authorization_code", "refresh_token"], "jwks_uri": "https://example.com/.well-known/jwks.json", "logo_uri": "https://example.com/logo.png", "policy_uri": "https://example.com/privacy", "redirect_uris": ["https://example.com/oauth/callback"], "response_types": ["code"], "scope": "openid profile", "token_endpoint_auth_method": "none", "tos_uri": "https://example.com/tos"} - When the request is sent - Then the response status is 201 Created - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Upsert an OAuth2 client scopes restriction returns "Bad Request" response - Given operation "UpsertScopesRestriction" enabled - And new "UpsertScopesRestriction" request - And request contains "client_uuid" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Upsert an OAuth2 client scopes restriction returns "Not Found" response - Given operation "UpsertScopesRestriction" enabled - And new "UpsertScopesRestriction" request - And request contains "client_uuid" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/delegated-auth-login - Scenario: Upsert an OAuth2 client scopes restriction returns "OK" response - Given operation "UpsertScopesRestriction" enabled - And new "UpsertScopesRestriction" request - And request contains "client_uuid" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} - When the request is sent - Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index b55e20fd7eb..09d6acff288 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1898,6 +1898,12 @@ "type": "safe" } }, + "ListCostTagMetadataMonths": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagMetadataOrchestrators": { "tag": "Cloud Cost Management", "undo": { @@ -4666,30 +4672,6 @@ "type": "safe" } }, - "DeleteScopesRestriction": { - "tag": "OAuth2 Client Public", - "undo": { - "type": "idempotent" - } - }, - "GetScopesRestriction": { - "tag": "OAuth2 Client Public", - "undo": { - "type": "safe" - } - }, - "UpsertScopesRestriction": { - "tag": "OAuth2 Client Public", - "undo": { - "type": "idempotent" - } - }, - "RegisterOAuthClient": { - "tag": "OAuth2 Client Public", - "undo": { - "type": "idempotent" - } - }, "ListPipelines": { "tag": "Observability Pipelines", "undo": {