diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index dede702aea7..bc16917af1e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1034,6 +1034,15 @@ 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" @@ -19553,6 +19562,25 @@ components: - tag_key - updated_at type: object + CostTagDescriptionResponse: + description: Single Cloud Cost Management tag key description returned by the get-by-key endpoint. + example: + data: + attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: cost_tag_description + properties: + data: + $ref: "#/components/schemas/CostTagDescription" + required: + - data + type: object CostTagDescriptionSource: description: Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog. enum: @@ -19574,6 +19602,50 @@ components: type: string x-enum-varnames: - COST_TAG_DESCRIPTION + CostTagDescriptionUpsertRequest: + description: Request body for creating or updating a Cloud Cost Management tag key description. + example: + data: + attributes: + cloud: aws + description: AWS account that owns this cost. + id: account_id + type: cost_tag_description + properties: + data: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequestData" + required: + - data + type: object + CostTagDescriptionUpsertRequestData: + description: Resource envelope carrying the tag key description being upserted. The `id` is informational; the authoritative tag key is taken from the URL path. + properties: + attributes: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequestDataAttributes" + id: + description: Identifier of the tag key the description applies to. Matches the `tag_key` path parameter. + example: account_id + type: string + type: + $ref: "#/components/schemas/CostTagDescriptionType" + required: + - attributes + - type + type: object + CostTagDescriptionUpsertRequestDataAttributes: + description: Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + properties: + cloud: + description: Cloud provider this description applies to (for example, `aws`). Omit to set the cross-cloud default for the tag key. + example: aws + type: string + description: + description: The human-readable description for the tag key. + example: AWS account that owns this cost. + type: string + required: + - description + type: object CostTagDescriptionsResponse: description: List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider. example: @@ -35598,6 +35670,55 @@ components: required: - type type: object + GenerateCostTagDescriptionResponse: + description: Response wrapping an AI-generated Cloud Cost Management tag key description. + example: + data: + attributes: + description: AWS account that owns this cost. + id: account_id + type: cost_generated_tag_description + properties: + data: + $ref: "#/components/schemas/GeneratedCostTagDescription" + required: + - data + type: object + GeneratedCostTagDescription: + description: AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The result is returned to the client but is not persisted by this endpoint. + properties: + attributes: + $ref: "#/components/schemas/GeneratedCostTagDescriptionAttributes" + id: + description: The tag key the AI description was generated for. + example: account_id + type: string + type: + $ref: "#/components/schemas/GeneratedCostTagDescriptionType" + required: + - attributes + - id + - type + type: object + GeneratedCostTagDescriptionAttributes: + description: Attributes of an AI-generated Cloud Cost Management tag key description. + properties: + description: + description: The AI-generated description for the tag key. + example: AWS account that owns this cost. + type: string + required: + - description + type: object + GeneratedCostTagDescriptionType: + default: cost_generated_tag_description + description: Type of the AI-generated Cloud Cost Management tag description resource. + enum: + - cost_generated_tag_description + example: cost_generated_tag_description + type: string + x-enum-varnames: + - COST_GENERATED_TAG_DESCRIPTION GetActionConnectionResponse: description: The response for found connection properties: @@ -54649,6 +54770,256 @@ 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: @@ -92269,6 +92640,57 @@ 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: @@ -110944,6 +111366,226 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_descriptions/{tag_key}: + delete: + description: Delete a Cloud Cost Management tag key description. When `cloud` is omitted, deletes every description for the tag key, falling back to Datadog's global default when available. When `cloud` is provided, deletes only the description scoped to that cloud provider. + operationId: DeleteCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being deleted. + in: path + name: tag_key + required: true + schema: + type: string + - description: Cloud provider to scope the deletion to (for example, `aws`). Omit to delete every description for the tag key. + in: query + name: cloud + required: false + schema: + type: string + responses: + "204": + description: No Content + "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_write + summary: Delete a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write + get: + description: Get the Cloud Cost Management description for a single tag key. Use `filter[cloud]` to scope the lookup to a specific cloud provider; when omitted, the response resolves the description in fallback order (cloud-specific organization override, then cloudless organization default, then Datadog's global default). + operationId: GetCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being fetched. + in: path + name: tag_key + required: true + schema: + type: string + - description: Cloud provider to scope the lookup to (for example, `aws`). Omit to use the resolved fallback. + in: query + name: filter[cloud] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cloud: aws + created_at: "2026-01-01T12:00:00Z" + description: AWS account that owns this cost. + source: human + tag_key: account_id + updated_at: "2026-01-01T12:00:00Z" + id: account_id + type: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + put: + description: Create or update a Cloud Cost Management tag key description. The new description and optional cloud scoping are supplied in the request body. Omit `cloud` to set a cross-cloud default for the tag key. + operationId: UpsertCostTagDescriptionByKey + parameters: + - description: The tag key whose description is being upserted. + in: path + name: tag_key + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cloud: aws + description: AWS account that owns this cost. + id: account_id + type: cost_tag_description + schema: + $ref: "#/components/schemas/CostTagDescriptionUpsertRequest" + required: true + responses: + "204": + description: No Content + "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_write + summary: Upsert a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write + /api/v2/cost/tag_descriptions/{tag_key}/generate: + get: + description: Use AI to draft a Cloud Cost Management tag key description based on associated cost data. The generated description is returned in the response and is not persisted by this endpoint; follow up with `UpsertCostTagDescriptionByKey` to save it. + operationId: GenerateCostTagDescriptionByKey + parameters: + - description: The tag key to generate an AI description for. + in: path + name: tag_key + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: AWS account that owns this cost. + id: account_id + type: cost_generated_tag_description + schema: + $ref: "#/components/schemas/GenerateCostTagDescriptionResponse" + 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: Generate a Cloud Cost Management tag description + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read /api/v2/cost/tag_keys: get: description: List Cloud Cost Management tag keys. @@ -134428,6 +135070,223 @@ 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. @@ -167842,6 +168701,10 @@ 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/DeleteCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java new file mode 100644 index 00000000000..3d8b97aa170 --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.java @@ -0,0 +1,23 @@ +// Delete a Cloud Cost Management tag description returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + apiInstance.deleteCostTagDescriptionByKey("tag_key"); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#deleteCostTagDescriptionByKey"); + 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/cloud-cost-management/GenerateCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java new file mode 100644 index 00000000000..b2968547235 --- /dev/null +++ b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.java @@ -0,0 +1,26 @@ +// Generate a Cloud Cost Management tag description 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.GenerateCostTagDescriptionResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + GenerateCostTagDescriptionResponse result = + apiInstance.generateCostTagDescriptionByKey("tag_key"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#generateCostTagDescriptionByKey"); + 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/cloud-cost-management/GetCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java new file mode 100644 index 00000000000..ebeea18f5de --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.java @@ -0,0 +1,25 @@ +// Get a Cloud Cost Management tag description 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.CostTagDescriptionResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CostTagDescriptionResponse result = apiInstance.getCostTagDescriptionByKey("tag_key"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCostTagDescriptionByKey"); + 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/cloud-cost-management/UpsertCostTagDescriptionByKey.java b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java new file mode 100644 index 00000000000..c2566ee1d00 --- /dev/null +++ b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.java @@ -0,0 +1,38 @@ +// Upsert a Cloud Cost Management tag description returns "No Content" 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.CostTagDescriptionType; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequest; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequestData; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequestDataAttributes; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + CostTagDescriptionUpsertRequest body = + new CostTagDescriptionUpsertRequest() + .data( + new CostTagDescriptionUpsertRequestData() + .attributes( + new CostTagDescriptionUpsertRequestDataAttributes() + .cloud("aws") + .description("AWS account that owns this cost.")) + .id("account_id") + .type(CostTagDescriptionType.COST_TAG_DESCRIPTION)); + + try { + apiInstance.upsertCostTagDescriptionByKey("tag_key", body); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#upsertCostTagDescriptionByKey"); + 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 new file mode 100644 index 00000000000..602fee9fd1f --- /dev/null +++ b/examples/v2/oauth2-client-public/DeleteScopesRestriction.java @@ -0,0 +1,24 @@ +// 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 new file mode 100644 index 00000000000..b5292323a93 --- /dev/null +++ b/examples/v2/oauth2-client-public/GetScopesRestriction.java @@ -0,0 +1,27 @@ +// 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 new file mode 100644 index 00000000000..efb5b182175 --- /dev/null +++ b/examples/v2/oauth2-client-public/RegisterOAuthClient.java @@ -0,0 +1,47 @@ +// 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 new file mode 100644 index 00000000000..7a94c0d1f16 --- /dev/null +++ b/examples/v2/oauth2-client-public/UpsertScopesRestriction.java @@ -0,0 +1,44 @@ +// 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 7efc53e4b9b..98cec9dd248 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1086,6 +1086,10 @@ 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 940a2bbaac5..27c0d3e2f8d 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 @@ -36,6 +36,8 @@ import com.datadog.api.client.v2.model.CostMetricsResponse; import com.datadog.api.client.v2.model.CostOrchestratorsResponse; import com.datadog.api.client.v2.model.CostRecommendationArray; +import com.datadog.api.client.v2.model.CostTagDescriptionResponse; +import com.datadog.api.client.v2.model.CostTagDescriptionUpsertRequest; import com.datadog.api.client.v2.model.CostTagDescriptionsResponse; import com.datadog.api.client.v2.model.CostTagKeyMetadataResponse; import com.datadog.api.client.v2.model.CostTagKeyResponse; @@ -54,6 +56,7 @@ import com.datadog.api.client.v2.model.GCPUsageCostConfigResponse; import com.datadog.api.client.v2.model.GCPUsageCostConfigsResponse; import com.datadog.api.client.v2.model.GcpUcConfigResponse; +import com.datadog.api.client.v2.model.GenerateCostTagDescriptionResponse; import com.datadog.api.client.v2.model.OCIConfigsResponse; import com.datadog.api.client.v2.model.RecommendationsFilterRequest; import com.datadog.api.client.v2.model.ReorderRuleResourceArray; @@ -1336,6 +1339,209 @@ public CompletableFuture> deleteCostGCPUsageCostConfigWithHttp null); } + /** Manage optional parameters to deleteCostTagDescriptionByKey. */ + public static class DeleteCostTagDescriptionByKeyOptionalParameters { + private String cloud; + + /** + * Set cloud. + * + * @param cloud Cloud provider to scope the deletion to (for example, aws). Omit to + * delete every description for the tag key. (optional) + * @return DeleteCostTagDescriptionByKeyOptionalParameters + */ + public DeleteCostTagDescriptionByKeyOptionalParameters cloud(String cloud) { + this.cloud = cloud; + return this; + } + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @throws ApiException if fails to make API call + */ + public void deleteCostTagDescriptionByKey(String tagKey) throws ApiException { + deleteCostTagDescriptionByKeyWithHttpInfo( + tagKey, new DeleteCostTagDescriptionByKeyOptionalParameters()); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteCostTagDescriptionByKeyAsync(String tagKey) { + return deleteCostTagDescriptionByKeyWithHttpInfoAsync( + tagKey, new DeleteCostTagDescriptionByKeyOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @throws ApiException if fails to make API call + */ + public void deleteCostTagDescriptionByKey( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) + throws ApiException { + deleteCostTagDescriptionByKeyWithHttpInfo(tagKey, parameters); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture + */ + public CompletableFuture deleteCostTagDescriptionByKeyAsync( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) { + return deleteCostTagDescriptionByKeyWithHttpInfoAsync(tagKey, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a Cloud Cost Management tag key description. When cloud is omitted, deletes + * every description for the tag key, falling back to Datadog's global default when available. + * When cloud is provided, deletes only the description scoped to that cloud + * provider. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @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 -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse deleteCostTagDescriptionByKeyWithHttpInfo( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling deleteCostTagDescriptionByKey"); + } + String cloud = parameters.cloud; + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud", cloud)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.deleteCostTagDescriptionByKey", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a Cloud Cost Management tag description. + * + *

