diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index dede702aea71..bc16917af1ef 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.rb b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.rb new file mode 100644 index 000000000000..fcfacb4f775d --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCostTagDescriptionByKey.rb @@ -0,0 +1,5 @@ +# Delete a Cloud Cost Management tag description returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +api_instance.delete_cost_tag_description_by_key("tag_key") diff --git a/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.rb b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.rb new file mode 100644 index 000000000000..792421d96353 --- /dev/null +++ b/examples/v2/cloud-cost-management/GenerateCostTagDescriptionByKey.rb @@ -0,0 +1,5 @@ +# Generate a Cloud Cost Management tag description returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.generate_cost_tag_description_by_key("tag_key") diff --git a/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.rb b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.rb new file mode 100644 index 000000000000..de5dc4a0f139 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostTagDescriptionByKey.rb @@ -0,0 +1,5 @@ +# Get a Cloud Cost Management tag description returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_cost_tag_description_by_key("tag_key") diff --git a/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.rb b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.rb new file mode 100644 index 000000000000..6effe25f64de --- /dev/null +++ b/examples/v2/cloud-cost-management/UpsertCostTagDescriptionByKey.rb @@ -0,0 +1,16 @@ +# Upsert a Cloud Cost Management tag description returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new + +body = DatadogAPIClient::V2::CostTagDescriptionUpsertRequest.new({ + data: DatadogAPIClient::V2::CostTagDescriptionUpsertRequestData.new({ + attributes: DatadogAPIClient::V2::CostTagDescriptionUpsertRequestDataAttributes.new({ + cloud: "aws", + description: "AWS account that owns this cost.", + }), + id: "account_id", + type: DatadogAPIClient::V2::CostTagDescriptionType::COST_TAG_DESCRIPTION, + }), +}) +api_instance.upsert_cost_tag_description_by_key("tag_key", body) diff --git a/examples/v2/oauth2-client-public/DeleteScopesRestriction.rb b/examples/v2/oauth2-client-public/DeleteScopesRestriction.rb new file mode 100644 index 000000000000..19ef9539a0ad --- /dev/null +++ b/examples/v2/oauth2-client-public/DeleteScopesRestriction.rb @@ -0,0 +1,8 @@ +# Delete an OAuth2 client scopes restriction returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_scopes_restriction".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OAuth2ClientPublicAPI.new +api_instance.delete_scopes_restriction("fafa8e1c-36a5-11f0-a83d-da7ad0900001") diff --git a/examples/v2/oauth2-client-public/GetScopesRestriction.rb b/examples/v2/oauth2-client-public/GetScopesRestriction.rb new file mode 100644 index 000000000000..f959d785e912 --- /dev/null +++ b/examples/v2/oauth2-client-public/GetScopesRestriction.rb @@ -0,0 +1,8 @@ +# Get an OAuth2 client scopes restriction returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_scopes_restriction".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OAuth2ClientPublicAPI.new +p api_instance.get_scopes_restriction("fafa8e1c-36a5-11f0-a83d-da7ad0900001") diff --git a/examples/v2/oauth2-client-public/RegisterOAuthClient.rb b/examples/v2/oauth2-client-public/RegisterOAuthClient.rb new file mode 100644 index 000000000000..d438389b1248 --- /dev/null +++ b/examples/v2/oauth2-client-public/RegisterOAuthClient.rb @@ -0,0 +1,29 @@ +# Register an OAuth2 client returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.register_o_auth_client".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OAuth2ClientPublicAPI.new + +body = DatadogAPIClient::V2::OAuthClientRegistrationRequest.new({ + client_name: "Example MCP Client", + client_uri: "https://example.com", + grant_types: [ + DatadogAPIClient::V2::OAuthClientRegistrationGrantType::AUTHORIZATION_CODE, + DatadogAPIClient::V2::OAuthClientRegistrationGrantType::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: [ + DatadogAPIClient::V2::OAuthClientRegistrationResponseType::CODE, + ], + scope: "openid profile", + token_endpoint_auth_method: "none", + tos_uri: "https://example.com/tos", +}) +p api_instance.register_o_auth_client(body) diff --git a/examples/v2/oauth2-client-public/UpsertScopesRestriction.rb b/examples/v2/oauth2-client-public/UpsertScopesRestriction.rb new file mode 100644 index 000000000000..157b32764346 --- /dev/null +++ b/examples/v2/oauth2-client-public/UpsertScopesRestriction.rb @@ -0,0 +1,24 @@ +# Upsert an OAuth2 client scopes restriction returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.upsert_scopes_restriction".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OAuth2ClientPublicAPI.new + +body = DatadogAPIClient::V2::UpsertOAuthScopesRestrictionRequest.new({ + data: DatadogAPIClient::V2::UpsertOAuthScopesRestrictionData.new({ + attributes: DatadogAPIClient::V2::UpsertOAuthScopesRestrictionDataAttributes.new({ + oidc_scopes: [ + DatadogAPIClient::V2::OAuthOidcScope::OPENID, + DatadogAPIClient::V2::OAuthOidcScope::EMAIL, + ], + permission_scopes: [ + "dashboards_read", + "metrics_read", + ], + }), + type: DatadogAPIClient::V2::UpsertOAuthScopesRestrictionType::UPSERT_SCOPES_RESTRICTION, + }), +}) +p api_instance.upsert_scopes_restriction("fafa8e1c-36a5-11f0-a83d-da7ad0900001", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 95054c25f8dd..71ace9ba3c5a 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2622,6 +2622,21 @@ "v2.ListCostTagDescriptions" => { "filter_cloud" => "String", }, + "v2.DeleteCostTagDescriptionByKey" => { + "tag_key" => "String", + "cloud" => "String", + }, + "v2.GetCostTagDescriptionByKey" => { + "tag_key" => "String", + "filter_cloud" => "String", + }, + "v2.UpsertCostTagDescriptionByKey" => { + "tag_key" => "String", + "body" => "CostTagDescriptionUpsertRequest", + }, + "v2.GenerateCostTagDescriptionByKey" => { + "tag_key" => "String", + }, "v2.ListCostTagKeys" => { "filter_metric" => "String", "filter_tags" => "Array", @@ -3881,6 +3896,19 @@ "tags" => "String", "limit" => "Integer", }, + "v2.DeleteScopesRestriction" => { + "client_uuid" => "UUID", + }, + "v2.GetScopesRestriction" => { + "client_uuid" => "UUID", + }, + "v2.UpsertScopesRestriction" => { + "client_uuid" => "UUID", + "body" => "UpsertOAuthScopesRestrictionRequest", + }, + "v2.RegisterOAuthClient" => { + "body" => "OAuthClientRegistrationRequest", + }, "v2.ListPipelines" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index b41928f4cb9d..535fe88d7c7b 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/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/features/v2/oauth2_client_public.feature b/features/v2/oauth2_client_public.feature new file mode 100644 index 000000000000..a5c7d195efa7 --- /dev/null +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 0878797ffd8c..30001c2fccdb 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index bf08354c8d54..19120a954229 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -520,6 +520,10 @@ def initialize "v2.update_monitor_user_template": false, "v2.validate_existing_monitor_user_template": false, "v2.validate_monitor_user_template": false, + "v2.delete_scopes_restriction": false, + "v2.get_scopes_restriction": false, + "v2.register_o_auth_client": false, + "v2.upsert_scopes_restriction": false, "v2.bulk_update_org_group_memberships": false, "v2.create_org_group": false, "v2.create_org_group_policy": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index abbf1654651c..2b5453feded8 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2216,9 +2216,13 @@ def overrides "v2.cost_tag_attributes" => "CostTagAttributes", "v2.cost_tag_description" => "CostTagDescription", "v2.cost_tag_description_attributes" => "CostTagDescriptionAttributes", + "v2.cost_tag_description_response" => "CostTagDescriptionResponse", "v2.cost_tag_description_source" => "CostTagDescriptionSource", "v2.cost_tag_descriptions_response" => "CostTagDescriptionsResponse", "v2.cost_tag_description_type" => "CostTagDescriptionType", + "v2.cost_tag_description_upsert_request" => "CostTagDescriptionUpsertRequest", + "v2.cost_tag_description_upsert_request_data" => "CostTagDescriptionUpsertRequestData", + "v2.cost_tag_description_upsert_request_data_attributes" => "CostTagDescriptionUpsertRequestDataAttributes", "v2.cost_tag_key" => "CostTagKey", "v2.cost_tag_key_attributes" => "CostTagKeyAttributes", "v2.cost_tag_key_details" => "CostTagKeyDetails", @@ -3195,6 +3199,10 @@ def overrides "v2.gemini_integration" => "GeminiIntegration", "v2.gemini_integration_type" => "GeminiIntegrationType", "v2.gemini_integration_update" => "GeminiIntegrationUpdate", + "v2.generate_cost_tag_description_response" => "GenerateCostTagDescriptionResponse", + "v2.generated_cost_tag_description" => "GeneratedCostTagDescription", + "v2.generated_cost_tag_description_attributes" => "GeneratedCostTagDescriptionAttributes", + "v2.generated_cost_tag_description_type" => "GeneratedCostTagDescriptionType", "v2.get_action_connection_response" => "GetActionConnectionResponse", "v2.get_app_key_registration_response" => "GetAppKeyRegistrationResponse", "v2.get_app_response" => "GetAppResponse", @@ -4442,6 +4450,17 @@ def overrides "v2.nullable_relationship_to_user_data" => "NullableRelationshipToUserData", "v2.nullable_user_relationship" => "NullableUserRelationship", "v2.nullable_user_relationship_data" => "NullableUserRelationshipData", + "v2.o_auth_client_registration_error" => "OAuthClientRegistrationError", + "v2.o_auth_client_registration_grant_type" => "OAuthClientRegistrationGrantType", + "v2.o_auth_client_registration_request" => "OAuthClientRegistrationRequest", + "v2.o_auth_client_registration_response" => "OAuthClientRegistrationResponse", + "v2.o_auth_client_registration_response_type" => "OAuthClientRegistrationResponseType", + "v2.o_auth_oidc_scope" => "OAuthOidcScope", + "v2.o_auth_scopes_restriction" => "OAuthScopesRestriction", + "v2.o_auth_scopes_restriction_response" => "OAuthScopesRestrictionResponse", + "v2.o_auth_scopes_restriction_response_attributes" => "OAuthScopesRestrictionResponseAttributes", + "v2.o_auth_scopes_restriction_response_data" => "OAuthScopesRestrictionResponseData", + "v2.o_auth_scopes_restriction_type" => "OAuthScopesRestrictionType", "v2.observability_pipeline" => "ObservabilityPipeline", "v2.observability_pipeline_add_env_vars_processor" => "ObservabilityPipelineAddEnvVarsProcessor", "v2.observability_pipeline_add_env_vars_processor_type" => "ObservabilityPipelineAddEnvVarsProcessorType", @@ -6832,6 +6851,10 @@ def overrides "v2.upsert_cloud_inventory_sync_config_request" => "UpsertCloudInventorySyncConfigRequest", "v2.upsert_cloud_inventory_sync_config_request_attributes" => "UpsertCloudInventorySyncConfigRequestAttributes", "v2.upsert_cloud_inventory_sync_config_request_data" => "UpsertCloudInventorySyncConfigRequestData", + "v2.upsert_o_auth_scopes_restriction_data" => "UpsertOAuthScopesRestrictionData", + "v2.upsert_o_auth_scopes_restriction_data_attributes" => "UpsertOAuthScopesRestrictionDataAttributes", + "v2.upsert_o_auth_scopes_restriction_request" => "UpsertOAuthScopesRestrictionRequest", + "v2.upsert_o_auth_scopes_restriction_type" => "UpsertOAuthScopesRestrictionType", "v2.urgency" => "Urgency", "v2.url_param" => "UrlParam", "v2.url_param_update" => "UrlParamUpdate", @@ -7098,6 +7121,7 @@ def overrides "v2.model_lab_api_api" => "ModelLabAPIAPI", "v2.monitors_api" => "MonitorsAPI", "v2.network_device_monitoring_api" => "NetworkDeviceMonitoringAPI", + "v2.o_auth2_client_public_api" => "OAuth2ClientPublicAPI", "v2.observability_pipelines_api" => "ObservabilityPipelinesAPI", "v2.oci_integration_api" => "OCIIntegrationAPI", "v2.okta_integration_api" => "OktaIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb index 5b81f8a65ee6..4462f1cb5a4a 100644 --- a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb @@ -630,6 +630,73 @@ def delete_cost_gcp_usage_cost_config_with_http_info(cloud_account_id, opts = {} return data, status_code, headers end + # Delete a Cloud Cost Management tag description. + # + # @see #delete_cost_tag_description_by_key_with_http_info + def delete_cost_tag_description_by_key(tag_key, opts = {}) + delete_cost_tag_description_by_key_with_http_info(tag_key, opts) + nil + end + + # Delete a Cloud Cost Management tag 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. + # + # @param tag_key [String] The tag key whose description is being deleted. + # @param opts [Hash] the optional parameters + # @option opts [String] :cloud Cloud provider to scope the deletion to (for example, `aws`). Omit to delete every description for the tag key. + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_cost_tag_description_by_key_with_http_info(tag_key, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_cost_tag_description_by_key ...' + end + # verify the required parameter 'tag_key' is set + if @api_client.config.client_side_validation && tag_key.nil? + fail ArgumentError, "Missing the required parameter 'tag_key' when calling CloudCostManagementAPI.delete_cost_tag_description_by_key" + end + # resource path + local_var_path = '/api/v2/cost/tag_descriptions/{tag_key}'.sub('{tag_key}', CGI.escape(tag_key.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'cloud'] = opts[:'cloud'] if !opts[:'cloud'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_cost_tag_description_by_key, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_cost_tag_description_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete custom allocation rule. # # @see #delete_custom_allocation_rule_with_http_info @@ -825,6 +892,71 @@ def delete_tag_pipelines_ruleset_with_http_info(ruleset_id, opts = {}) return data, status_code, headers end + # Generate a Cloud Cost Management tag description. + # + # @see #generate_cost_tag_description_by_key_with_http_info + def generate_cost_tag_description_by_key(tag_key, opts = {}) + data, _status_code, _headers = generate_cost_tag_description_by_key_with_http_info(tag_key, opts) + data + end + + # Generate a Cloud Cost Management tag 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. + # + # @param tag_key [String] The tag key to generate an AI description for. + # @param opts [Hash] the optional parameters + # @return [Array<(GenerateCostTagDescriptionResponse, Integer, Hash)>] GenerateCostTagDescriptionResponse data, response status code and response headers + def generate_cost_tag_description_by_key_with_http_info(tag_key, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.generate_cost_tag_description_by_key ...' + end + # verify the required parameter 'tag_key' is set + if @api_client.config.client_side_validation && tag_key.nil? + fail ArgumentError, "Missing the required parameter 'tag_key' when calling CloudCostManagementAPI.generate_cost_tag_description_by_key" + end + # resource path + local_var_path = '/api/v2/cost/tag_descriptions/{tag_key}/generate'.sub('{tag_key}', CGI.escape(tag_key.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GenerateCostTagDescriptionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :generate_cost_tag_description_by_key, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#generate_cost_tag_description_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get budget. # # @see #get_budget_with_http_info @@ -1950,6 +2082,73 @@ def get_cost_gcp_usage_cost_config_with_http_info(cloud_account_id, opts = {}) return data, status_code, headers end + # Get a Cloud Cost Management tag description. + # + # @see #get_cost_tag_description_by_key_with_http_info + def get_cost_tag_description_by_key(tag_key, opts = {}) + data, _status_code, _headers = get_cost_tag_description_by_key_with_http_info(tag_key, opts) + data + end + + # Get a Cloud Cost Management tag 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). + # + # @param tag_key [String] The tag key whose description is being fetched. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_cloud Cloud provider to scope the lookup to (for example, `aws`). Omit to use the resolved fallback. + # @return [Array<(CostTagDescriptionResponse, Integer, Hash)>] CostTagDescriptionResponse data, response status code and response headers + def get_cost_tag_description_by_key_with_http_info(tag_key, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_cost_tag_description_by_key ...' + end + # verify the required parameter 'tag_key' is set + if @api_client.config.client_side_validation && tag_key.nil? + fail ArgumentError, "Missing the required parameter 'tag_key' when calling CloudCostManagementAPI.get_cost_tag_description_by_key" + end + # resource path + local_var_path = '/api/v2/cost/tag_descriptions/{tag_key}'.sub('{tag_key}', CGI.escape(tag_key.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[cloud]'] = opts[:'filter_cloud'] if !opts[:'filter_cloud'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CostTagDescriptionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_cost_tag_description_by_key, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_cost_tag_description_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a Cloud Cost Management tag key. # # @see #get_cost_tag_key_with_http_info @@ -4297,6 +4496,78 @@ def upsert_budget_with_http_info(body, opts = {}) return data, status_code, headers end + # Upsert a Cloud Cost Management tag description. + # + # @see #upsert_cost_tag_description_by_key_with_http_info + def upsert_cost_tag_description_by_key(tag_key, body, opts = {}) + upsert_cost_tag_description_by_key_with_http_info(tag_key, body, opts) + nil + end + + # Upsert a Cloud Cost Management tag 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. + # + # @param tag_key [String] The tag key whose description is being upserted. + # @param body [CostTagDescriptionUpsertRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def upsert_cost_tag_description_by_key_with_http_info(tag_key, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.upsert_cost_tag_description_by_key ...' + end + # verify the required parameter 'tag_key' is set + if @api_client.config.client_side_validation && tag_key.nil? + fail ArgumentError, "Missing the required parameter 'tag_key' when calling CloudCostManagementAPI.upsert_cost_tag_description_by_key" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.upsert_cost_tag_description_by_key" + end + # resource path + local_var_path = '/api/v2/cost/tag_descriptions/{tag_key}'.sub('{tag_key}', CGI.escape(tag_key.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :upsert_cost_tag_description_by_key, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#upsert_cost_tag_description_by_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Validate budget. # # @see #validate_budget_with_http_info diff --git a/lib/datadog_api_client/v2/api/o_auth2_client_public_api.rb b/lib/datadog_api_client/v2/api/o_auth2_client_public_api.rb new file mode 100644 index 000000000000..1264fef6c088 --- /dev/null +++ b/lib/datadog_api_client/v2/api/o_auth2_client_public_api.rb @@ -0,0 +1,319 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class OAuth2ClientPublicAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Delete an OAuth2 client scopes restriction. + # + # @see #delete_scopes_restriction_with_http_info + def delete_scopes_restriction(client_uuid, opts = {}) + delete_scopes_restriction_with_http_info(client_uuid, opts) + nil + end + + # Delete an OAuth2 client scopes restriction. + # + # Delete the scopes restriction configured for the OAuth2 client. + # + # @param client_uuid [UUID] UUID of the OAuth2 client. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_scopes_restriction_with_http_info(client_uuid, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_scopes_restriction".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_scopes_restriction") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_scopes_restriction")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OAuth2ClientPublicAPI.delete_scopes_restriction ...' + end + # verify the required parameter 'client_uuid' is set + if @api_client.config.client_side_validation && client_uuid.nil? + fail ArgumentError, "Missing the required parameter 'client_uuid' when calling OAuth2ClientPublicAPI.delete_scopes_restriction" + end + # resource path + local_var_path = '/api/v2/oauth2/clients/{client_uuid}/scopes_restriction'.sub('{client_uuid}', CGI.escape(client_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_scopes_restriction, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OAuth2ClientPublicAPI#delete_scopes_restriction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an OAuth2 client scopes restriction. + # + # @see #get_scopes_restriction_with_http_info + def get_scopes_restriction(client_uuid, opts = {}) + data, _status_code, _headers = get_scopes_restriction_with_http_info(client_uuid, opts) + data + end + + # Get an OAuth2 client scopes restriction. + # + # Get the scopes restriction configured for the OAuth2 client. + # + # @param client_uuid [UUID] UUID of the OAuth2 client. + # @param opts [Hash] the optional parameters + # @return [Array<(OAuthScopesRestrictionResponse, Integer, Hash)>] OAuthScopesRestrictionResponse data, response status code and response headers + def get_scopes_restriction_with_http_info(client_uuid, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_scopes_restriction".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_scopes_restriction") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_scopes_restriction")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OAuth2ClientPublicAPI.get_scopes_restriction ...' + end + # verify the required parameter 'client_uuid' is set + if @api_client.config.client_side_validation && client_uuid.nil? + fail ArgumentError, "Missing the required parameter 'client_uuid' when calling OAuth2ClientPublicAPI.get_scopes_restriction" + end + # resource path + local_var_path = '/api/v2/oauth2/clients/{client_uuid}/scopes_restriction'.sub('{client_uuid}', CGI.escape(client_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OAuthScopesRestrictionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_scopes_restriction, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OAuth2ClientPublicAPI#get_scopes_restriction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Register an OAuth2 client. + # + # @see #register_o_auth_client_with_http_info + def register_o_auth_client(body, opts = {}) + data, _status_code, _headers = register_o_auth_client_with_http_info(body, opts) + data + end + + # Register an OAuth2 client. + # + # Register an OAuth2 client using the Dynamic Client Registration protocol defined in RFC 7591. + # + # @param body [OAuthClientRegistrationRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OAuthClientRegistrationResponse, Integer, Hash)>] OAuthClientRegistrationResponse data, response status code and response headers + def register_o_auth_client_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.register_o_auth_client".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.register_o_auth_client") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.register_o_auth_client")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OAuth2ClientPublicAPI.register_o_auth_client ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OAuth2ClientPublicAPI.register_o_auth_client" + end + # resource path + local_var_path = '/api/v2/oauth2/register' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OAuthClientRegistrationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :register_o_auth_client, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OAuth2ClientPublicAPI#register_o_auth_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Upsert an OAuth2 client scopes restriction. + # + # @see #upsert_scopes_restriction_with_http_info + def upsert_scopes_restriction(client_uuid, body, opts = {}) + data, _status_code, _headers = upsert_scopes_restriction_with_http_info(client_uuid, body, opts) + data + end + + # Upsert an OAuth2 client scopes restriction. + # + # Create or update the scopes restriction configured for the OAuth2 client. + # + # @param client_uuid [UUID] UUID of the OAuth2 client. + # @param body [UpsertOAuthScopesRestrictionRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OAuthScopesRestrictionResponse, Integer, Hash)>] OAuthScopesRestrictionResponse data, response status code and response headers + def upsert_scopes_restriction_with_http_info(client_uuid, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.upsert_scopes_restriction".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upsert_scopes_restriction") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upsert_scopes_restriction")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OAuth2ClientPublicAPI.upsert_scopes_restriction ...' + end + # verify the required parameter 'client_uuid' is set + if @api_client.config.client_side_validation && client_uuid.nil? + fail ArgumentError, "Missing the required parameter 'client_uuid' when calling OAuth2ClientPublicAPI.upsert_scopes_restriction" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OAuth2ClientPublicAPI.upsert_scopes_restriction" + end + # resource path + local_var_path = '/api/v2/oauth2/clients/{client_uuid}/scopes_restriction'.sub('{client_uuid}', CGI.escape(client_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OAuthScopesRestrictionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :upsert_scopes_restriction, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OAuth2ClientPublicAPI#upsert_scopes_restriction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_description_response.rb b/lib/datadog_api_client/v2/models/cost_tag_description_response.rb new file mode 100644 index 000000000000..7238b5a8591e --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Single Cloud Cost Management tag key description returned by the get-by-key endpoint. + class CostTagDescriptionResponse + include BaseGenericModel + + # A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CostTagDescription' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CostTagDescriptionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_description_upsert_request.rb b/lib/datadog_api_client/v2/models/cost_tag_description_upsert_request.rb new file mode 100644 index 000000000000..5afa1737ffd8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_upsert_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for creating or updating a Cloud Cost Management tag key description. + class CostTagDescriptionUpsertRequest + include BaseGenericModel + + # Resource envelope carrying the tag key description being upserted. The `id` is informational; the authoritative tag key is taken from the URL path. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CostTagDescriptionUpsertRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CostTagDescriptionUpsertRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_description_upsert_request_data.rb b/lib/datadog_api_client/v2/models/cost_tag_description_upsert_request_data.rb new file mode 100644 index 000000000000..21a6aeddb9b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_upsert_request_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource envelope carrying the tag key description being upserted. The `id` is informational; the authoritative tag key is taken from the URL path. + class CostTagDescriptionUpsertRequestData + include BaseGenericModel + + # Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + attr_reader :attributes + + # Identifier of the tag key the description applies to. Matches the `tag_key` path parameter. + attr_accessor :id + + # Type of the Cloud Cost Management tag description resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CostTagDescriptionUpsertRequestDataAttributes', + :'id' => :'String', + :'type' => :'CostTagDescriptionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CostTagDescriptionUpsertRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_description_upsert_request_data_attributes.rb b/lib/datadog_api_client/v2/models/cost_tag_description_upsert_request_data_attributes.rb new file mode 100644 index 000000000000..b4e5259da184 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_description_upsert_request_data_attributes.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Mutable attributes set when creating or updating a Cloud Cost Management tag key description. + class CostTagDescriptionUpsertRequestDataAttributes + include BaseGenericModel + + # Cloud provider this description applies to (for example, `aws`). Omit to set the cross-cloud default for the tag key. + attr_accessor :cloud + + # The human-readable description for the tag key. + attr_reader :description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cloud' => :'cloud', + :'description' => :'description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cloud' => :'String', + :'description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CostTagDescriptionUpsertRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cloud') + self.cloud = attributes[:'cloud'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cloud == o.cloud && + description == o.description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cloud, description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generate_cost_tag_description_response.rb b/lib/datadog_api_client/v2/models/generate_cost_tag_description_response.rb new file mode 100644 index 000000000000..84e746c38da6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/generate_cost_tag_description_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response wrapping an AI-generated Cloud Cost Management tag key description. + class GenerateCostTagDescriptionResponse + include BaseGenericModel + + # 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. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GeneratedCostTagDescription' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GenerateCostTagDescriptionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generated_cost_tag_description.rb b/lib/datadog_api_client/v2/models/generated_cost_tag_description.rb new file mode 100644 index 000000000000..119675f098b6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/generated_cost_tag_description.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class GeneratedCostTagDescription + include BaseGenericModel + + # Attributes of an AI-generated Cloud Cost Management tag key description. + attr_reader :attributes + + # The tag key the AI description was generated for. + attr_reader :id + + # Type of the AI-generated Cloud Cost Management tag description resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GeneratedCostTagDescriptionAttributes', + :'id' => :'String', + :'type' => :'GeneratedCostTagDescriptionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GeneratedCostTagDescription` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generated_cost_tag_description_attributes.rb b/lib/datadog_api_client/v2/models/generated_cost_tag_description_attributes.rb new file mode 100644 index 000000000000..0a4de2b5a333 --- /dev/null +++ b/lib/datadog_api_client/v2/models/generated_cost_tag_description_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an AI-generated Cloud Cost Management tag key description. + class GeneratedCostTagDescriptionAttributes + include BaseGenericModel + + # The AI-generated description for the tag key. + attr_reader :description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GeneratedCostTagDescriptionAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/generated_cost_tag_description_type.rb b/lib/datadog_api_client/v2/models/generated_cost_tag_description_type.rb new file mode 100644 index 000000000000..471f14f02042 --- /dev/null +++ b/lib/datadog_api_client/v2/models/generated_cost_tag_description_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the AI-generated Cloud Cost Management tag description resource. + class GeneratedCostTagDescriptionType + include BaseEnumModel + + COST_GENERATED_TAG_DESCRIPTION = "cost_generated_tag_description".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_error.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_error.rb new file mode 100644 index 000000000000..a6dd8badabd5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_error.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Error payload returned by OAuth2 dynamic client registration as defined by RFC 7591. + class OAuthClientRegistrationError + include BaseGenericModel + + # Single ASCII error code per RFC 7591, such as `invalid_request` or `invalid_client_metadata`. + attr_reader :error + + # Human-readable description of the error. + attr_reader :error_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error' => :'error', + :'error_description' => :'error_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error' => :'String', + :'error_description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthClientRegistrationError` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'error_description') + self.error_description = attributes[:'error_description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @error.nil? + return false if @error_description.nil? + true + end + + # Custom attribute writer method with validation + # @param error [Object] Object to be assigned + # @!visibility private + def error=(error) + if error.nil? + fail ArgumentError, 'invalid value for "error", error cannot be nil.' + end + @error = error + end + + # Custom attribute writer method with validation + # @param error_description [Object] Object to be assigned + # @!visibility private + def error_description=(error_description) + if error_description.nil? + fail ArgumentError, 'invalid value for "error_description", error_description cannot be nil.' + end + @error_description = error_description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error && + error_description == o.error_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error, error_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_grant_type.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_grant_type.rb new file mode 100644 index 000000000000..a8c9a5d5121d --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_grant_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # OAuth 2.0 grant type that a registered client may use. + class OAuthClientRegistrationGrantType + include BaseEnumModel + + AUTHORIZATION_CODE = "authorization_code".freeze + REFRESH_TOKEN = "refresh_token".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_request.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_request.rb new file mode 100644 index 000000000000..f6db36a48b4b --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_request.rb @@ -0,0 +1,322 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for OAuth2 dynamic client registration as defined by RFC 7591. + class OAuthClientRegistrationRequest + include BaseGenericModel + + # Human-readable name of the client. Control characters are rejected. + attr_reader :client_name + + # URL of the home page of the client. + attr_reader :client_uri + + # OAuth 2.0 grant types the client may use. + # Defaults to `authorization_code` and `refresh_token` when omitted. + attr_accessor :grant_types + + # URL referencing the client's JSON Web Key Set. + attr_reader :jwks_uri + + # URL referencing a logo for the client. + attr_reader :logo_uri + + # URL pointing to the client's privacy policy. + attr_reader :policy_uri + + # Array of redirection URI strings used by the client in redirect-based flows. + attr_reader :redirect_uris + + # OAuth 2.0 response types the client may use. Only `code` is supported. + attr_accessor :response_types + + # Space-separated list of scope values the client may request. + attr_reader :scope + + # Requested authentication method for the token endpoint. Only `none` is supported. + attr_reader :token_endpoint_auth_method + + # URL pointing to the client's terms of service. + attr_reader :tos_uri + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'client_name' => :'client_name', + :'client_uri' => :'client_uri', + :'grant_types' => :'grant_types', + :'jwks_uri' => :'jwks_uri', + :'logo_uri' => :'logo_uri', + :'policy_uri' => :'policy_uri', + :'redirect_uris' => :'redirect_uris', + :'response_types' => :'response_types', + :'scope' => :'scope', + :'token_endpoint_auth_method' => :'token_endpoint_auth_method', + :'tos_uri' => :'tos_uri' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'client_name' => :'String', + :'client_uri' => :'String', + :'grant_types' => :'Array', + :'jwks_uri' => :'String', + :'logo_uri' => :'String', + :'policy_uri' => :'String', + :'redirect_uris' => :'Array', + :'response_types' => :'Array', + :'scope' => :'String', + :'token_endpoint_auth_method' => :'String', + :'tos_uri' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthClientRegistrationRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'client_name') + self.client_name = attributes[:'client_name'] + end + + if attributes.key?(:'client_uri') + self.client_uri = attributes[:'client_uri'] + end + + if attributes.key?(:'grant_types') + if (value = attributes[:'grant_types']).is_a?(Array) + self.grant_types = value + end + end + + if attributes.key?(:'jwks_uri') + self.jwks_uri = attributes[:'jwks_uri'] + end + + if attributes.key?(:'logo_uri') + self.logo_uri = attributes[:'logo_uri'] + end + + if attributes.key?(:'policy_uri') + self.policy_uri = attributes[:'policy_uri'] + end + + if attributes.key?(:'redirect_uris') + if (value = attributes[:'redirect_uris']).is_a?(Array) + self.redirect_uris = value + end + end + + if attributes.key?(:'response_types') + if (value = attributes[:'response_types']).is_a?(Array) + self.response_types = value + end + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + end + + if attributes.key?(:'token_endpoint_auth_method') + self.token_endpoint_auth_method = attributes[:'token_endpoint_auth_method'] + end + + if attributes.key?(:'tos_uri') + self.tos_uri = attributes[:'tos_uri'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @client_name.nil? + return false if @client_name.to_s.length > 1000 + return false if !@client_uri.nil? && @client_uri.to_s.length > 1000 + return false if !@jwks_uri.nil? && @jwks_uri.to_s.length > 1000 + return false if !@logo_uri.nil? && @logo_uri.to_s.length > 1000 + return false if !@policy_uri.nil? && @policy_uri.to_s.length > 1000 + return false if @redirect_uris.nil? + return false if !@scope.nil? && @scope.to_s.length > 1000 + return false if !@token_endpoint_auth_method.nil? && @token_endpoint_auth_method.to_s.length > 20 + return false if !@tos_uri.nil? && @tos_uri.to_s.length > 1000 + true + end + + # Custom attribute writer method with validation + # @param client_name [Object] Object to be assigned + # @!visibility private + def client_name=(client_name) + if client_name.nil? + fail ArgumentError, 'invalid value for "client_name", client_name cannot be nil.' + end + if client_name.to_s.length > 1000 + fail ArgumentError, 'invalid value for "client_name", the character length must be smaller than or equal to 1000.' + end + @client_name = client_name + end + + # Custom attribute writer method with validation + # @param client_uri [Object] Object to be assigned + # @!visibility private + def client_uri=(client_uri) + if !client_uri.nil? && client_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "client_uri", the character length must be smaller than or equal to 1000.' + end + @client_uri = client_uri + end + + # Custom attribute writer method with validation + # @param jwks_uri [Object] Object to be assigned + # @!visibility private + def jwks_uri=(jwks_uri) + if !jwks_uri.nil? && jwks_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "jwks_uri", the character length must be smaller than or equal to 1000.' + end + @jwks_uri = jwks_uri + end + + # Custom attribute writer method with validation + # @param logo_uri [Object] Object to be assigned + # @!visibility private + def logo_uri=(logo_uri) + if !logo_uri.nil? && logo_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "logo_uri", the character length must be smaller than or equal to 1000.' + end + @logo_uri = logo_uri + end + + # Custom attribute writer method with validation + # @param policy_uri [Object] Object to be assigned + # @!visibility private + def policy_uri=(policy_uri) + if !policy_uri.nil? && policy_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "policy_uri", the character length must be smaller than or equal to 1000.' + end + @policy_uri = policy_uri + end + + # Custom attribute writer method with validation + # @param redirect_uris [Object] Object to be assigned + # @!visibility private + def redirect_uris=(redirect_uris) + if redirect_uris.nil? + fail ArgumentError, 'invalid value for "redirect_uris", redirect_uris cannot be nil.' + end + @redirect_uris = redirect_uris + end + + # Custom attribute writer method with validation + # @param scope [Object] Object to be assigned + # @!visibility private + def scope=(scope) + if !scope.nil? && scope.to_s.length > 1000 + fail ArgumentError, 'invalid value for "scope", the character length must be smaller than or equal to 1000.' + end + @scope = scope + end + + # Custom attribute writer method with validation + # @param token_endpoint_auth_method [Object] Object to be assigned + # @!visibility private + def token_endpoint_auth_method=(token_endpoint_auth_method) + if !token_endpoint_auth_method.nil? && token_endpoint_auth_method.to_s.length > 20 + fail ArgumentError, 'invalid value for "token_endpoint_auth_method", the character length must be smaller than or equal to 20.' + end + @token_endpoint_auth_method = token_endpoint_auth_method + end + + # Custom attribute writer method with validation + # @param tos_uri [Object] Object to be assigned + # @!visibility private + def tos_uri=(tos_uri) + if !tos_uri.nil? && tos_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "tos_uri", the character length must be smaller than or equal to 1000.' + end + @tos_uri = tos_uri + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + client_name == o.client_name && + client_uri == o.client_uri && + grant_types == o.grant_types && + jwks_uri == o.jwks_uri && + logo_uri == o.logo_uri && + policy_uri == o.policy_uri && + redirect_uris == o.redirect_uris && + response_types == o.response_types && + scope == o.scope && + token_endpoint_auth_method == o.token_endpoint_auth_method && + tos_uri == o.tos_uri && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [client_name, client_uri, grant_types, jwks_uri, logo_uri, policy_uri, redirect_uris, response_types, scope, token_endpoint_auth_method, tos_uri, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_response.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_response.rb new file mode 100644 index 000000000000..4b9ef409a5ad --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_response.rb @@ -0,0 +1,234 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response payload for a successful OAuth2 dynamic client registration as defined by RFC 7591. + class OAuthClientRegistrationResponse + include BaseGenericModel + + # Unique identifier assigned to the registered client. + attr_reader :client_id + + # Human-readable name of the client. + attr_reader :client_name + + # OAuth 2.0 grant types registered for the client. + attr_reader :grant_types + + # Redirection URIs registered for the client. + attr_reader :redirect_uris + + # OAuth 2.0 response types registered for the client. + attr_reader :response_types + + # Authentication method registered for the token endpoint. Always `none`. + attr_reader :token_endpoint_auth_method + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'client_id' => :'client_id', + :'client_name' => :'client_name', + :'grant_types' => :'grant_types', + :'redirect_uris' => :'redirect_uris', + :'response_types' => :'response_types', + :'token_endpoint_auth_method' => :'token_endpoint_auth_method' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'client_id' => :'UUID', + :'client_name' => :'String', + :'grant_types' => :'Array', + :'redirect_uris' => :'Array', + :'response_types' => :'Array', + :'token_endpoint_auth_method' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthClientRegistrationResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'client_name') + self.client_name = attributes[:'client_name'] + end + + if attributes.key?(:'grant_types') + if (value = attributes[:'grant_types']).is_a?(Array) + self.grant_types = value + end + end + + if attributes.key?(:'redirect_uris') + if (value = attributes[:'redirect_uris']).is_a?(Array) + self.redirect_uris = value + end + end + + if attributes.key?(:'response_types') + if (value = attributes[:'response_types']).is_a?(Array) + self.response_types = value + end + end + + if attributes.key?(:'token_endpoint_auth_method') + self.token_endpoint_auth_method = attributes[:'token_endpoint_auth_method'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @client_id.nil? + return false if @client_name.nil? + return false if @grant_types.nil? + return false if @redirect_uris.nil? + return false if @response_types.nil? + return false if @token_endpoint_auth_method.nil? + true + end + + # Custom attribute writer method with validation + # @param client_id [Object] Object to be assigned + # @!visibility private + def client_id=(client_id) + if client_id.nil? + fail ArgumentError, 'invalid value for "client_id", client_id cannot be nil.' + end + @client_id = client_id + end + + # Custom attribute writer method with validation + # @param client_name [Object] Object to be assigned + # @!visibility private + def client_name=(client_name) + if client_name.nil? + fail ArgumentError, 'invalid value for "client_name", client_name cannot be nil.' + end + @client_name = client_name + end + + # Custom attribute writer method with validation + # @param grant_types [Object] Object to be assigned + # @!visibility private + def grant_types=(grant_types) + if grant_types.nil? + fail ArgumentError, 'invalid value for "grant_types", grant_types cannot be nil.' + end + @grant_types = grant_types + end + + # Custom attribute writer method with validation + # @param redirect_uris [Object] Object to be assigned + # @!visibility private + def redirect_uris=(redirect_uris) + if redirect_uris.nil? + fail ArgumentError, 'invalid value for "redirect_uris", redirect_uris cannot be nil.' + end + @redirect_uris = redirect_uris + end + + # Custom attribute writer method with validation + # @param response_types [Object] Object to be assigned + # @!visibility private + def response_types=(response_types) + if response_types.nil? + fail ArgumentError, 'invalid value for "response_types", response_types cannot be nil.' + end + @response_types = response_types + end + + # Custom attribute writer method with validation + # @param token_endpoint_auth_method [Object] Object to be assigned + # @!visibility private + def token_endpoint_auth_method=(token_endpoint_auth_method) + if token_endpoint_auth_method.nil? + fail ArgumentError, 'invalid value for "token_endpoint_auth_method", token_endpoint_auth_method cannot be nil.' + end + @token_endpoint_auth_method = token_endpoint_auth_method + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + client_id == o.client_id && + client_name == o.client_name && + grant_types == o.grant_types && + redirect_uris == o.redirect_uris && + response_types == o.response_types && + token_endpoint_auth_method == o.token_endpoint_auth_method && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [client_id, client_name, grant_types, redirect_uris, response_types, token_endpoint_auth_method, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_response_type.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_response_type.rb new file mode 100644 index 000000000000..6c2847371ff5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # OAuth 2.0 response type that a registered client may use. + class OAuthClientRegistrationResponseType + include BaseEnumModel + + CODE = "code".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_oidc_scope.rb b/lib/datadog_api_client/v2/models/o_auth_oidc_scope.rb new file mode 100644 index 000000000000..4ae4befd6609 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_oidc_scope.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # OIDC scope a client may be restricted to. + class OAuthOidcScope + include BaseEnumModel + + OPENID = "openid".freeze + PROFILE = "profile".freeze + EMAIL = "email".freeze + OFFLINE_ACCESS = "offline_access".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction.rb new file mode 100644 index 000000000000..5aaf1633b8ea --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction.rb @@ -0,0 +1,148 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Allowlist of OIDC and permission scopes enforced for the OAuth2 client. + class OAuthScopesRestriction + include BaseGenericModel + + # OIDC scopes the client is restricted to. + attr_reader :oidc_scopes + + # Datadog permission scopes the client is restricted to. + attr_reader :permission_scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'oidc_scopes' => :'oidc_scopes', + :'permission_scopes' => :'permission_scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'oidc_scopes' => :'Array', + :'permission_scopes' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthScopesRestriction` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'oidc_scopes') + if (value = attributes[:'oidc_scopes']).is_a?(Array) + self.oidc_scopes = value + end + end + + if attributes.key?(:'permission_scopes') + if (value = attributes[:'permission_scopes']).is_a?(Array) + self.permission_scopes = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @oidc_scopes.nil? + return false if @permission_scopes.nil? + true + end + + # Custom attribute writer method with validation + # @param oidc_scopes [Object] Object to be assigned + # @!visibility private + def oidc_scopes=(oidc_scopes) + if oidc_scopes.nil? + fail ArgumentError, 'invalid value for "oidc_scopes", oidc_scopes cannot be nil.' + end + @oidc_scopes = oidc_scopes + end + + # Custom attribute writer method with validation + # @param permission_scopes [Object] Object to be assigned + # @!visibility private + def permission_scopes=(permission_scopes) + if permission_scopes.nil? + fail ArgumentError, 'invalid value for "permission_scopes", permission_scopes cannot be nil.' + end + @permission_scopes = permission_scopes + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oidc_scopes == o.oidc_scopes && + permission_scopes == o.permission_scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [oidc_scopes, permission_scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response.rb new file mode 100644 index 000000000000..8808631362e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response payload describing the scopes restriction of an OAuth2 client. + class OAuthScopesRestrictionResponse + include BaseGenericModel + + # Data object of an OAuth2 client scopes restriction response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OAuthScopesRestrictionResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthScopesRestrictionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_attributes.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_attributes.rb new file mode 100644 index 000000000000..18c8bdbb4aef --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_attributes.rb @@ -0,0 +1,127 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an OAuth2 client scopes restriction. + class OAuthScopesRestrictionResponseAttributes + include BaseGenericModel + + # Permission scopes automatically required for this client (for example, mobile-app permission scopes). + # Returns `null` when no scopes are required. + attr_accessor :required_permission_scopes + + # Allowlist of OIDC and permission scopes enforced for the OAuth2 client. + attr_accessor :scopes_restriction + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'required_permission_scopes' => :'required_permission_scopes', + :'scopes_restriction' => :'scopes_restriction' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'required_permission_scopes' => :'Array', + :'scopes_restriction' => :'OAuthScopesRestriction' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'required_permission_scopes', + :'scopes_restriction', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthScopesRestrictionResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'required_permission_scopes') + if (value = attributes[:'required_permission_scopes']).is_a?(Array) + self.required_permission_scopes = value + end + end + + if attributes.key?(:'scopes_restriction') + self.scopes_restriction = attributes[:'scopes_restriction'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + required_permission_scopes == o.required_permission_scopes && + scopes_restriction == o.scopes_restriction && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [required_permission_scopes, scopes_restriction, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_data.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_data.rb new file mode 100644 index 000000000000..70c8124753c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object of an OAuth2 client scopes restriction response. + class OAuthScopesRestrictionResponseData + include BaseGenericModel + + # Attributes of an OAuth2 client scopes restriction. + attr_reader :attributes + + # UUID of the OAuth2 client this restriction applies to. + attr_reader :id + + # JSON:API resource type for an OAuth2 client scopes restriction. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OAuthScopesRestrictionResponseAttributes', + :'id' => :'UUID', + :'type' => :'OAuthScopesRestrictionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthScopesRestrictionResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_type.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_type.rb new file mode 100644 index 000000000000..0d0808aee801 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API resource type for an OAuth2 client scopes restriction. + class OAuthScopesRestrictionType + include BaseEnumModel + + SCOPES_RESTRICTION = "scopes_restriction".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data.rb b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data.rb new file mode 100644 index 000000000000..6cae03a85eec --- /dev/null +++ b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object of an upsert OAuth2 scopes restriction request. + class UpsertOAuthScopesRestrictionData + include BaseGenericModel + + # Attributes of an upsert OAuth2 scopes restriction request. + attr_accessor :attributes + + # JSON:API resource type for an upsert OAuth2 client scopes restriction request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UpsertOAuthScopesRestrictionDataAttributes', + :'type' => :'UpsertOAuthScopesRestrictionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpsertOAuthScopesRestrictionData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data_attributes.rb b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data_attributes.rb new file mode 100644 index 000000000000..992dddb15dd8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data_attributes.rb @@ -0,0 +1,120 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an upsert OAuth2 scopes restriction request. + class UpsertOAuthScopesRestrictionDataAttributes + include BaseGenericModel + + # OIDC scopes the client is allowed to request. + attr_accessor :oidc_scopes + + # Datadog permission scopes the client is allowed to request. + # Each value must be a valid permission name. + attr_accessor :permission_scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'oidc_scopes' => :'oidc_scopes', + :'permission_scopes' => :'permission_scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'oidc_scopes' => :'Array', + :'permission_scopes' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpsertOAuthScopesRestrictionDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'oidc_scopes') + if (value = attributes[:'oidc_scopes']).is_a?(Array) + self.oidc_scopes = value + end + end + + if attributes.key?(:'permission_scopes') + if (value = attributes[:'permission_scopes']).is_a?(Array) + self.permission_scopes = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oidc_scopes == o.oidc_scopes && + permission_scopes == o.permission_scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [oidc_scopes, permission_scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_request.rb b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_request.rb new file mode 100644 index 000000000000..03ba65e4f357 --- /dev/null +++ b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating or updating the scopes restriction of an OAuth2 client. + class UpsertOAuthScopesRestrictionRequest + include BaseGenericModel + + # Data object of an upsert OAuth2 scopes restriction request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpsertOAuthScopesRestrictionData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpsertOAuthScopesRestrictionRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_type.rb b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_type.rb new file mode 100644 index 000000000000..ca38a2df07d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API resource type for an upsert OAuth2 client scopes restriction request. + class UpsertOAuthScopesRestrictionType + include BaseEnumModel + + UPSERT_SCOPES_RESTRICTION = "upsert_scopes_restriction".freeze + end +end