diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b17c8433bd55..a07ab7db9ff9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1932,6 +1932,15 @@ components: required: false schema: $ref: "#/components/schemas/WebhooksAuthMethodProtocol" + WifConfigUUID: + description: The UUID of the WIF configuration to operate on. + example: c5c758c6-18c2-4484-ae3f-46b84128404a + in: path + name: config_uuid + required: true + schema: + format: uuid + type: string WorkflowId: description: The ID of the workflow. in: path @@ -12146,6 +12155,181 @@ components: required: - data type: object + AwsWifIntakeMappingAttributes: + description: Attributes of an AWS WIF intake mapping. + properties: + arn_pattern: + description: |- + The AWS IAM ARN pattern identifying the role or user permitted to obtain an intake API key. + Supports wildcards (`*`) to match multiple principals within an account. + example: "arn:aws:iam::123456789012:role/my-agent-role" + type: string + required: + - arn_pattern + type: object + AwsWifIntakeMappingCreateData: + description: Data for creating an AWS WIF intake mapping. + properties: + attributes: + $ref: "#/components/schemas/AwsWifIntakeMappingAttributes" + type: + $ref: "#/components/schemas/AwsWifIntakeMappingType" + required: + - type + - attributes + type: object + AwsWifIntakeMappingCreateRequest: + description: Request body for creating an AWS WIF intake mapping. + properties: + data: + $ref: "#/components/schemas/AwsWifIntakeMappingCreateData" + required: + - data + type: object + AwsWifIntakeMappingData: + description: An AWS WIF intake mapping resource. + properties: + attributes: + $ref: "#/components/schemas/AwsWifIntakeMappingAttributes" + id: + description: The UUID of the intake mapping. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + format: uuid + type: string + type: + $ref: "#/components/schemas/AwsWifIntakeMappingType" + required: + - id + - type + - attributes + type: object + AwsWifIntakeMappingResponse: + description: Response containing a single AWS WIF intake mapping. + properties: + data: + $ref: "#/components/schemas/AwsWifIntakeMappingData" + required: + - data + type: object + AwsWifIntakeMappingType: + description: Type identifier for an AWS WIF intake mapping. + enum: + - aws_wif_intake_mapping + example: aws_wif_intake_mapping + type: string + x-enum-varnames: + - AWS_WIF_INTAKE_MAPPING + AwsWifIntakeMappingsResponse: + description: Response containing a list of AWS WIF intake mappings. + properties: + data: + items: + $ref: "#/components/schemas/AwsWifIntakeMappingData" + type: array + required: + - data + type: object + AwsWifPersonaMappingAttributes: + description: Attributes of an AWS WIF persona mapping. + properties: + account_identifier: + description: The Datadog user handle (email address) to map the AWS principal to. + example: "user@example.com" + type: string + account_uuid: + description: The Datadog user UUID corresponding to `account_identifier`. Read-only — set by the server. + example: "12bbdc5c-5966-47e0-8733-285f9e44bcf4" + format: uuid + type: string + arn_pattern: + description: |- + The AWS IAM ARN pattern identifying the role or user that will be mapped. + Supports wildcards (`*`) to match multiple principals within an account. + example: "arn:aws:iam::123456789012:role/my-workload-role" + type: string + required: + - arn_pattern + - account_identifier + type: object + AwsWifPersonaMappingCreateAttributes: + description: Attributes for creating an AWS WIF persona mapping. + properties: + account_identifier: + description: The Datadog user handle (email address) to map the AWS principal to. + example: "user@example.com" + type: string + arn_pattern: + description: |- + The AWS IAM ARN pattern identifying the role or user that will be mapped. + Supports wildcards (`*`) to match multiple principals within an account. + example: "arn:aws:iam::123456789012:role/my-workload-role" + type: string + required: + - arn_pattern + - account_identifier + type: object + AwsWifPersonaMappingCreateData: + description: Data for creating an AWS WIF persona mapping. + properties: + attributes: + $ref: "#/components/schemas/AwsWifPersonaMappingCreateAttributes" + type: + $ref: "#/components/schemas/AwsWifPersonaMappingType" + required: + - type + - attributes + type: object + AwsWifPersonaMappingCreateRequest: + description: Request body for creating an AWS WIF persona mapping. + properties: + data: + $ref: "#/components/schemas/AwsWifPersonaMappingCreateData" + required: + - data + type: object + AwsWifPersonaMappingData: + description: An AWS WIF persona mapping resource. + properties: + attributes: + $ref: "#/components/schemas/AwsWifPersonaMappingAttributes" + id: + description: The UUID of the persona mapping. + example: "c5c758c6-18c2-4484-ae3f-46b84128404a" + format: uuid + type: string + type: + $ref: "#/components/schemas/AwsWifPersonaMappingType" + required: + - id + - type + - attributes + type: object + AwsWifPersonaMappingResponse: + description: Response containing a single AWS WIF persona mapping. + properties: + data: + $ref: "#/components/schemas/AwsWifPersonaMappingData" + required: + - data + type: object + AwsWifPersonaMappingType: + description: Type identifier for an AWS WIF persona mapping. + enum: + - aws_wif_config + example: aws_wif_config + type: string + x-enum-varnames: + - AWS_WIF_CONFIG + AwsWifPersonaMappingsResponse: + description: Response containing a list of AWS WIF persona mappings. + properties: + data: + items: + $ref: "#/components/schemas/AwsWifPersonaMappingData" + type: array + required: + - data + type: object AzureCredentials: description: The definition of the `AzureCredentials` object. oneOf: @@ -29812,6 +29996,55 @@ components: oneOf: - $ref: "#/components/schemas/StatusPagesUser" - $ref: "#/components/schemas/StatusPageAsIncluded" + DelegatedTokenAttributes: + description: Attributes of a delegated token. + properties: + access_token: + description: A short-lived JWT representing the authenticated Datadog user. Pass this as a bearer token in subsequent API calls. + example: "eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9..." + type: string + expires: + description: The expiry time of the token. + example: "2024-01-15T11:30:00Z" + format: date-time + type: string + required: + - access_token + - expires + type: object + DelegatedTokenData: + description: A delegated token resource. + properties: + attributes: + $ref: "#/components/schemas/DelegatedTokenAttributes" + id: + description: A random UUID assigned to this token issuance. + example: "550e8400-e29b-41d4-a716-446655440000" + format: uuid + type: string + type: + $ref: "#/components/schemas/DelegatedTokenType" + required: + - id + - type + - attributes + type: object + DelegatedTokenResponse: + description: Response containing a delegated user token. + properties: + data: + $ref: "#/components/schemas/DelegatedTokenData" + required: + - data + type: object + DelegatedTokenType: + description: The resource type for a delegated token. + enum: + - token + example: token + type: string + x-enum-varnames: + - TOKEN DeleteAppResponse: description: The response object after an app is successfully deleted. properties: @@ -45556,6 +45789,54 @@ components: - ARRAY_NUMBER - ARRAY_BOOLEAN - ARRAY_OBJECT + IntakeAPIKeyAttributes: + description: Attributes of an intake API key returned after successful authentication. + properties: + api_key: + description: The Datadog API key the workload can use to send telemetry. + example: "abc123def456..." + type: string + org_id: + description: The numeric ID of the Datadog organization the API key belongs to. + example: 123456 + format: int64 + type: integer + required: + - api_key + - org_id + type: object + IntakeAPIKeyData: + description: An intake API key resource. + properties: + attributes: + $ref: "#/components/schemas/IntakeAPIKeyAttributes" + id: + description: A stable identifier for the intake key, scoped to the matched organization. + example: "intake-123456" + type: string + type: + $ref: "#/components/schemas/IntakeAPIKeyType" + required: + - id + - type + - attributes + type: object + IntakeAPIKeyResponse: + description: Response containing an intake API key for the authenticated cloud workload. + properties: + data: + $ref: "#/components/schemas/IntakeAPIKeyData" + required: + - data + type: object + IntakeAPIKeyType: + description: The resource type for an intake API key. + enum: + - intake_api_key + example: intake_api_key + type: string + x-enum-varnames: + - INTAKE_API_KEY IntakePayloadAccepted: description: The payload accepted for intake. properties: @@ -120040,6 +120321,7 @@ paths: - test_optimization_read /api/v2/cloud_auth/aws/persona_mapping: get: + deprecated: true description: List all AWS cloud authentication persona mappings. This endpoint retrieves all configured persona mappings that associate AWS IAM principals with Datadog users. operationId: ListAWSCloudAuthPersonaMappings responses: @@ -120076,10 +120358,14 @@ paths: summary: List AWS cloud authentication persona mappings tags: - Cloud Authentication + x-deprecated: |- + **Deprecated**: Use `ListAwsWifPersonaMappings` (`GET /api/v2/wif/aws/persona_mapping`) instead. + x-sunset: "2027-01-01" x-unstable: |- **Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: + deprecated: true description: Create an AWS cloud authentication persona mapping. This endpoint associates an AWS IAM principal with a Datadog user. operationId: CreateAWSCloudAuthPersonaMapping requestBody: @@ -120137,11 +120423,15 @@ paths: tags: - Cloud Authentication x-codegen-request-body-name: body + x-deprecated: |- + **Deprecated**: Use `CreateAwsWifPersonaMapping` (`POST /api/v2/wif/aws/persona_mapping`) instead. + x-sunset: "2027-01-01" x-unstable: |- **Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}: delete: + deprecated: true description: Delete an AWS cloud authentication persona mapping by ID. This removes the association between an AWS IAM principal and a Datadog user. operationId: DeleteAWSCloudAuthPersonaMapping parameters: @@ -120166,10 +120456,14 @@ paths: summary: Delete an AWS cloud authentication persona mapping tags: - Cloud Authentication + x-deprecated: |- + **Deprecated**: Use `DeleteAwsWifPersonaMapping` (`DELETE /api/v2/wif/aws/persona_mapping/{config_uuid}`) instead. + x-sunset: "2027-01-01" x-unstable: |- **Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). get: + deprecated: true description: Get a specific AWS cloud authentication persona mapping by ID. This endpoint retrieves a single configured persona mapping that associates an AWS IAM principal with a Datadog user. operationId: GetAWSCloudAuthPersonaMapping parameters: @@ -120208,6 +120502,9 @@ paths: summary: Get an AWS cloud authentication persona mapping tags: - Cloud Authentication + x-deprecated: |- + **Deprecated**: Use `GetAwsWifPersonaMapping` (`GET /api/v2/wif/aws/persona_mapping/{config_uuid}`) instead. + x-sunset: "2027-01-01" x-unstable: |- **Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). @@ -127393,6 +127690,54 @@ paths: x-unstable: |- **Note: Data Access is in preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).** + /api/v2/delegated-token: + post: + description: |- + Exchange a Workload Identity Federation (WIF) proof or Datadog credentials for a short-lived access token + scoped to a Datadog user. + + To authenticate with a WIF identity, pass the cloud-provider token in the `Authorization` header using + the `Bearer` or `Delegated` scheme. Datadog resolves the Datadog user from the persona mapping configured + for that cloud identity. + + To obtain a token for the calling user directly, authenticate with standard Datadog API and application keys. + + Use the returned `access_token` as a bearer token in subsequent API calls. + operationId: GetDelegatedToken + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + access_token: "eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9..." + expires: "2024-01-15T11:30:00Z" + id: "550e8400-e29b-41d4-a716-446655440000" + type: token + schema: + $ref: "#/components/schemas/DelegatedTokenResponse" + description: OK + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized — missing or invalid authorization proof. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden — the cloud identity is not mapped to any Datadog user, or the authenticated user does not have access. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: [] + summary: Get a delegated token + tags: + - Delegated Token /api/v2/deletion/data/{product}: post: description: Creates a data deletion request by providing a query and a timeframe targeting the proper data. @@ -136004,6 +136349,55 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/intake-key: + post: + description: |- + Exchanges a Workload Identity Federation (WIF) identity proof for a Datadog API key associated with the matching WIF intake mapping. + + Pass a cloud-provider token in the `Authorization` header using the `Bearer` or `Delegated` scheme. + The token is validated against the WIF intake mappings configured for the caller's organization. On success, + a managed-rotation API key is returned that the workload can use to send telemetry to Datadog. + + Unlike the delegated-token endpoint (`POST /api/v2/delegated-token`), this endpoint authenticates + the cloud workload at the organization level rather than mapping it to a specific Datadog user. + + Standard Datadog API and application key authentication is not accepted. Authenticate using a + cloud-provider token in the `Authorization: Bearer` header. + operationId: GetIntakeKey + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + api_key: "abc123def456..." + org_id: 123456 + id: "intake-123456" + type: intake_api_key + schema: + $ref: "#/components/schemas/IntakeAPIKeyResponse" + description: OK + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized — missing or invalid authorization proof. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden — the cloud identity is not matched by any intake mapping for this organization. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: [] + summary: Get an intake API key + tags: + - Intake Key /api/v2/integration/aws/accounts: get: description: Get a list of AWS Account Integration Configs. @@ -189631,6 +190025,373 @@ paths: - generate_log_reports - manage_log_reports - product_analytics_saved_widgets_write + /api/v2/wif/aws/intake_mapping: + get: + description: List every AWS WIF intake mapping configured for the caller's organization. + operationId: ListAwsWifIntakeMappings + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + arn_pattern: "arn:aws:iam::123456789012:role/my-agent-role" + id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: aws_wif_intake_mapping + schema: + $ref: "#/components/schemas/AwsWifIntakeMappingsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workload_identity_federation_read + summary: List AWS WIF intake mappings + tags: + - AWS WIF + post: + description: Create an AWS WIF intake mapping. The mapping binds an IAM role ARN pattern to a managed-rotation API key, allowing AWS workloads to send telemetry to Datadog without requiring a delegated user token. + operationId: CreateAwsWifIntakeMapping + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + arn_pattern: "arn:aws:iam::123456789012:role/my-agent-role" + type: aws_wif_intake_mapping + schema: + $ref: "#/components/schemas/AwsWifIntakeMappingCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + arn_pattern: "arn:aws:iam::123456789012:role/my-agent-role" + id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: aws_wif_intake_mapping + schema: + $ref: "#/components/schemas/AwsWifIntakeMappingResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workload_identity_federation_write + summary: Create an AWS WIF intake mapping + tags: + - AWS WIF + x-codegen-request-body-name: body + /api/v2/wif/aws/intake_mapping/{config_uuid}: + delete: + description: Delete an AWS WIF intake mapping by UUID. The associated managed-rotation API key is left intact, but AWS workloads that previously matched this mapping will lose intake access. + operationId: DeleteAwsWifIntakeMapping + parameters: + - $ref: "#/components/parameters/WifConfigUUID" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workload_identity_federation_write + summary: Delete an AWS WIF intake mapping + tags: + - AWS WIF + get: + description: Retrieve a single AWS WIF intake mapping by UUID. + operationId: GetAwsWifIntakeMapping + parameters: + - $ref: "#/components/parameters/WifConfigUUID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + arn_pattern: "arn:aws:iam::123456789012:role/my-agent-role" + id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: aws_wif_intake_mapping + schema: + $ref: "#/components/schemas/AwsWifIntakeMappingResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workload_identity_federation_read + summary: Get an AWS WIF intake mapping + tags: + - AWS WIF + /api/v2/wif/aws/persona_mapping: + get: + description: List every AWS WIF persona mapping configured for the caller's organization. + operationId: ListAwsWifPersonaMappings + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + account_identifier: "user@example.com" + account_uuid: "12bbdc5c-5966-47e0-8733-285f9e44bcf4" + arn_pattern: "arn:aws:iam::123456789012:role/my-workload-role" + id: "c5c758c6-18c2-4484-ae3f-46b84128404a" + type: aws_wif_config + schema: + $ref: "#/components/schemas/AwsWifPersonaMappingsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workload_identity_federation_read + summary: List AWS WIF persona mappings + tags: + - AWS WIF + post: + description: Create an AWS Workload Identity Federation (WIF) persona mapping. The mapping binds an IAM role ARN pattern to a Datadog user handle, which is used to authenticate delegated-token requests from that AWS identity. + operationId: CreateAwsWifPersonaMapping + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + account_identifier: "user@example.com" + arn_pattern: "arn:aws:iam::123456789012:role/my-workload-role" + type: aws_wif_config + schema: + $ref: "#/components/schemas/AwsWifPersonaMappingCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + account_identifier: "user@example.com" + account_uuid: "12bbdc5c-5966-47e0-8733-285f9e44bcf4" + arn_pattern: "arn:aws:iam::123456789012:role/my-workload-role" + id: "c5c758c6-18c2-4484-ae3f-46b84128404a" + type: aws_wif_config + schema: + $ref: "#/components/schemas/AwsWifPersonaMappingResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workload_identity_federation_write + summary: Create an AWS WIF persona mapping + tags: + - AWS WIF + x-codegen-request-body-name: body + /api/v2/wif/aws/persona_mapping/{config_uuid}: + delete: + description: Delete an AWS WIF persona mapping by UUID. Subsequent delegated-token requests from the previously mapped AWS identity will be denied. + operationId: DeleteAwsWifPersonaMapping + parameters: + - $ref: "#/components/parameters/WifConfigUUID" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workload_identity_federation_write + summary: Delete an AWS WIF persona mapping + tags: + - AWS WIF + get: + description: Retrieve a single AWS WIF persona mapping by UUID. + operationId: GetAwsWifPersonaMapping + parameters: + - $ref: "#/components/parameters/WifConfigUUID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + account_identifier: "user@example.com" + account_uuid: "12bbdc5c-5966-47e0-8733-285f9e44bcf4" + arn_pattern: "arn:aws:iam::123456789012:role/my-workload-role" + id: "c5c758c6-18c2-4484-ae3f-46b84128404a" + type: aws_wif_config + schema: + $ref: "#/components/schemas/AwsWifPersonaMappingResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workload_identity_federation_read + summary: Get an AWS WIF persona mapping + tags: + - AWS WIF /api/v2/workflows: get: description: List all workflows in your organization. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). @@ -190292,6 +191053,11 @@ tags: externalDocs: url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection name: AWS Logs Integration + - description: |- + Manage AWS Workload Identity Federation (WIF) mappings. + Persona mappings link IAM role ARN patterns to Datadog users for delegated-token authentication. + Intake mappings link IAM role ARN patterns to managed-rotation API keys for agent telemetry ingestion. + name: AWS WIF - description: |- Action connections extend your installed integrations and allow you to take action in your third-party systems (e.g. AWS, GitLab, and Statuspage) with Datadog’s Workflow Automation and App Builder products. @@ -190463,6 +191229,10 @@ tags: access to sensitive data. By defining Restricted Datasets, you can ensure that only specific teams or roles can view certain types of telemetry (for example, logs, traces, metrics, and RUM data). name: Datasets + - description: |- + Exchange a cloud-provider identity proof or Datadog credential for a short-lived delegated-user JWT + via Workload Identity Federation. + name: Delegated Token - description: |- Manage Deployment Gates using this API to reduce the likelihood and impact of incidents caused by deployments. See the [Deployment Gates documentation](https://docs.datadoghq.com/deployment_gates/) for more information. name: Deployment Gates @@ -190547,6 +191317,9 @@ tags: name: IP Allowlist - description: Manage incident response, as well as associated attachments, metadata, and todos. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. name: Incidents + - description: |- + Exchange a cloud-provider identity proof for a Datadog API key via Workload Identity Federation intake mappings. + name: Intake Key - description: |- The Integrations API is used to list available integrations and retrieve information about their installation status. diff --git a/examples/v2/aws-wif/CreateAwsWifIntakeMapping.rb b/examples/v2/aws-wif/CreateAwsWifIntakeMapping.rb new file mode 100644 index 000000000000..4734ca3a7bf5 --- /dev/null +++ b/examples/v2/aws-wif/CreateAwsWifIntakeMapping.rb @@ -0,0 +1,14 @@ +# Create an AWS WIF intake mapping returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSWIFAPI.new + +body = DatadogAPIClient::V2::AwsWifIntakeMappingCreateRequest.new({ + data: DatadogAPIClient::V2::AwsWifIntakeMappingCreateData.new({ + attributes: DatadogAPIClient::V2::AwsWifIntakeMappingAttributes.new({ + arn_pattern: "arn:aws:iam::123456789012:role/my-agent-role", + }), + type: DatadogAPIClient::V2::AwsWifIntakeMappingType::AWS_WIF_INTAKE_MAPPING, + }), +}) +p api_instance.create_aws_wif_intake_mapping(body) diff --git a/examples/v2/aws-wif/CreateAwsWifPersonaMapping.rb b/examples/v2/aws-wif/CreateAwsWifPersonaMapping.rb new file mode 100644 index 000000000000..b75aadf883db --- /dev/null +++ b/examples/v2/aws-wif/CreateAwsWifPersonaMapping.rb @@ -0,0 +1,15 @@ +# Create an AWS WIF persona mapping returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSWIFAPI.new + +body = DatadogAPIClient::V2::AwsWifPersonaMappingCreateRequest.new({ + data: DatadogAPIClient::V2::AwsWifPersonaMappingCreateData.new({ + attributes: DatadogAPIClient::V2::AwsWifPersonaMappingCreateAttributes.new({ + account_identifier: "user@example.com", + arn_pattern: "arn:aws:iam::123456789012:role/my-workload-role", + }), + type: DatadogAPIClient::V2::AwsWifPersonaMappingType::AWS_WIF_CONFIG, + }), +}) +p api_instance.create_aws_wif_persona_mapping(body) diff --git a/examples/v2/aws-wif/DeleteAwsWifIntakeMapping.rb b/examples/v2/aws-wif/DeleteAwsWifIntakeMapping.rb new file mode 100644 index 000000000000..0a2056829274 --- /dev/null +++ b/examples/v2/aws-wif/DeleteAwsWifIntakeMapping.rb @@ -0,0 +1,5 @@ +# Delete an AWS WIF intake mapping returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSWIFAPI.new +api_instance.delete_aws_wif_intake_mapping("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/aws-wif/DeleteAwsWifPersonaMapping.rb b/examples/v2/aws-wif/DeleteAwsWifPersonaMapping.rb new file mode 100644 index 000000000000..b71ce6a08e3c --- /dev/null +++ b/examples/v2/aws-wif/DeleteAwsWifPersonaMapping.rb @@ -0,0 +1,5 @@ +# Delete an AWS WIF persona mapping returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSWIFAPI.new +api_instance.delete_aws_wif_persona_mapping("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/aws-wif/GetAwsWifIntakeMapping.rb b/examples/v2/aws-wif/GetAwsWifIntakeMapping.rb new file mode 100644 index 000000000000..3435d4695209 --- /dev/null +++ b/examples/v2/aws-wif/GetAwsWifIntakeMapping.rb @@ -0,0 +1,5 @@ +# Get an AWS WIF intake mapping returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSWIFAPI.new +p api_instance.get_aws_wif_intake_mapping("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/aws-wif/GetAwsWifPersonaMapping.rb b/examples/v2/aws-wif/GetAwsWifPersonaMapping.rb new file mode 100644 index 000000000000..17f0185c41d7 --- /dev/null +++ b/examples/v2/aws-wif/GetAwsWifPersonaMapping.rb @@ -0,0 +1,5 @@ +# Get an AWS WIF persona mapping returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSWIFAPI.new +p api_instance.get_aws_wif_persona_mapping("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/aws-wif/ListAwsWifIntakeMappings.rb b/examples/v2/aws-wif/ListAwsWifIntakeMappings.rb new file mode 100644 index 000000000000..1d9300d876a2 --- /dev/null +++ b/examples/v2/aws-wif/ListAwsWifIntakeMappings.rb @@ -0,0 +1,5 @@ +# List AWS WIF intake mappings returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSWIFAPI.new +p api_instance.list_aws_wif_intake_mappings() diff --git a/examples/v2/aws-wif/ListAwsWifPersonaMappings.rb b/examples/v2/aws-wif/ListAwsWifPersonaMappings.rb new file mode 100644 index 000000000000..0059a29c05ab --- /dev/null +++ b/examples/v2/aws-wif/ListAwsWifPersonaMappings.rb @@ -0,0 +1,5 @@ +# List AWS WIF persona mappings returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSWIFAPI.new +p api_instance.list_aws_wif_persona_mappings() diff --git a/examples/v2/delegated-token/GetDelegatedToken.rb b/examples/v2/delegated-token/GetDelegatedToken.rb new file mode 100644 index 000000000000..ca41783335cf --- /dev/null +++ b/examples/v2/delegated-token/GetDelegatedToken.rb @@ -0,0 +1,5 @@ +# Get a delegated token returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::DelegatedTokenAPI.new +p api_instance.get_delegated_token() diff --git a/examples/v2/intake-key/GetIntakeKey.rb b/examples/v2/intake-key/GetIntakeKey.rb new file mode 100644 index 000000000000..fad0beaa7679 --- /dev/null +++ b/examples/v2/intake-key/GetIntakeKey.rb @@ -0,0 +1,5 @@ +# Get an intake API key returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::IntakeKeyAPI.new +p api_instance.get_intake_key() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 1642b73b84bb..61a72b662bf1 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -5876,6 +5876,24 @@ "uuid" => "UUID", "body" => "CreateOrUpdateWidgetRequest", }, + "v2.CreateAwsWifIntakeMapping" => { + "body" => "AwsWifIntakeMappingCreateRequest", + }, + "v2.DeleteAwsWifIntakeMapping" => { + "config_uuid" => "UUID", + }, + "v2.GetAwsWifIntakeMapping" => { + "config_uuid" => "UUID", + }, + "v2.CreateAwsWifPersonaMapping" => { + "body" => "AwsWifPersonaMappingCreateRequest", + }, + "v2.DeleteAwsWifPersonaMapping" => { + "config_uuid" => "UUID", + }, + "v2.GetAwsWifPersonaMapping" => { + "config_uuid" => "UUID", + }, "v2.ListWorkflows" => { "limit" => "Integer", "page" => "Integer", diff --git a/features/v2/aws_wif.feature b/features/v2/aws_wif.feature new file mode 100644 index 000000000000..922431ffee3d --- /dev/null +++ b/features/v2/aws_wif.feature @@ -0,0 +1,149 @@ +@endpoint(aws-wif) @endpoint(aws-wif-v2) +Feature: AWS WIF + Manage AWS Workload Identity Federation (WIF) mappings. Persona mappings + link IAM role ARN patterns to Datadog users for delegated-token + authentication. Intake mappings link IAM role ARN patterns to managed- + rotation API keys for agent telemetry ingestion. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "AWSWIF" API + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Create an AWS WIF intake mapping returns "Bad Request" response + Given new "CreateAwsWifIntakeMapping" request + And body with value {"data": {"attributes": {"arn_pattern": "arn:aws:iam::123456789012:role/my-agent-role"}, "type": "aws_wif_intake_mapping"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Create an AWS WIF intake mapping returns "Conflict" response + Given new "CreateAwsWifIntakeMapping" request + And body with value {"data": {"attributes": {"arn_pattern": "arn:aws:iam::123456789012:role/my-agent-role"}, "type": "aws_wif_intake_mapping"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Create an AWS WIF intake mapping returns "Created" response + Given new "CreateAwsWifIntakeMapping" request + And body with value {"data": {"attributes": {"arn_pattern": "arn:aws:iam::123456789012:role/my-agent-role"}, "type": "aws_wif_intake_mapping"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Create an AWS WIF persona mapping returns "Bad Request" response + Given new "CreateAwsWifPersonaMapping" request + And body with value {"data": {"attributes": {"account_identifier": "user@example.com", "arn_pattern": "arn:aws:iam::123456789012:role/my-workload-role"}, "type": "aws_wif_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Create an AWS WIF persona mapping returns "Conflict" response + Given new "CreateAwsWifPersonaMapping" request + And body with value {"data": {"attributes": {"account_identifier": "user@example.com", "arn_pattern": "arn:aws:iam::123456789012:role/my-workload-role"}, "type": "aws_wif_config"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Create an AWS WIF persona mapping returns "Created" response + Given new "CreateAwsWifPersonaMapping" request + And body with value {"data": {"attributes": {"account_identifier": "user@example.com", "arn_pattern": "arn:aws:iam::123456789012:role/my-workload-role"}, "type": "aws_wif_config"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete an AWS WIF intake mapping returns "Bad Request" response + Given new "DeleteAwsWifIntakeMapping" request + And request contains "config_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 AWS WIF intake mapping returns "No Content" response + Given new "DeleteAwsWifIntakeMapping" request + And request contains "config_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 AWS WIF intake mapping returns "Not Found" response + Given new "DeleteAwsWifIntakeMapping" request + And request contains "config_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: Delete an AWS WIF persona mapping returns "Bad Request" response + Given new "DeleteAwsWifPersonaMapping" request + And request contains "config_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 AWS WIF persona mapping returns "No Content" response + Given new "DeleteAwsWifPersonaMapping" request + And request contains "config_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 AWS WIF persona mapping returns "Not Found" response + Given new "DeleteAwsWifPersonaMapping" request + And request contains "config_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 AWS WIF intake mapping returns "Bad Request" response + Given new "GetAwsWifIntakeMapping" request + And request contains "config_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 AWS WIF intake mapping returns "Not Found" response + Given new "GetAwsWifIntakeMapping" request + And request contains "config_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 AWS WIF intake mapping returns "OK" response + Given new "GetAwsWifIntakeMapping" request + And request contains "config_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: Get an AWS WIF persona mapping returns "Bad Request" response + Given new "GetAwsWifPersonaMapping" request + And request contains "config_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 AWS WIF persona mapping returns "Not Found" response + Given new "GetAwsWifPersonaMapping" request + And request contains "config_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 AWS WIF persona mapping returns "OK" response + Given new "GetAwsWifPersonaMapping" request + And request contains "config_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: List AWS WIF intake mappings returns "OK" response + Given new "ListAwsWifIntakeMappings" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List AWS WIF persona mappings returns "OK" response + Given new "ListAwsWifPersonaMappings" request + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/cloud_authentication.feature b/features/v2/cloud_authentication.feature index c444f1469c23..03888e59bb81 100644 --- a/features/v2/cloud_authentication.feature +++ b/features/v2/cloud_authentication.feature @@ -8,7 +8,7 @@ Feature: Cloud Authentication And a valid "appKeyAuth" key in the system And an instance of "CloudAuthentication" API - @generated @skip @team:DataDog/team-aaaauthn + @generated @skip @team:DataDog/delegated-auth-login Scenario: Create an AWS cloud authentication persona mapping returns "Bad Request" response Given operation "CreateAWSCloudAuthPersonaMapping" enabled And new "CreateAWSCloudAuthPersonaMapping" request @@ -16,7 +16,7 @@ Feature: Cloud Authentication When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/team-aaaauthn + @generated @skip @team:DataDog/delegated-auth-login Scenario: Create an AWS cloud authentication persona mapping returns "Conflict" response Given operation "CreateAWSCloudAuthPersonaMapping" enabled And new "CreateAWSCloudAuthPersonaMapping" request @@ -24,7 +24,7 @@ Feature: Cloud Authentication When the request is sent Then the response status is 409 Conflict - @generated @skip @team:DataDog/team-aaaauthn + @generated @skip @team:DataDog/delegated-auth-login Scenario: Create an AWS cloud authentication persona mapping returns "Created" response Given operation "CreateAWSCloudAuthPersonaMapping" enabled And new "CreateAWSCloudAuthPersonaMapping" request @@ -32,7 +32,7 @@ Feature: Cloud Authentication When the request is sent Then the response status is 201 Created - @generated @skip @team:DataDog/team-aaaauthn + @generated @skip @team:DataDog/delegated-auth-login Scenario: Delete an AWS cloud authentication persona mapping returns "No Content" response Given operation "DeleteAWSCloudAuthPersonaMapping" enabled And new "DeleteAWSCloudAuthPersonaMapping" request @@ -40,7 +40,7 @@ Feature: Cloud Authentication When the request is sent Then the response status is 204 No Content - @generated @skip @team:DataDog/team-aaaauthn + @generated @skip @team:DataDog/delegated-auth-login Scenario: Delete an AWS cloud authentication persona mapping returns "Not Found" response Given operation "DeleteAWSCloudAuthPersonaMapping" enabled And new "DeleteAWSCloudAuthPersonaMapping" request @@ -48,7 +48,7 @@ Feature: Cloud Authentication When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/team-aaaauthn + @generated @skip @team:DataDog/delegated-auth-login Scenario: Get an AWS cloud authentication persona mapping returns "Not Found" response Given operation "GetAWSCloudAuthPersonaMapping" enabled And new "GetAWSCloudAuthPersonaMapping" request @@ -56,7 +56,7 @@ Feature: Cloud Authentication When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/team-aaaauthn + @generated @skip @team:DataDog/delegated-auth-login Scenario: Get an AWS cloud authentication persona mapping returns "OK" response Given operation "GetAWSCloudAuthPersonaMapping" enabled And new "GetAWSCloudAuthPersonaMapping" request @@ -64,14 +64,14 @@ Feature: Cloud Authentication When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/team-aaaauthn + @generated @skip @team:DataDog/delegated-auth-login Scenario: List AWS cloud authentication persona mappings returns "Bad Request" response Given operation "ListAWSCloudAuthPersonaMappings" enabled And new "ListAWSCloudAuthPersonaMappings" request When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/team-aaaauthn + @generated @skip @team:DataDog/delegated-auth-login Scenario: List AWS cloud authentication persona mappings returns "OK" response Given operation "ListAWSCloudAuthPersonaMappings" enabled And new "ListAWSCloudAuthPersonaMappings" request diff --git a/features/v2/delegated_token.feature b/features/v2/delegated_token.feature new file mode 100644 index 000000000000..343463af38d5 --- /dev/null +++ b/features/v2/delegated_token.feature @@ -0,0 +1,13 @@ +@endpoint(delegated-token) @endpoint(delegated-token-v2) +Feature: Delegated Token + Exchange a cloud-provider identity proof or Datadog credential for a + short-lived delegated-user JWT via Workload Identity Federation. + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get a delegated token returns "OK" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "DelegatedToken" API + And new "GetDelegatedToken" request + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/intake_key.feature b/features/v2/intake_key.feature new file mode 100644 index 000000000000..ddcc5a81f129 --- /dev/null +++ b/features/v2/intake_key.feature @@ -0,0 +1,13 @@ +@endpoint(intake-key) @endpoint(intake-key-v2) +Feature: Intake Key + Exchange a cloud-provider identity proof for a Datadog API key via + Workload Identity Federation intake mappings. + + @generated @skip @team:DataDog/credentials-management + Scenario: Get an intake API key returns "OK" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "IntakeKey" API + And new "GetIntakeKey" request + 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 049cc1252219..d96495cf2733 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2255,6 +2255,12 @@ "type": "idempotent" } }, + "GetDelegatedToken": { + "tag": "Delegated Token", + "undo": { + "type": "idempotent" + } + }, "CreateDataDeletionRequest": { "tag": "Data Deletion", "undo": { @@ -3233,6 +3239,12 @@ "type": "idempotent" } }, + "GetIntakeKey": { + "tag": "Intake Key", + "undo": { + "type": "idempotent" + } + }, "ListAWSAccounts": { "tag": "AWS Integration", "undo": { @@ -9246,6 +9258,68 @@ "type": "safe" } }, + "ListAwsWifIntakeMappings": { + "tag": "AWS WIF", + "undo": { + "type": "safe" + } + }, + "CreateAwsWifIntakeMapping": { + "tag": "AWS WIF", + "undo": { + "operationId": "DeleteAwsWifIntakeMapping", + "parameters": [ + { + "name": "config_uuid", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteAwsWifIntakeMapping": { + "tag": "AWS WIF", + "undo": { + "type": "idempotent" + } + }, + "GetAwsWifIntakeMapping": { + "tag": "AWS WIF", + "undo": { + "type": "safe" + } + }, + "ListAwsWifPersonaMappings": { + "tag": "AWS WIF", + "undo": { + "type": "safe" + } + }, + "CreateAwsWifPersonaMapping": { + "tag": "AWS WIF", + "undo": { + "operationId": "DeleteAwsWifPersonaMapping", + "parameters": [ + { + "name": "config_uuid", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteAwsWifPersonaMapping": { + "tag": "AWS WIF", + "undo": { + "type": "idempotent" + } + }, + "GetAwsWifPersonaMapping": { + "tag": "AWS WIF", + "undo": { + "type": "safe" + } + }, "ListWorkflows": { "tag": "Workflow Automation", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index e4100cdd86e0..34fae480545a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1707,6 +1707,21 @@ def overrides "v2.aws_scan_options_update_data" => "AwsScanOptionsUpdateData", "v2.aws_scan_options_update_request" => "AwsScanOptionsUpdateRequest", "v2.aws_traces_config" => "AWSTracesConfig", + "v2.aws_wif_intake_mapping_attributes" => "AwsWifIntakeMappingAttributes", + "v2.aws_wif_intake_mapping_create_data" => "AwsWifIntakeMappingCreateData", + "v2.aws_wif_intake_mapping_create_request" => "AwsWifIntakeMappingCreateRequest", + "v2.aws_wif_intake_mapping_data" => "AwsWifIntakeMappingData", + "v2.aws_wif_intake_mapping_response" => "AwsWifIntakeMappingResponse", + "v2.aws_wif_intake_mappings_response" => "AwsWifIntakeMappingsResponse", + "v2.aws_wif_intake_mapping_type" => "AwsWifIntakeMappingType", + "v2.aws_wif_persona_mapping_attributes" => "AwsWifPersonaMappingAttributes", + "v2.aws_wif_persona_mapping_create_attributes" => "AwsWifPersonaMappingCreateAttributes", + "v2.aws_wif_persona_mapping_create_data" => "AwsWifPersonaMappingCreateData", + "v2.aws_wif_persona_mapping_create_request" => "AwsWifPersonaMappingCreateRequest", + "v2.aws_wif_persona_mapping_data" => "AwsWifPersonaMappingData", + "v2.aws_wif_persona_mapping_response" => "AwsWifPersonaMappingResponse", + "v2.aws_wif_persona_mappings_response" => "AwsWifPersonaMappingsResponse", + "v2.aws_wif_persona_mapping_type" => "AwsWifPersonaMappingType", "v2.azure_credentials" => "AzureCredentials", "v2.azure_credentials_update" => "AzureCredentialsUpdate", "v2.azure_integration" => "AzureIntegration", @@ -2749,6 +2764,10 @@ def overrides "v2.degradation_data_relationships_status_page" => "DegradationDataRelationshipsStatusPage", "v2.degradation_data_relationships_status_page_data" => "DegradationDataRelationshipsStatusPageData", "v2.degradation_included" => "DegradationIncluded", + "v2.delegated_token_attributes" => "DelegatedTokenAttributes", + "v2.delegated_token_data" => "DelegatedTokenData", + "v2.delegated_token_response" => "DelegatedTokenResponse", + "v2.delegated_token_type" => "DelegatedTokenType", "v2.delete_app_response" => "DeleteAppResponse", "v2.delete_app_response_data" => "DeleteAppResponseData", "v2.delete_apps_datastore_item_request" => "DeleteAppsDatastoreItemRequest", @@ -3761,6 +3780,10 @@ def overrides "v2.input_schema" => "InputSchema", "v2.input_schema_parameters" => "InputSchemaParameters", "v2.input_schema_parameters_type" => "InputSchemaParametersType", + "v2.intake_api_key_attributes" => "IntakeAPIKeyAttributes", + "v2.intake_api_key_data" => "IntakeAPIKeyData", + "v2.intake_api_key_response" => "IntakeAPIKeyResponse", + "v2.intake_api_key_type" => "IntakeAPIKeyType", "v2.intake_payload_accepted" => "IntakePayloadAccepted", "v2.integration" => "Integration", "v2.integration_attributes" => "IntegrationAttributes", @@ -7738,6 +7761,7 @@ def overrides "v2.authn_mappings_api" => "AuthNMappingsAPI", "v2.aws_integration_api" => "AWSIntegrationAPI", "v2.aws_logs_integration_api" => "AWSLogsIntegrationAPI", + "v2.aws_wif_api" => "AWSWIFAPI", "v2.bits_ai_api" => "BitsAIAPI", "v2.case_management_api" => "CaseManagementAPI", "v2.case_management_attribute_api" => "CaseManagementAttributeAPI", @@ -7767,6 +7791,7 @@ def overrides "v2.data_deletion_api" => "DataDeletionAPI", "v2.data_observability_api" => "DataObservabilityAPI", "v2.datasets_api" => "DatasetsAPI", + "v2.delegated_token_api" => "DelegatedTokenAPI", "v2.deployment_gates_api" => "DeploymentGatesAPI", "v2.domain_allowlist_api" => "DomainAllowlistAPI", "v2.dora_metrics_api" => "DORAMetricsAPI", @@ -7784,6 +7809,7 @@ def overrides "v2.governance_insights_api" => "GovernanceInsightsAPI", "v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI", "v2.incidents_api" => "IncidentsAPI", + "v2.intake_key_api" => "IntakeKeyAPI", "v2.integrations_api" => "IntegrationsAPI", "v2.ip_allowlist_api" => "IPAllowlistAPI", "v2.jira_integration_api" => "JiraIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/aws_wif_api.rb b/lib/datadog_api_client/v2/api/aws_wif_api.rb new file mode 100644 index 000000000000..b9e7090d7070 --- /dev/null +++ b/lib/datadog_api_client/v2/api/aws_wif_api.rb @@ -0,0 +1,540 @@ +=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 AWSWIFAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create an AWS WIF intake mapping. + # + # @see #create_aws_wif_intake_mapping_with_http_info + def create_aws_wif_intake_mapping(body, opts = {}) + data, _status_code, _headers = create_aws_wif_intake_mapping_with_http_info(body, opts) + data + end + + # Create an AWS WIF intake mapping. + # + # Create an AWS WIF intake mapping. The mapping binds an IAM role ARN pattern to a managed-rotation API key, allowing AWS workloads to send telemetry to Datadog without requiring a delegated user token. + # + # @param body [AwsWifIntakeMappingCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AwsWifIntakeMappingResponse, Integer, Hash)>] AwsWifIntakeMappingResponse data, response status code and response headers + def create_aws_wif_intake_mapping_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSWIFAPI.create_aws_wif_intake_mapping ...' + 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 AWSWIFAPI.create_aws_wif_intake_mapping" + end + # resource path + local_var_path = '/api/v2/wif/aws/intake_mapping' + + # 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] || 'AwsWifIntakeMappingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_aws_wif_intake_mapping, + :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: AWSWIFAPI#create_aws_wif_intake_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create an AWS WIF persona mapping. + # + # @see #create_aws_wif_persona_mapping_with_http_info + def create_aws_wif_persona_mapping(body, opts = {}) + data, _status_code, _headers = create_aws_wif_persona_mapping_with_http_info(body, opts) + data + end + + # Create an AWS WIF persona mapping. + # + # Create an AWS Workload Identity Federation (WIF) persona mapping. The mapping binds an IAM role ARN pattern to a Datadog user handle, which is used to authenticate delegated-token requests from that AWS identity. + # + # @param body [AwsWifPersonaMappingCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AwsWifPersonaMappingResponse, Integer, Hash)>] AwsWifPersonaMappingResponse data, response status code and response headers + def create_aws_wif_persona_mapping_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSWIFAPI.create_aws_wif_persona_mapping ...' + 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 AWSWIFAPI.create_aws_wif_persona_mapping" + end + # resource path + local_var_path = '/api/v2/wif/aws/persona_mapping' + + # 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] || 'AwsWifPersonaMappingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_aws_wif_persona_mapping, + :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: AWSWIFAPI#create_aws_wif_persona_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an AWS WIF intake mapping. + # + # @see #delete_aws_wif_intake_mapping_with_http_info + def delete_aws_wif_intake_mapping(config_uuid, opts = {}) + delete_aws_wif_intake_mapping_with_http_info(config_uuid, opts) + nil + end + + # Delete an AWS WIF intake mapping. + # + # Delete an AWS WIF intake mapping by UUID. The associated managed-rotation API key is left intact, but AWS workloads that previously matched this mapping will lose intake access. + # + # @param config_uuid [UUID] The UUID of the WIF configuration to operate on. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_aws_wif_intake_mapping_with_http_info(config_uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSWIFAPI.delete_aws_wif_intake_mapping ...' + end + # verify the required parameter 'config_uuid' is set + if @api_client.config.client_side_validation && config_uuid.nil? + fail ArgumentError, "Missing the required parameter 'config_uuid' when calling AWSWIFAPI.delete_aws_wif_intake_mapping" + end + # resource path + local_var_path = '/api/v2/wif/aws/intake_mapping/{config_uuid}'.sub('{config_uuid}', CGI.escape(config_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, :AuthZ] + + new_options = opts.merge( + :operation => :delete_aws_wif_intake_mapping, + :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: AWSWIFAPI#delete_aws_wif_intake_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an AWS WIF persona mapping. + # + # @see #delete_aws_wif_persona_mapping_with_http_info + def delete_aws_wif_persona_mapping(config_uuid, opts = {}) + delete_aws_wif_persona_mapping_with_http_info(config_uuid, opts) + nil + end + + # Delete an AWS WIF persona mapping. + # + # Delete an AWS WIF persona mapping by UUID. Subsequent delegated-token requests from the previously mapped AWS identity will be denied. + # + # @param config_uuid [UUID] The UUID of the WIF configuration to operate on. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_aws_wif_persona_mapping_with_http_info(config_uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSWIFAPI.delete_aws_wif_persona_mapping ...' + end + # verify the required parameter 'config_uuid' is set + if @api_client.config.client_side_validation && config_uuid.nil? + fail ArgumentError, "Missing the required parameter 'config_uuid' when calling AWSWIFAPI.delete_aws_wif_persona_mapping" + end + # resource path + local_var_path = '/api/v2/wif/aws/persona_mapping/{config_uuid}'.sub('{config_uuid}', CGI.escape(config_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, :AuthZ] + + new_options = opts.merge( + :operation => :delete_aws_wif_persona_mapping, + :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: AWSWIFAPI#delete_aws_wif_persona_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an AWS WIF intake mapping. + # + # @see #get_aws_wif_intake_mapping_with_http_info + def get_aws_wif_intake_mapping(config_uuid, opts = {}) + data, _status_code, _headers = get_aws_wif_intake_mapping_with_http_info(config_uuid, opts) + data + end + + # Get an AWS WIF intake mapping. + # + # Retrieve a single AWS WIF intake mapping by UUID. + # + # @param config_uuid [UUID] The UUID of the WIF configuration to operate on. + # @param opts [Hash] the optional parameters + # @return [Array<(AwsWifIntakeMappingResponse, Integer, Hash)>] AwsWifIntakeMappingResponse data, response status code and response headers + def get_aws_wif_intake_mapping_with_http_info(config_uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSWIFAPI.get_aws_wif_intake_mapping ...' + end + # verify the required parameter 'config_uuid' is set + if @api_client.config.client_side_validation && config_uuid.nil? + fail ArgumentError, "Missing the required parameter 'config_uuid' when calling AWSWIFAPI.get_aws_wif_intake_mapping" + end + # resource path + local_var_path = '/api/v2/wif/aws/intake_mapping/{config_uuid}'.sub('{config_uuid}', CGI.escape(config_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] || 'AwsWifIntakeMappingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_aws_wif_intake_mapping, + :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: AWSWIFAPI#get_aws_wif_intake_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an AWS WIF persona mapping. + # + # @see #get_aws_wif_persona_mapping_with_http_info + def get_aws_wif_persona_mapping(config_uuid, opts = {}) + data, _status_code, _headers = get_aws_wif_persona_mapping_with_http_info(config_uuid, opts) + data + end + + # Get an AWS WIF persona mapping. + # + # Retrieve a single AWS WIF persona mapping by UUID. + # + # @param config_uuid [UUID] The UUID of the WIF configuration to operate on. + # @param opts [Hash] the optional parameters + # @return [Array<(AwsWifPersonaMappingResponse, Integer, Hash)>] AwsWifPersonaMappingResponse data, response status code and response headers + def get_aws_wif_persona_mapping_with_http_info(config_uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSWIFAPI.get_aws_wif_persona_mapping ...' + end + # verify the required parameter 'config_uuid' is set + if @api_client.config.client_side_validation && config_uuid.nil? + fail ArgumentError, "Missing the required parameter 'config_uuid' when calling AWSWIFAPI.get_aws_wif_persona_mapping" + end + # resource path + local_var_path = '/api/v2/wif/aws/persona_mapping/{config_uuid}'.sub('{config_uuid}', CGI.escape(config_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] || 'AwsWifPersonaMappingResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_aws_wif_persona_mapping, + :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: AWSWIFAPI#get_aws_wif_persona_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List AWS WIF intake mappings. + # + # @see #list_aws_wif_intake_mappings_with_http_info + def list_aws_wif_intake_mappings(opts = {}) + data, _status_code, _headers = list_aws_wif_intake_mappings_with_http_info(opts) + data + end + + # List AWS WIF intake mappings. + # + # List every AWS WIF intake mapping configured for the caller's organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(AwsWifIntakeMappingsResponse, Integer, Hash)>] AwsWifIntakeMappingsResponse data, response status code and response headers + def list_aws_wif_intake_mappings_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSWIFAPI.list_aws_wif_intake_mappings ...' + end + # resource path + local_var_path = '/api/v2/wif/aws/intake_mapping' + + # 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] || 'AwsWifIntakeMappingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_aws_wif_intake_mappings, + :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: AWSWIFAPI#list_aws_wif_intake_mappings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List AWS WIF persona mappings. + # + # @see #list_aws_wif_persona_mappings_with_http_info + def list_aws_wif_persona_mappings(opts = {}) + data, _status_code, _headers = list_aws_wif_persona_mappings_with_http_info(opts) + data + end + + # List AWS WIF persona mappings. + # + # List every AWS WIF persona mapping configured for the caller's organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(AwsWifPersonaMappingsResponse, Integer, Hash)>] AwsWifPersonaMappingsResponse data, response status code and response headers + def list_aws_wif_persona_mappings_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSWIFAPI.list_aws_wif_persona_mappings ...' + end + # resource path + local_var_path = '/api/v2/wif/aws/persona_mapping' + + # 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] || 'AwsWifPersonaMappingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_aws_wif_persona_mappings, + :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: AWSWIFAPI#list_aws_wif_persona_mappings\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/api/cloud_authentication_api.rb b/lib/datadog_api_client/v2/api/cloud_authentication_api.rb index 477397facab7..6cafd90c5962 100644 --- a/lib/datadog_api_client/v2/api/cloud_authentication_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_authentication_api.rb @@ -35,10 +35,13 @@ def create_aws_cloud_auth_persona_mapping(body, opts = {}) # # Create an AWS cloud authentication persona mapping. This endpoint associates an AWS IAM principal with a Datadog user. # + # @deprecated This API is deprecated. + # # @param body [AWSCloudAuthPersonaMappingCreateRequest] # @param opts [Hash] the optional parameters # @return [Array<(AWSCloudAuthPersonaMappingResponse, Integer, Hash)>] AWSCloudAuthPersonaMappingResponse data, response status code and response headers def create_aws_cloud_auth_persona_mapping_with_http_info(body, opts = {}) + warn "[DEPRECATION] `CreateAWSCloudAuthPersonaMapping` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.create_aws_cloud_auth_persona_mapping".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_aws_cloud_auth_persona_mapping") @@ -108,10 +111,13 @@ def delete_aws_cloud_auth_persona_mapping(persona_mapping_id, opts = {}) # # Delete an AWS cloud authentication persona mapping by ID. This removes the association between an AWS IAM principal and a Datadog user. # + # @deprecated This API is deprecated. + # # @param persona_mapping_id [String] The ID of the persona mapping # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_aws_cloud_auth_persona_mapping_with_http_info(persona_mapping_id, opts = {}) + warn "[DEPRECATION] `DeleteAWSCloudAuthPersonaMapping` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.delete_aws_cloud_auth_persona_mapping".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_aws_cloud_auth_persona_mapping") @@ -179,10 +185,13 @@ def get_aws_cloud_auth_persona_mapping(persona_mapping_id, opts = {}) # # Get a specific AWS cloud authentication persona mapping by ID. This endpoint retrieves a single configured persona mapping that associates an AWS IAM principal with a Datadog user. # + # @deprecated This API is deprecated. + # # @param persona_mapping_id [String] The ID of the persona mapping # @param opts [Hash] the optional parameters # @return [Array<(AWSCloudAuthPersonaMappingResponse, Integer, Hash)>] AWSCloudAuthPersonaMappingResponse data, response status code and response headers def get_aws_cloud_auth_persona_mapping_with_http_info(persona_mapping_id, opts = {}) + warn "[DEPRECATION] `GetAWSCloudAuthPersonaMapping` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.get_aws_cloud_auth_persona_mapping".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_aws_cloud_auth_persona_mapping") @@ -250,9 +259,12 @@ def list_aws_cloud_auth_persona_mappings(opts = {}) # # List all AWS cloud authentication persona mappings. This endpoint retrieves all configured persona mappings that associate AWS IAM principals with Datadog users. # + # @deprecated This API is deprecated. + # # @param opts [Hash] the optional parameters # @return [Array<(AWSCloudAuthPersonaMappingsResponse, Integer, Hash)>] AWSCloudAuthPersonaMappingsResponse data, response status code and response headers def list_aws_cloud_auth_persona_mappings_with_http_info(opts = {}) + warn "[DEPRECATION] `ListAWSCloudAuthPersonaMappings` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.list_aws_cloud_auth_persona_mappings".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_aws_cloud_auth_persona_mappings") diff --git a/lib/datadog_api_client/v2/api/delegated_token_api.rb b/lib/datadog_api_client/v2/api/delegated_token_api.rb new file mode 100644 index 000000000000..f5af49b18d01 --- /dev/null +++ b/lib/datadog_api_client/v2/api/delegated_token_api.rb @@ -0,0 +1,95 @@ +=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 DelegatedTokenAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get a delegated token. + # + # @see #get_delegated_token_with_http_info + def get_delegated_token(opts = {}) + data, _status_code, _headers = get_delegated_token_with_http_info(opts) + data + end + + # Get a delegated token. + # + # Exchange a Workload Identity Federation (WIF) proof or Datadog credentials for a short-lived access token + # scoped to a Datadog user. + # + # To authenticate with a WIF identity, pass the cloud-provider token in the `Authorization` header using + # the `Bearer` or `Delegated` scheme. Datadog resolves the Datadog user from the persona mapping configured + # for that cloud identity. + # + # To obtain a token for the calling user directly, authenticate with standard Datadog API and application keys. + # + # Use the returned `access_token` as a bearer token in subsequent API calls. + # + # @param opts [Hash] the optional parameters + # @return [Array<(DelegatedTokenResponse, Integer, Hash)>] DelegatedTokenResponse data, response status code and response headers + def get_delegated_token_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DelegatedTokenAPI.get_delegated_token ...' + end + # resource path + local_var_path = '/api/v2/delegated-token' + + # 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] || 'DelegatedTokenResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :get_delegated_token, + :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: DelegatedTokenAPI#get_delegated_token\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/api/intake_key_api.rb b/lib/datadog_api_client/v2/api/intake_key_api.rb new file mode 100644 index 000000000000..e7abb232a19d --- /dev/null +++ b/lib/datadog_api_client/v2/api/intake_key_api.rb @@ -0,0 +1,96 @@ +=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 IntakeKeyAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get an intake API key. + # + # @see #get_intake_key_with_http_info + def get_intake_key(opts = {}) + data, _status_code, _headers = get_intake_key_with_http_info(opts) + data + end + + # Get an intake API key. + # + # Exchanges a Workload Identity Federation (WIF) identity proof for a Datadog API key associated with the matching WIF intake mapping. + # + # Pass a cloud-provider token in the `Authorization` header using the `Bearer` or `Delegated` scheme. + # The token is validated against the WIF intake mappings configured for the caller's organization. On success, + # a managed-rotation API key is returned that the workload can use to send telemetry to Datadog. + # + # Unlike the delegated-token endpoint (`POST /api/v2/delegated-token`), this endpoint authenticates + # the cloud workload at the organization level rather than mapping it to a specific Datadog user. + # + # Standard Datadog API and application key authentication is not accepted. Authenticate using a + # cloud-provider token in the `Authorization: Bearer` header. + # + # @param opts [Hash] the optional parameters + # @return [Array<(IntakeAPIKeyResponse, Integer, Hash)>] IntakeAPIKeyResponse data, response status code and response headers + def get_intake_key_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IntakeKeyAPI.get_intake_key ...' + end + # resource path + local_var_path = '/api/v2/intake-key' + + # 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] || 'IntakeAPIKeyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :get_intake_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::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IntakeKeyAPI#get_intake_key\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/aws_wif_intake_mapping_attributes.rb b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_attributes.rb new file mode 100644 index 000000000000..59602a1f8734 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_attributes.rb @@ -0,0 +1,124 @@ +=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 AWS WIF intake mapping. + class AwsWifIntakeMappingAttributes + include BaseGenericModel + + # The AWS IAM ARN pattern identifying the role or user permitted to obtain an intake API key. + # Supports wildcards (`*`) to match multiple principals within an account. + attr_reader :arn_pattern + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'arn_pattern' => :'arn_pattern' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'arn_pattern' => :'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::AwsWifIntakeMappingAttributes` 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?(:'arn_pattern') + self.arn_pattern = attributes[:'arn_pattern'] + 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 @arn_pattern.nil? + true + end + + # Custom attribute writer method with validation + # @param arn_pattern [Object] Object to be assigned + # @!visibility private + def arn_pattern=(arn_pattern) + if arn_pattern.nil? + fail ArgumentError, 'invalid value for "arn_pattern", arn_pattern cannot be nil.' + end + @arn_pattern = arn_pattern + 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 && + arn_pattern == o.arn_pattern && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [arn_pattern, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_create_data.rb b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_create_data.rb new file mode 100644 index 000000000000..b3cefaaa898e --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_create_data.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 + # Data for creating an AWS WIF intake mapping. + class AwsWifIntakeMappingCreateData + include BaseGenericModel + + # Attributes of an AWS WIF intake mapping. + attr_reader :attributes + + # Type identifier for an AWS WIF intake mapping. + 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' => :'AwsWifIntakeMappingAttributes', + :'type' => :'AwsWifIntakeMappingType' + } + 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::AwsWifIntakeMappingCreateData` 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 @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 && + 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/aws_wif_intake_mapping_create_request.rb b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_create_request.rb new file mode 100644 index 000000000000..d183145b15d2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_create_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 an AWS WIF intake mapping. + class AwsWifIntakeMappingCreateRequest + include BaseGenericModel + + # Data for creating an AWS WIF intake mapping. + 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' => :'AwsWifIntakeMappingCreateData' + } + 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::AwsWifIntakeMappingCreateRequest` 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/aws_wif_intake_mapping_data.rb b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_data.rb new file mode 100644 index 000000000000..36b7c6aa0d51 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_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 + # An AWS WIF intake mapping resource. + class AwsWifIntakeMappingData + include BaseGenericModel + + # Attributes of an AWS WIF intake mapping. + attr_reader :attributes + + # The UUID of the intake mapping. + attr_reader :id + + # Type identifier for an AWS WIF intake mapping. + 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' => :'AwsWifIntakeMappingAttributes', + :'id' => :'UUID', + :'type' => :'AwsWifIntakeMappingType' + } + 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::AwsWifIntakeMappingData` 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/aws_wif_intake_mapping_response.rb b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_response.rb new file mode 100644 index 000000000000..af488b699e46 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_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 containing a single AWS WIF intake mapping. + class AwsWifIntakeMappingResponse + include BaseGenericModel + + # An AWS WIF intake mapping resource. + 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' => :'AwsWifIntakeMappingData' + } + 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::AwsWifIntakeMappingResponse` 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/aws_wif_intake_mapping_type.rb b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_type.rb new file mode 100644 index 000000000000..961a55debf13 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_intake_mapping_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 identifier for an AWS WIF intake mapping. + class AwsWifIntakeMappingType + include BaseEnumModel + + AWS_WIF_INTAKE_MAPPING = "aws_wif_intake_mapping".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/aws_wif_intake_mappings_response.rb b/lib/datadog_api_client/v2/models/aws_wif_intake_mappings_response.rb new file mode 100644 index 000000000000..3721a96a0b73 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_intake_mappings_response.rb @@ -0,0 +1,125 @@ +=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 containing a list of AWS WIF intake mappings. + class AwsWifIntakeMappingsResponse + include BaseGenericModel + + # + 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' => :'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::AwsWifIntakeMappingsResponse` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = 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 @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/aws_wif_persona_mapping_attributes.rb b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_attributes.rb new file mode 100644 index 000000000000..2cd7a45062e4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_attributes.rb @@ -0,0 +1,155 @@ +=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 AWS WIF persona mapping. + class AwsWifPersonaMappingAttributes + include BaseGenericModel + + # The Datadog user handle (email address) to map the AWS principal to. + attr_reader :account_identifier + + # The Datadog user UUID corresponding to `account_identifier`. Read-only — set by the server. + attr_accessor :account_uuid + + # The AWS IAM ARN pattern identifying the role or user that will be mapped. + # Supports wildcards (`*`) to match multiple principals within an account. + attr_reader :arn_pattern + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_identifier' => :'account_identifier', + :'account_uuid' => :'account_uuid', + :'arn_pattern' => :'arn_pattern' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_identifier' => :'String', + :'account_uuid' => :'UUID', + :'arn_pattern' => :'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::AwsWifPersonaMappingAttributes` 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?(:'account_identifier') + self.account_identifier = attributes[:'account_identifier'] + end + + if attributes.key?(:'account_uuid') + self.account_uuid = attributes[:'account_uuid'] + end + + if attributes.key?(:'arn_pattern') + self.arn_pattern = attributes[:'arn_pattern'] + 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 @account_identifier.nil? + return false if @arn_pattern.nil? + true + end + + # Custom attribute writer method with validation + # @param account_identifier [Object] Object to be assigned + # @!visibility private + def account_identifier=(account_identifier) + if account_identifier.nil? + fail ArgumentError, 'invalid value for "account_identifier", account_identifier cannot be nil.' + end + @account_identifier = account_identifier + end + + # Custom attribute writer method with validation + # @param arn_pattern [Object] Object to be assigned + # @!visibility private + def arn_pattern=(arn_pattern) + if arn_pattern.nil? + fail ArgumentError, 'invalid value for "arn_pattern", arn_pattern cannot be nil.' + end + @arn_pattern = arn_pattern + 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 && + account_identifier == o.account_identifier && + account_uuid == o.account_uuid && + arn_pattern == o.arn_pattern && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_identifier, account_uuid, arn_pattern, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_create_attributes.rb b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_create_attributes.rb new file mode 100644 index 000000000000..0b62ecf47ffd --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_create_attributes.rb @@ -0,0 +1,145 @@ +=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 for creating an AWS WIF persona mapping. + class AwsWifPersonaMappingCreateAttributes + include BaseGenericModel + + # The Datadog user handle (email address) to map the AWS principal to. + attr_reader :account_identifier + + # The AWS IAM ARN pattern identifying the role or user that will be mapped. + # Supports wildcards (`*`) to match multiple principals within an account. + attr_reader :arn_pattern + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_identifier' => :'account_identifier', + :'arn_pattern' => :'arn_pattern' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_identifier' => :'String', + :'arn_pattern' => :'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::AwsWifPersonaMappingCreateAttributes` 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?(:'account_identifier') + self.account_identifier = attributes[:'account_identifier'] + end + + if attributes.key?(:'arn_pattern') + self.arn_pattern = attributes[:'arn_pattern'] + 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 @account_identifier.nil? + return false if @arn_pattern.nil? + true + end + + # Custom attribute writer method with validation + # @param account_identifier [Object] Object to be assigned + # @!visibility private + def account_identifier=(account_identifier) + if account_identifier.nil? + fail ArgumentError, 'invalid value for "account_identifier", account_identifier cannot be nil.' + end + @account_identifier = account_identifier + end + + # Custom attribute writer method with validation + # @param arn_pattern [Object] Object to be assigned + # @!visibility private + def arn_pattern=(arn_pattern) + if arn_pattern.nil? + fail ArgumentError, 'invalid value for "arn_pattern", arn_pattern cannot be nil.' + end + @arn_pattern = arn_pattern + 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 && + account_identifier == o.account_identifier && + arn_pattern == o.arn_pattern && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_identifier, arn_pattern, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_create_data.rb b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_create_data.rb new file mode 100644 index 000000000000..a26088cc9298 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_create_data.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 + # Data for creating an AWS WIF persona mapping. + class AwsWifPersonaMappingCreateData + include BaseGenericModel + + # Attributes for creating an AWS WIF persona mapping. + attr_reader :attributes + + # Type identifier for an AWS WIF persona mapping. + 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' => :'AwsWifPersonaMappingCreateAttributes', + :'type' => :'AwsWifPersonaMappingType' + } + 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::AwsWifPersonaMappingCreateData` 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 @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 && + 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/aws_wif_persona_mapping_create_request.rb b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_create_request.rb new file mode 100644 index 000000000000..d31c6a88c141 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_create_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 an AWS WIF persona mapping. + class AwsWifPersonaMappingCreateRequest + include BaseGenericModel + + # Data for creating an AWS WIF persona mapping. + 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' => :'AwsWifPersonaMappingCreateData' + } + 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::AwsWifPersonaMappingCreateRequest` 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/aws_wif_persona_mapping_data.rb b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_data.rb new file mode 100644 index 000000000000..43ce06aaef60 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_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 + # An AWS WIF persona mapping resource. + class AwsWifPersonaMappingData + include BaseGenericModel + + # Attributes of an AWS WIF persona mapping. + attr_reader :attributes + + # The UUID of the persona mapping. + attr_reader :id + + # Type identifier for an AWS WIF persona mapping. + 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' => :'AwsWifPersonaMappingAttributes', + :'id' => :'UUID', + :'type' => :'AwsWifPersonaMappingType' + } + 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::AwsWifPersonaMappingData` 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/aws_wif_persona_mapping_response.rb b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_response.rb new file mode 100644 index 000000000000..15254406134b --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_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 containing a single AWS WIF persona mapping. + class AwsWifPersonaMappingResponse + include BaseGenericModel + + # An AWS WIF persona mapping resource. + 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' => :'AwsWifPersonaMappingData' + } + 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::AwsWifPersonaMappingResponse` 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/aws_wif_persona_mapping_type.rb b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_type.rb new file mode 100644 index 000000000000..9cbbebd298bf --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_persona_mapping_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 identifier for an AWS WIF persona mapping. + class AwsWifPersonaMappingType + include BaseEnumModel + + AWS_WIF_CONFIG = "aws_wif_config".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/aws_wif_persona_mappings_response.rb b/lib/datadog_api_client/v2/models/aws_wif_persona_mappings_response.rb new file mode 100644 index 000000000000..473ee3319ccf --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_wif_persona_mappings_response.rb @@ -0,0 +1,125 @@ +=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 containing a list of AWS WIF persona mappings. + class AwsWifPersonaMappingsResponse + include BaseGenericModel + + # + 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' => :'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::AwsWifPersonaMappingsResponse` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = 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 @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/delegated_token_attributes.rb b/lib/datadog_api_client/v2/models/delegated_token_attributes.rb new file mode 100644 index 000000000000..a245e17114eb --- /dev/null +++ b/lib/datadog_api_client/v2/models/delegated_token_attributes.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 + # Attributes of a delegated token. + class DelegatedTokenAttributes + include BaseGenericModel + + # A short-lived JWT representing the authenticated Datadog user. Pass this as a bearer token in subsequent API calls. + attr_reader :access_token + + # The expiry time of the token. + attr_reader :expires + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_token' => :'access_token', + :'expires' => :'expires' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_token' => :'String', + :'expires' => :'Time' + } + 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::DelegatedTokenAttributes` 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?(:'access_token') + self.access_token = attributes[:'access_token'] + end + + if attributes.key?(:'expires') + self.expires = attributes[:'expires'] + 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 @access_token.nil? + return false if @expires.nil? + true + end + + # Custom attribute writer method with validation + # @param access_token [Object] Object to be assigned + # @!visibility private + def access_token=(access_token) + if access_token.nil? + fail ArgumentError, 'invalid value for "access_token", access_token cannot be nil.' + end + @access_token = access_token + end + + # Custom attribute writer method with validation + # @param expires [Object] Object to be assigned + # @!visibility private + def expires=(expires) + if expires.nil? + fail ArgumentError, 'invalid value for "expires", expires cannot be nil.' + end + @expires = expires + 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 && + access_token == o.access_token && + expires == o.expires && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_token, expires, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/delegated_token_data.rb b/lib/datadog_api_client/v2/models/delegated_token_data.rb new file mode 100644 index 000000000000..51370bbde4ad --- /dev/null +++ b/lib/datadog_api_client/v2/models/delegated_token_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 + # A delegated token resource. + class DelegatedTokenData + include BaseGenericModel + + # Attributes of a delegated token. + attr_reader :attributes + + # A random UUID assigned to this token issuance. + attr_reader :id + + # The resource type for a delegated token. + 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' => :'DelegatedTokenAttributes', + :'id' => :'UUID', + :'type' => :'DelegatedTokenType' + } + 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::DelegatedTokenData` 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/delegated_token_response.rb b/lib/datadog_api_client/v2/models/delegated_token_response.rb new file mode 100644 index 000000000000..fbc751515f9f --- /dev/null +++ b/lib/datadog_api_client/v2/models/delegated_token_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 containing a delegated user token. + class DelegatedTokenResponse + include BaseGenericModel + + # A delegated token resource. + 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' => :'DelegatedTokenData' + } + 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::DelegatedTokenResponse` 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/delegated_token_type.rb b/lib/datadog_api_client/v2/models/delegated_token_type.rb new file mode 100644 index 000000000000..c97cbfc192c9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/delegated_token_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 + # The resource type for a delegated token. + class DelegatedTokenType + include BaseEnumModel + + TOKEN = "token".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/intake_api_key_attributes.rb b/lib/datadog_api_client/v2/models/intake_api_key_attributes.rb new file mode 100644 index 000000000000..28f977f85cb8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/intake_api_key_attributes.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 + # Attributes of an intake API key returned after successful authentication. + class IntakeAPIKeyAttributes + include BaseGenericModel + + # The Datadog API key the workload can use to send telemetry. + attr_reader :api_key + + # The numeric ID of the Datadog organization the API key belongs to. + attr_reader :org_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'api_key' => :'api_key', + :'org_id' => :'org_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'api_key' => :'String', + :'org_id' => :'Integer' + } + 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::IntakeAPIKeyAttributes` 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?(:'api_key') + self.api_key = attributes[:'api_key'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + 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 @api_key.nil? + return false if @org_id.nil? + true + end + + # Custom attribute writer method with validation + # @param api_key [Object] Object to be assigned + # @!visibility private + def api_key=(api_key) + if api_key.nil? + fail ArgumentError, 'invalid value for "api_key", api_key cannot be nil.' + end + @api_key = api_key + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + 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 && + api_key == o.api_key && + org_id == o.org_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [api_key, org_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/intake_api_key_data.rb b/lib/datadog_api_client/v2/models/intake_api_key_data.rb new file mode 100644 index 000000000000..9e079bfd78c9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/intake_api_key_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 + # An intake API key resource. + class IntakeAPIKeyData + include BaseGenericModel + + # Attributes of an intake API key returned after successful authentication. + attr_reader :attributes + + # A stable identifier for the intake key, scoped to the matched organization. + attr_reader :id + + # The resource type for an intake API key. + 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' => :'IntakeAPIKeyAttributes', + :'id' => :'String', + :'type' => :'IntakeAPIKeyType' + } + 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::IntakeAPIKeyData` 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/intake_api_key_response.rb b/lib/datadog_api_client/v2/models/intake_api_key_response.rb new file mode 100644 index 000000000000..3b5d0b7a0153 --- /dev/null +++ b/lib/datadog_api_client/v2/models/intake_api_key_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 containing an intake API key for the authenticated cloud workload. + class IntakeAPIKeyResponse + include BaseGenericModel + + # An intake API key resource. + 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' => :'IntakeAPIKeyData' + } + 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::IntakeAPIKeyResponse` 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/intake_api_key_type.rb b/lib/datadog_api_client/v2/models/intake_api_key_type.rb new file mode 100644 index 000000000000..6d09a1750b98 --- /dev/null +++ b/lib/datadog_api_client/v2/models/intake_api_key_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 + # The resource type for an intake API key. + class IntakeAPIKeyType + include BaseEnumModel + + INTAKE_API_KEY = "intake_api_key".freeze + end +end