See {@link #deleteCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being deleted. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteCostTagDescriptionByKeyWithHttpInfoAsync( + String tagKey, DeleteCostTagDescriptionByKeyOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling" + + " deleteCostTagDescriptionByKey")); + return result; + } + String cloud = parameters.cloud; + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud", cloud)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.deleteCostTagDescriptionByKey", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Delete custom allocation rule. * @@ -1734,6 +1940,150 @@ public CompletableFuture> deleteTagPipelinesRulesetWithHttpInf null); } + /** + * Generate a Cloud Cost Management tag description. + * + *

See {@link #generateCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return GenerateCostTagDescriptionResponse + * @throws ApiException if fails to make API call + */ + public GenerateCostTagDescriptionResponse generateCostTagDescriptionByKey(String tagKey) + throws ApiException { + return generateCostTagDescriptionByKeyWithHttpInfo(tagKey).getData(); + } + + /** + * Generate a Cloud Cost Management tag description. + * + *

See {@link #generateCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return CompletableFuture<GenerateCostTagDescriptionResponse> + */ + public CompletableFuture generateCostTagDescriptionByKeyAsync( + String tagKey) { + return generateCostTagDescriptionByKeyWithHttpInfoAsync(tagKey) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Use AI to draft a Cloud Cost Management tag key description based on associated cost data. The + * generated description is returned in the response and is not persisted by this endpoint; follow + * up with UpsertCostTagDescriptionByKey to save it. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return ApiResponse<GenerateCostTagDescriptionResponse> + * @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 + generateCostTagDescriptionByKeyWithHttpInfo(String tagKey) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling generateCostTagDescriptionByKey"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}/generate" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.generateCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Generate a Cloud Cost Management tag description. + * + *

See {@link #generateCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key to generate an AI description for. (required) + * @return CompletableFuture<ApiResponse<GenerateCostTagDescriptionResponse>> + */ + public CompletableFuture> + generateCostTagDescriptionByKeyWithHttpInfoAsync(String tagKey) { + Object localVarPostBody = null; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling" + + " generateCostTagDescriptionByKey")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}/generate" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.generateCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get budget. * @@ -4879,33 +5229,174 @@ public ApiResponse getCostAzureUCConfigWithHttpInfo(Long cloudAcco localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** + * Get cost Azure UC config. + * + *

See {@link #getCostAzureUCConfigWithHttpInfo}. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return CompletableFuture<ApiResponse<UCConfigPair>> + */ + public CompletableFuture> getCostAzureUCConfigWithHttpInfoAsync( + Long cloudAccountId) { + Object localVarPostBody = null; + + // verify the required parameter 'cloudAccountId' is set + if (cloudAccountId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'cloudAccountId' when calling getCostAzureUCConfig")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/azure_uc_config/{cloud_account_id}" + .replaceAll( + "\\{" + "cloud_account_id" + "\\}", + apiClient.escapeString(cloudAccountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCostAzureUCConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get Google Cloud Usage Cost config. + * + *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return GcpUcConfigResponse + * @throws ApiException if fails to make API call + */ + public GcpUcConfigResponse getCostGCPUsageCostConfig(Long cloudAccountId) throws ApiException { + return getCostGCPUsageCostConfigWithHttpInfo(cloudAccountId).getData(); + } + + /** + * Get Google Cloud Usage Cost config. + * + *

See {@link #getCostGCPUsageCostConfigWithHttpInfoAsync}. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return CompletableFuture<GcpUcConfigResponse> + */ + public CompletableFuture getCostGCPUsageCostConfigAsync( + Long cloudAccountId) { + return getCostGCPUsageCostConfigWithHttpInfoAsync(cloudAccountId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific Google Cloud Usage Cost config. + * + * @param cloudAccountId The unique identifier of the cloud account (required) + * @return ApiResponse<GcpUcConfigResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Long cloudAccountId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'cloudAccountId' is set + if (cloudAccountId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'cloudAccountId' when calling getCostGCPUsageCostConfig"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/gcp_uc_config/{cloud_account_id}" + .replaceAll( + "\\{" + "cloud_account_id" + "\\}", + apiClient.escapeString(cloudAccountId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * Get cost Azure UC config. + * Get Google Cloud Usage Cost config. * - *

See {@link #getCostAzureUCConfigWithHttpInfo}. + *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. * * @param cloudAccountId The unique identifier of the cloud account (required) - * @return CompletableFuture<ApiResponse<UCConfigPair>> + * @return CompletableFuture<ApiResponse<GcpUcConfigResponse>> */ - public CompletableFuture> getCostAzureUCConfigWithHttpInfoAsync( - Long cloudAccountId) { + public CompletableFuture> + getCostGCPUsageCostConfigWithHttpInfoAsync(Long cloudAccountId) { Object localVarPostBody = null; // verify the required parameter 'cloudAccountId' is set if (cloudAccountId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'cloudAccountId' when calling getCostAzureUCConfig")); + "Missing the required parameter 'cloudAccountId' when calling" + + " getCostGCPUsageCostConfig")); return result; } // create path and map variables String localVarPath = - "/api/v2/cost/azure_uc_config/{cloud_account_id}" + "/api/v2/cost/gcp_uc_config/{cloud_account_id}" .replaceAll( "\\{" + "cloud_account_id" + "\\}", apiClient.escapeString(cloudAccountId.toString())); @@ -4916,7 +5407,7 @@ public CompletableFuture> getCostAzureUCConfigWithHttp try { builder = apiClient.createBuilder( - "v2.CloudCostManagementApi.getCostAzureUCConfig", + "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4924,7 +5415,7 @@ public CompletableFuture> getCostAzureUCConfigWithHttp new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4936,33 +5427,53 @@ public CompletableFuture> getCostAzureUCConfigWithHttp localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getCostTagDescriptionByKey. */ + public static class GetCostTagDescriptionByKeyOptionalParameters { + private String filterCloud; + + /** + * Set filterCloud. + * + * @param filterCloud Cloud provider to scope the lookup to (for example, aws). + * Omit to use the resolved fallback. (optional) + * @return GetCostTagDescriptionByKeyOptionalParameters + */ + public GetCostTagDescriptionByKeyOptionalParameters filterCloud(String filterCloud) { + this.filterCloud = filterCloud; + return this; + } } /** - * Get Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. + *

See {@link #getCostTagDescriptionByKeyWithHttpInfo}. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return GcpUcConfigResponse + * @param tagKey The tag key whose description is being fetched. (required) + * @return CostTagDescriptionResponse * @throws ApiException if fails to make API call */ - public GcpUcConfigResponse getCostGCPUsageCostConfig(Long cloudAccountId) throws ApiException { - return getCostGCPUsageCostConfigWithHttpInfo(cloudAccountId).getData(); + public CostTagDescriptionResponse getCostTagDescriptionByKey(String tagKey) throws ApiException { + return getCostTagDescriptionByKeyWithHttpInfo( + tagKey, new GetCostTagDescriptionByKeyOptionalParameters()) + .getData(); } /** - * Get Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - *

See {@link #getCostGCPUsageCostConfigWithHttpInfoAsync}. + *

See {@link #getCostTagDescriptionByKeyWithHttpInfoAsync}. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return CompletableFuture<GcpUcConfigResponse> + * @param tagKey The tag key whose description is being fetched. (required) + * @return CompletableFuture<CostTagDescriptionResponse> */ - public CompletableFuture getCostGCPUsageCostConfigAsync( - Long cloudAccountId) { - return getCostGCPUsageCostConfigWithHttpInfoAsync(cloudAccountId) + public CompletableFuture getCostTagDescriptionByKeyAsync( + String tagKey) { + return getCostTagDescriptionByKeyWithHttpInfoAsync( + tagKey, new GetCostTagDescriptionByKeyOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -4970,43 +5481,84 @@ public CompletableFuture getCostGCPUsageCostConfigAsync( } /** - * Get a specific Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return ApiResponse<GcpUcConfigResponse> + *

See {@link #getCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return CostTagDescriptionResponse + * @throws ApiException if fails to make API call + */ + public CostTagDescriptionResponse getCostTagDescriptionByKey( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) throws ApiException { + return getCostTagDescriptionByKeyWithHttpInfo(tagKey, parameters).getData(); + } + + /** + * Get a Cloud Cost Management tag description. + * + *

See {@link #getCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CostTagDescriptionResponse> + */ + public CompletableFuture getCostTagDescriptionByKeyAsync( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) { + return getCostTagDescriptionByKeyWithHttpInfoAsync(tagKey, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the Cloud Cost Management description for a single tag key. Use filter[cloud] + * to scope the lookup to a specific cloud provider; when omitted, the response resolves the + * description in fallback order (cloud-specific organization override, then cloudless + * organization default, then Datadog's global default). + * + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CostTagDescriptionResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Long cloudAccountId) - throws ApiException { + public ApiResponse getCostTagDescriptionByKeyWithHttpInfo( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'cloudAccountId' is set - if (cloudAccountId == null) { + // verify the required parameter 'tagKey' is set + if (tagKey == null) { throw new ApiException( - 400, - "Missing the required parameter 'cloudAccountId' when calling getCostGCPUsageCostConfig"); + 400, "Missing the required parameter 'tagKey' when calling getCostTagDescriptionByKey"); } + String filterCloud = parameters.filterCloud; // create path and map variables String localVarPath = - "/api/v2/cost/gcp_uc_config/{cloud_account_id}" - .replaceAll( - "\\{" + "cloud_account_id" + "\\}", - apiClient.escapeString(cloudAccountId.toString())); + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", + "v2.CloudCostManagementApi.getCostTagDescriptionByKey", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -5019,53 +5571,56 @@ public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Lo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get Google Cloud Usage Cost config. + * Get a Cloud Cost Management tag description. * - *

See {@link #getCostGCPUsageCostConfigWithHttpInfo}. + *

See {@link #getCostTagDescriptionByKeyWithHttpInfo}. * - * @param cloudAccountId The unique identifier of the cloud account (required) - * @return CompletableFuture<ApiResponse<GcpUcConfigResponse>> + * @param tagKey The tag key whose description is being fetched. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CostTagDescriptionResponse>> */ - public CompletableFuture> - getCostGCPUsageCostConfigWithHttpInfoAsync(Long cloudAccountId) { + public CompletableFuture> + getCostTagDescriptionByKeyWithHttpInfoAsync( + String tagKey, GetCostTagDescriptionByKeyOptionalParameters parameters) { Object localVarPostBody = null; - // verify the required parameter 'cloudAccountId' is set - if (cloudAccountId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'cloudAccountId' when calling" - + " getCostGCPUsageCostConfig")); + "Missing the required parameter 'tagKey' when calling getCostTagDescriptionByKey")); return result; } + String filterCloud = parameters.filterCloud; // create path and map variables String localVarPath = - "/api/v2/cost/gcp_uc_config/{cloud_account_id}" - .replaceAll( - "\\{" + "cloud_account_id" + "\\}", - apiClient.escapeString(cloudAccountId.toString())); + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.CloudCostManagementApi.getCostGCPUsageCostConfig", + "v2.CloudCostManagementApi.getCostTagDescriptionByKey", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -5077,7 +5632,7 @@ public ApiResponse getCostGCPUsageCostConfigWithHttpInfo(Lo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** Manage optional parameters to getCostTagKey. */ @@ -10854,6 +11409,167 @@ public CompletableFuture> upsertBudgetWithHttpInf new GenericType() {}); } + /** + * Upsert a Cloud Cost Management tag description. + * + *

See {@link #upsertCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void upsertCostTagDescriptionByKey(String tagKey, CostTagDescriptionUpsertRequest body) + throws ApiException { + upsertCostTagDescriptionByKeyWithHttpInfo(tagKey, body); + } + + /** + * Upsert a Cloud Cost Management tag description. + * + *

See {@link #upsertCostTagDescriptionByKeyWithHttpInfoAsync}. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture upsertCostTagDescriptionByKeyAsync( + String tagKey, CostTagDescriptionUpsertRequest body) { + return upsertCostTagDescriptionByKeyWithHttpInfoAsync(tagKey, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create or update a Cloud Cost Management tag key description. The new description and optional + * cloud scoping are supplied in the request body. Omit cloud to set a cross-cloud + * default for the tag key. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (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 -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse upsertCostTagDescriptionByKeyWithHttpInfo( + String tagKey, CostTagDescriptionUpsertRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + throw new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling upsertCostTagDescriptionByKey"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling upsertCostTagDescriptionByKey"); + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.upsertCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Upsert a Cloud Cost Management tag description. + * + *

See {@link #upsertCostTagDescriptionByKeyWithHttpInfo}. + * + * @param tagKey The tag key whose description is being upserted. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> upsertCostTagDescriptionByKeyWithHttpInfoAsync( + String tagKey, CostTagDescriptionUpsertRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'tagKey' is set + if (tagKey == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'tagKey' when calling" + + " upsertCostTagDescriptionByKey")); + 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 upsertCostTagDescriptionByKey")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cost/tag_descriptions/{tag_key}" + .replaceAll("\\{" + "tag_key" + "\\}", apiClient.escapeString(tagKey.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.upsertCostTagDescriptionByKey", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Validate budget. * 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 new file mode 100644 index 00000000000..37c81a86c5c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/OAuth2ClientPublicApi.java @@ -0,0 +1,695 @@ +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/CostTagDescriptionResponse.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java new file mode 100644 index 00000000000..6f78139a21f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionResponse.java @@ -0,0 +1,147 @@ +/* + * 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; + +/** Single Cloud Cost Management tag key description returned by the get-by-key endpoint. */ +@JsonPropertyOrder({CostTagDescriptionResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CostTagDescription data; + + public CostTagDescriptionResponse() {} + + @JsonCreator + public CostTagDescriptionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CostTagDescriptionResponse data(CostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud + * provider. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescription getData() { + return data; + } + + public void setData(CostTagDescription 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 CostTagDescriptionResponse + */ + @JsonAnySetter + public CostTagDescriptionResponse 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 CostTagDescriptionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionResponse costTagDescriptionResponse = (CostTagDescriptionResponse) o; + return Objects.equals(this.data, costTagDescriptionResponse.data) + && Objects.equals( + this.additionalProperties, costTagDescriptionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionResponse {\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/CostTagDescriptionUpsertRequest.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java new file mode 100644 index 00000000000..a2df7f8bf0d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequest.java @@ -0,0 +1,149 @@ +/* + * 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; + +/** Request body for creating or updating a Cloud Cost Management tag key description. */ +@JsonPropertyOrder({CostTagDescriptionUpsertRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionUpsertRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CostTagDescriptionUpsertRequestData data; + + public CostTagDescriptionUpsertRequest() {} + + @JsonCreator + public CostTagDescriptionUpsertRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + CostTagDescriptionUpsertRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CostTagDescriptionUpsertRequest data(CostTagDescriptionUpsertRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Resource envelope carrying the tag key description being upserted. The id is + * informational; the authoritative tag key is taken from the URL path. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionUpsertRequestData getData() { + return data; + } + + public void setData(CostTagDescriptionUpsertRequestData 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 CostTagDescriptionUpsertRequest + */ + @JsonAnySetter + public CostTagDescriptionUpsertRequest 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 CostTagDescriptionUpsertRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionUpsertRequest costTagDescriptionUpsertRequest = + (CostTagDescriptionUpsertRequest) o; + return Objects.equals(this.data, costTagDescriptionUpsertRequest.data) + && Objects.equals( + this.additionalProperties, costTagDescriptionUpsertRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionUpsertRequest {\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/CostTagDescriptionUpsertRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java new file mode 100644 index 00000000000..81458337f8c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestData.java @@ -0,0 +1,215 @@ +/* + * 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; + +/** + * Resource envelope carrying the tag key description being upserted. The id is + * informational; the authoritative tag key is taken from the URL path. + */ +@JsonPropertyOrder({ + CostTagDescriptionUpsertRequestData.JSON_PROPERTY_ATTRIBUTES, + CostTagDescriptionUpsertRequestData.JSON_PROPERTY_ID, + CostTagDescriptionUpsertRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionUpsertRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CostTagDescriptionUpsertRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CostTagDescriptionType type = CostTagDescriptionType.COST_TAG_DESCRIPTION; + + public CostTagDescriptionUpsertRequestData() {} + + @JsonCreator + public CostTagDescriptionUpsertRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CostTagDescriptionUpsertRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CostTagDescriptionType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CostTagDescriptionUpsertRequestData attributes( + CostTagDescriptionUpsertRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionUpsertRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CostTagDescriptionUpsertRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CostTagDescriptionUpsertRequestData id(String id) { + this.id = id; + return this; + } + + /** + * Identifier of the tag key the description applies to. Matches the tag_key path + * parameter. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CostTagDescriptionUpsertRequestData type(CostTagDescriptionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Cloud Cost Management tag description resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CostTagDescriptionType getType() { + return type; + } + + public void setType(CostTagDescriptionType 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 CostTagDescriptionUpsertRequestData + */ + @JsonAnySetter + public CostTagDescriptionUpsertRequestData 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 CostTagDescriptionUpsertRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionUpsertRequestData costTagDescriptionUpsertRequestData = + (CostTagDescriptionUpsertRequestData) o; + return Objects.equals(this.attributes, costTagDescriptionUpsertRequestData.attributes) + && Objects.equals(this.id, costTagDescriptionUpsertRequestData.id) + && Objects.equals(this.type, costTagDescriptionUpsertRequestData.type) + && Objects.equals( + this.additionalProperties, costTagDescriptionUpsertRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionUpsertRequestData {\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/CostTagDescriptionUpsertRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java new file mode 100644 index 00000000000..1756adbf6aa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CostTagDescriptionUpsertRequestDataAttributes.java @@ -0,0 +1,178 @@ +/* + * 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; + +/** Mutable attributes set when creating or updating a Cloud Cost Management tag key description. */ +@JsonPropertyOrder({ + CostTagDescriptionUpsertRequestDataAttributes.JSON_PROPERTY_CLOUD, + CostTagDescriptionUpsertRequestDataAttributes.JSON_PROPERTY_DESCRIPTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CostTagDescriptionUpsertRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLOUD = "cloud"; + private String cloud; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public CostTagDescriptionUpsertRequestDataAttributes() {} + + @JsonCreator + public CostTagDescriptionUpsertRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description) { + this.description = description; + } + + public CostTagDescriptionUpsertRequestDataAttributes cloud(String cloud) { + this.cloud = cloud; + return this; + } + + /** + * Cloud provider this description applies to (for example, aws). Omit to set the + * cross-cloud default for the tag key. + * + * @return cloud + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOUD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCloud() { + return cloud; + } + + public void setCloud(String cloud) { + this.cloud = cloud; + } + + public CostTagDescriptionUpsertRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The human-readable description for the tag key. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * 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 CostTagDescriptionUpsertRequestDataAttributes + */ + @JsonAnySetter + public CostTagDescriptionUpsertRequestDataAttributes 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 CostTagDescriptionUpsertRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CostTagDescriptionUpsertRequestDataAttributes costTagDescriptionUpsertRequestDataAttributes = + (CostTagDescriptionUpsertRequestDataAttributes) o; + return Objects.equals(this.cloud, costTagDescriptionUpsertRequestDataAttributes.cloud) + && Objects.equals( + this.description, costTagDescriptionUpsertRequestDataAttributes.description) + && Objects.equals( + this.additionalProperties, + costTagDescriptionUpsertRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cloud, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CostTagDescriptionUpsertRequestDataAttributes {\n"); + sb.append(" cloud: ").append(toIndentedString(cloud)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).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/GenerateCostTagDescriptionResponse.java b/src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java new file mode 100644 index 00000000000..078e5630f36 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GenerateCostTagDescriptionResponse.java @@ -0,0 +1,148 @@ +/* + * 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 wrapping an AI-generated Cloud Cost Management tag key description. */ +@JsonPropertyOrder({GenerateCostTagDescriptionResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GenerateCostTagDescriptionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GeneratedCostTagDescription data; + + public GenerateCostTagDescriptionResponse() {} + + @JsonCreator + public GenerateCostTagDescriptionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) GeneratedCostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GenerateCostTagDescriptionResponse data(GeneratedCostTagDescription data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The + * result is returned to the client but is not persisted by this endpoint. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneratedCostTagDescription getData() { + return data; + } + + public void setData(GeneratedCostTagDescription 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 GenerateCostTagDescriptionResponse + */ + @JsonAnySetter + public GenerateCostTagDescriptionResponse 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 GenerateCostTagDescriptionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateCostTagDescriptionResponse generateCostTagDescriptionResponse = + (GenerateCostTagDescriptionResponse) o; + return Objects.equals(this.data, generateCostTagDescriptionResponse.data) + && Objects.equals( + this.additionalProperties, generateCostTagDescriptionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateCostTagDescriptionResponse {\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/GeneratedCostTagDescription.java b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java new file mode 100644 index 00000000000..9080784cee9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescription.java @@ -0,0 +1,215 @@ +/* + * 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; + +/** + * AI-generated Cloud Cost Management tag key description returned by the generate endpoint. The + * result is returned to the client but is not persisted by this endpoint. + */ +@JsonPropertyOrder({ + GeneratedCostTagDescription.JSON_PROPERTY_ATTRIBUTES, + GeneratedCostTagDescription.JSON_PROPERTY_ID, + GeneratedCostTagDescription.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneratedCostTagDescription { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GeneratedCostTagDescriptionAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GeneratedCostTagDescriptionType type = + GeneratedCostTagDescriptionType.COST_GENERATED_TAG_DESCRIPTION; + + public GeneratedCostTagDescription() {} + + @JsonCreator + public GeneratedCostTagDescription( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GeneratedCostTagDescriptionAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GeneratedCostTagDescriptionType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GeneratedCostTagDescription attributes(GeneratedCostTagDescriptionAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an AI-generated Cloud Cost Management tag key description. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneratedCostTagDescriptionAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GeneratedCostTagDescriptionAttributes attributes) { + this.attributes = attributes; + } + + public GeneratedCostTagDescription id(String id) { + this.id = id; + return this; + } + + /** + * The tag key the AI description was generated for. + * + * @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 GeneratedCostTagDescription type(GeneratedCostTagDescriptionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the AI-generated Cloud Cost Management tag description resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GeneratedCostTagDescriptionType getType() { + return type; + } + + public void setType(GeneratedCostTagDescriptionType 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 GeneratedCostTagDescription + */ + @JsonAnySetter + public GeneratedCostTagDescription 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 GeneratedCostTagDescription object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneratedCostTagDescription generatedCostTagDescription = (GeneratedCostTagDescription) o; + return Objects.equals(this.attributes, generatedCostTagDescription.attributes) + && Objects.equals(this.id, generatedCostTagDescription.id) + && Objects.equals(this.type, generatedCostTagDescription.type) + && Objects.equals( + this.additionalProperties, generatedCostTagDescription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneratedCostTagDescription {\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/GeneratedCostTagDescriptionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java new file mode 100644 index 00000000000..d52bc622c86 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionAttributes.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** Attributes of an AI-generated Cloud Cost Management tag key description. */ +@JsonPropertyOrder({GeneratedCostTagDescriptionAttributes.JSON_PROPERTY_DESCRIPTION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GeneratedCostTagDescriptionAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public GeneratedCostTagDescriptionAttributes() {} + + @JsonCreator + public GeneratedCostTagDescriptionAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description) { + this.description = description; + } + + public GeneratedCostTagDescriptionAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The AI-generated description for the tag key. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * 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 GeneratedCostTagDescriptionAttributes + */ + @JsonAnySetter + public GeneratedCostTagDescriptionAttributes 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 GeneratedCostTagDescriptionAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneratedCostTagDescriptionAttributes generatedCostTagDescriptionAttributes = + (GeneratedCostTagDescriptionAttributes) o; + return Objects.equals(this.description, generatedCostTagDescriptionAttributes.description) + && Objects.equals( + this.additionalProperties, generatedCostTagDescriptionAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneratedCostTagDescriptionAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).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/GeneratedCostTagDescriptionType.java b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java new file mode 100644 index 00000000000..6af35f8a7a7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GeneratedCostTagDescriptionType.java @@ -0,0 +1,58 @@ +/* + * 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; + +/** Type of the AI-generated Cloud Cost Management tag description resource. */ +@JsonSerialize( + using = GeneratedCostTagDescriptionType.GeneratedCostTagDescriptionTypeSerializer.class) +public class GeneratedCostTagDescriptionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cost_generated_tag_description")); + + public static final GeneratedCostTagDescriptionType COST_GENERATED_TAG_DESCRIPTION = + new GeneratedCostTagDescriptionType("cost_generated_tag_description"); + + GeneratedCostTagDescriptionType(String value) { + super(value, allowedValues); + } + + public static class GeneratedCostTagDescriptionTypeSerializer + extends StdSerializer { + public GeneratedCostTagDescriptionTypeSerializer(Class t) { + super(t); + } + + public GeneratedCostTagDescriptionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GeneratedCostTagDescriptionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GeneratedCostTagDescriptionType fromValue(String value) { + return new GeneratedCostTagDescriptionType(value); + } +} 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 new file mode 100644 index 00000000000..f2c50db5d17 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationError.java @@ -0,0 +1,176 @@ +/* + * 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 new file mode 100644 index 00000000000..2a29ed6a981 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationGrantType.java @@ -0,0 +1,60 @@ +/* + * 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 new file mode 100644 index 00000000000..f3930a72c81 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationRequest.java @@ -0,0 +1,465 @@ +/* + * 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 new file mode 100644 index 00000000000..c94ae40ce70 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponse.java @@ -0,0 +1,325 @@ +/* + * 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 new file mode 100644 index 00000000000..88dcd37fa6a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthClientRegistrationResponseType.java @@ -0,0 +1,58 @@ +/* + * 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 new file mode 100644 index 00000000000..b6e806250ed --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthOidcScope.java @@ -0,0 +1,57 @@ +/* + * 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 new file mode 100644 index 00000000000..6aba1109382 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestriction.java @@ -0,0 +1,188 @@ +/* + * 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 new file mode 100644 index 00000000000..db5c5756cd6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponse.java @@ -0,0 +1,148 @@ +/* + * 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 new file mode 100644 index 00000000000..19e3469cce1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseAttributes.java @@ -0,0 +1,204 @@ +/* + * 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 new file mode 100644 index 00000000000..a9b84072a20 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionResponseData.java @@ -0,0 +1,213 @@ +/* + * 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/OAuthScopesRestrictionType.java b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionType.java new file mode 100644 index 00000000000..508de8c3c98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OAuthScopesRestrictionType.java @@ -0,0 +1,57 @@ +/* + * 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 OAuth2 client scopes restriction. */ +@JsonSerialize(using = OAuthScopesRestrictionType.OAuthScopesRestrictionTypeSerializer.class) +public class OAuthScopesRestrictionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("scopes_restriction")); + + public static final OAuthScopesRestrictionType SCOPES_RESTRICTION = + new OAuthScopesRestrictionType("scopes_restriction"); + + OAuthScopesRestrictionType(String value) { + super(value, allowedValues); + } + + public static class OAuthScopesRestrictionTypeSerializer + extends StdSerializer { + public OAuthScopesRestrictionTypeSerializer(Class t) { + super(t); + } + + public OAuthScopesRestrictionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OAuthScopesRestrictionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OAuthScopesRestrictionType fromValue(String value) { + return new OAuthScopesRestrictionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java new file mode 100644 index 00000000000..e776f317ec0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionData.java @@ -0,0 +1,183 @@ +/* + * 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; + +/** Data object of an upsert OAuth2 scopes restriction request. */ +@JsonPropertyOrder({ + UpsertOAuthScopesRestrictionData.JSON_PROPERTY_ATTRIBUTES, + UpsertOAuthScopesRestrictionData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpsertOAuthScopesRestrictionData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpsertOAuthScopesRestrictionDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UpsertOAuthScopesRestrictionType type = + UpsertOAuthScopesRestrictionType.UPSERT_SCOPES_RESTRICTION; + + public UpsertOAuthScopesRestrictionData() {} + + @JsonCreator + public UpsertOAuthScopesRestrictionData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + UpsertOAuthScopesRestrictionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpsertOAuthScopesRestrictionData attributes( + UpsertOAuthScopesRestrictionDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an upsert OAuth2 scopes restriction request. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpsertOAuthScopesRestrictionDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpsertOAuthScopesRestrictionDataAttributes attributes) { + this.attributes = attributes; + } + + public UpsertOAuthScopesRestrictionData type(UpsertOAuthScopesRestrictionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * JSON:API resource type for an upsert OAuth2 client scopes restriction request. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpsertOAuthScopesRestrictionType getType() { + return type; + } + + public void setType(UpsertOAuthScopesRestrictionType 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 UpsertOAuthScopesRestrictionData + */ + @JsonAnySetter + public UpsertOAuthScopesRestrictionData 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 UpsertOAuthScopesRestrictionData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + 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); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, 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(" 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/UpsertOAuthScopesRestrictionDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionDataAttributes.java new file mode 100644 index 00000000000..fe96f0090b6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionDataAttributes.java @@ -0,0 +1,192 @@ +/* + * 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/UpsertOAuthScopesRestrictionRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionRequest.java new file mode 100644 index 00000000000..0708a864f4f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionRequest.java @@ -0,0 +1,148 @@ +/* + * 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; + +/** Request payload for creating or updating the scopes restriction of an OAuth2 client. */ +@JsonPropertyOrder({UpsertOAuthScopesRestrictionRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpsertOAuthScopesRestrictionRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpsertOAuthScopesRestrictionData data; + + public UpsertOAuthScopesRestrictionRequest() {} + + @JsonCreator + public UpsertOAuthScopesRestrictionRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + UpsertOAuthScopesRestrictionData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UpsertOAuthScopesRestrictionRequest data(UpsertOAuthScopesRestrictionData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object of an upsert OAuth2 scopes restriction request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpsertOAuthScopesRestrictionData getData() { + return data; + } + + public void setData(UpsertOAuthScopesRestrictionData 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 UpsertOAuthScopesRestrictionRequest + */ + @JsonAnySetter + public UpsertOAuthScopesRestrictionRequest 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 UpsertOAuthScopesRestrictionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertOAuthScopesRestrictionRequest upsertOAuthScopesRestrictionRequest = + (UpsertOAuthScopesRestrictionRequest) o; + return Objects.equals(this.data, upsertOAuthScopesRestrictionRequest.data) + && Objects.equals( + this.additionalProperties, upsertOAuthScopesRestrictionRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpsertOAuthScopesRestrictionRequest {\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/UpsertOAuthScopesRestrictionType.java b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionType.java new file mode 100644 index 00000000000..496c21c8947 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpsertOAuthScopesRestrictionType.java @@ -0,0 +1,58 @@ +/* + * 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 b41928f4cb9..535fe88d7c7 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 @@ -190,6 +190,20 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a Cloud Cost Management tag description returns "Bad Request" response + Given new "DeleteCostTagDescriptionByKey" request + And request contains "tag_key" 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: Delete a Cloud Cost Management tag description returns "No Content" response + Given new "DeleteCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/cloud-cost-management Scenario: Delete a budget returns "Bad Request" response Given new "DeleteBudget" request @@ -218,6 +232,20 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Generate a Cloud Cost Management tag description returns "Bad Request" response + Given new "GenerateCostTagDescriptionByKey" request + And request contains "tag_key" 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: Generate a Cloud Cost Management tag description returns "OK" response + Given new "GenerateCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get Custom Costs File returns "OK" response Given new "GetCustomCostsFile" request @@ -250,6 +278,27 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "gcp_uc_config" And the response "data.attributes.account_id" is equal to "123456_ABCDEF_123ABC" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag description returns "Bad Request" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" 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: Get a Cloud Cost Management tag description returns "Not Found" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get a Cloud Cost Management tag description returns "OK" response + Given new "GetCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get a Cloud Cost Management tag key returns "Bad Request" response Given new "GetCostTagKey" request @@ -873,6 +922,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Upsert a Cloud Cost Management tag description returns "Bad Request" response + Given new "UpsertCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cloud": "aws", "description": "AWS account that owns this cost."}, "id": "account_id", "type": "cost_tag_description"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Upsert a Cloud Cost Management tag description returns "No Content" response + Given new "UpsertCostTagDescriptionByKey" request + And request contains "tag_key" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cloud": "aws", "description": "AWS account that owns this cost."}, "id": "account_id", "type": "cost_tag_description"}} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/cloud-cost-management Scenario: Validate CSV budget returns "OK" response Given new "ValidateCsvBudget" request 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 new file mode 100644 index 00000000000..a5c7d195efa --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/oauth2_client_public.feature @@ -0,0 +1,100 @@ +@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 0878797ffd8..30001c2fccd 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 @@ -1874,6 +1874,30 @@ "type": "safe" } }, + "DeleteCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "GetCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "UpsertCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, + "GenerateCostTagDescriptionByKey": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTagKeys": { "tag": "Cloud Cost Management", "undo": { @@ -4678,6 +4702,30 @@ "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": {