From 1bdc74a7523569ba4c6b683beaa1198238b1809f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 8 Oct 2026 11:39:24 +0000 Subject: [PATCH] Regenerate client from commit 8891cae of spec repo --- .generator/schemas/v2/openapi.yaml | 669 +++++++- .../CreateGitHubCloudAuthIntakeMapping.java | 64 + .../CreateGitHubCloudAuthPersonaMapping.java | 65 + .../DeleteGitHubCloudAuthIntakeMapping.java | 25 + .../DeleteGitHubCloudAuthPersonaMapping.java | 25 + .../GetGitHubCloudAuthIntakeMapping.java | 28 + .../GetGitHubCloudAuthPersonaMapping.java | 28 + .../ListGitHubCloudAuthIntakeMappings.java | 28 + .../ListGitHubCloudAuthPersonaMappings.java | 28 + .../com/datadog/api/client/ApiClient.java | 8 + .../client/v2/api/CloudAuthenticationApi.java | 1484 +++++++++++++++-- ...udAuthIntakeMappingAttributesResponse.java | 100 ++ ...loudAuthIntakeMappingCreateAttributes.java | 100 ++ ...itHubCloudAuthIntakeMappingCreateData.java | 133 ++ ...ubCloudAuthIntakeMappingCreateRequest.java | 97 ++ ...HubCloudAuthIntakeMappingDataResponse.java | 217 +++ .../GitHubCloudAuthIntakeMappingResponse.java | 151 ++ .../GitHubCloudAuthIntakeMappingType.java | 58 + ...GitHubCloudAuthIntakeMappingsResponse.java | 167 ++ ...dAuthPersonaMappingAttributesResponse.java | 164 ++ ...oudAuthPersonaMappingCreateAttributes.java | 132 ++ ...tHubCloudAuthPersonaMappingCreateData.java | 133 ++ ...bCloudAuthPersonaMappingCreateRequest.java | 97 ++ ...ubCloudAuthPersonaMappingDataResponse.java | 217 +++ ...GitHubCloudAuthPersonaMappingResponse.java | 152 ++ .../GitHubCloudAuthPersonaMappingType.java | 58 + ...itHubCloudAuthPersonaMappingsResponse.java | 167 ++ .../v2/model/GitHubOIDCClaimPatterns.java | 578 +++++++ .../v2/api/cloud_authentication.feature | 144 +- .../com/datadog/api/client/v2/api/undo.json | 62 + 30 files changed, 5259 insertions(+), 120 deletions(-) create mode 100644 examples/v2/cloud-authentication/CreateGitHubCloudAuthIntakeMapping.java create mode 100644 examples/v2/cloud-authentication/CreateGitHubCloudAuthPersonaMapping.java create mode 100644 examples/v2/cloud-authentication/DeleteGitHubCloudAuthIntakeMapping.java create mode 100644 examples/v2/cloud-authentication/DeleteGitHubCloudAuthPersonaMapping.java create mode 100644 examples/v2/cloud-authentication/GetGitHubCloudAuthIntakeMapping.java create mode 100644 examples/v2/cloud-authentication/GetGitHubCloudAuthPersonaMapping.java create mode 100644 examples/v2/cloud-authentication/ListGitHubCloudAuthIntakeMappings.java create mode 100644 examples/v2/cloud-authentication/ListGitHubCloudAuthPersonaMappings.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingAttributesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingDataResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingAttributesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingDataResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GitHubOIDCClaimPatterns.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 531154bda8c..a6bb119649c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -949,6 +949,14 @@ components: required: true schema: type: string + IntakeMappingID: + description: The ID of the intake mapping + example: d6d869d7-29d3-5595-bf40-57c95235cf5b + in: path + name: intake_mapping_id + required: true + schema: + type: string IntegrationAccountIdParameter: description: Unique identifier of the integration account. in: path @@ -54749,6 +54757,294 @@ components: example: 66adc9350f2cc9b250b69abddab733dd55e1a588 pattern: "^[a-fA-F0-9]{40,}$" type: string + GitHubCloudAuthIntakeMappingAttributesResponse: + additionalProperties: false + description: Attributes for GitHub cloud authentication intake mapping response. + properties: + claim_matchers: + $ref: "#/components/schemas/GitHubOIDCClaimPatterns" + required: + - claim_matchers + type: object + GitHubCloudAuthIntakeMappingCreateAttributes: + additionalProperties: false + description: Attributes for creating a GitHub cloud authentication intake mapping + properties: + claim_matchers: + $ref: "#/components/schemas/GitHubOIDCClaimPatterns" + required: + - claim_matchers + type: object + GitHubCloudAuthIntakeMappingCreateData: + additionalProperties: false + description: Data for creating a GitHub cloud authentication intake mapping. + properties: + attributes: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingCreateAttributes" + type: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingType" + required: + - type + - attributes + type: object + GitHubCloudAuthIntakeMappingCreateRequest: + additionalProperties: false + description: Request used to create a GitHub cloud authentication intake mapping. + properties: + data: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingCreateData" + required: + - data + type: object + GitHubCloudAuthIntakeMappingDataResponse: + description: Data for GitHub cloud authentication intake mapping response. + properties: + attributes: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingAttributesResponse" + id: + description: Unique identifier for the intake mapping. + example: "d6d869d7-29d3-5595-bf40-57c95235cf5b" + type: string + type: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingType" + required: + - id + - type + - attributes + type: object + GitHubCloudAuthIntakeMappingResponse: + description: Response containing a single GitHub cloud authentication intake mapping. + properties: + data: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingDataResponse" + required: + - data + type: object + GitHubCloudAuthIntakeMappingType: + description: Type identifier for GitHub cloud authentication intake mapping. + enum: + - github_oidc_auth_intake_mapping + example: github_oidc_auth_intake_mapping + type: string + x-enum-varnames: + - GITHUB_OIDC_AUTH_INTAKE_MAPPING + GitHubCloudAuthIntakeMappingsData: + description: List of GitHub cloud authentication intake mappings. + items: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingDataResponse" + type: array + GitHubCloudAuthIntakeMappingsResponse: + description: Response containing a list of GitHub cloud authentication intake mappings. + properties: + data: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingsData" + example: + - attributes: + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + id: "d6d869d7-29d3-5595-bf40-57c95235cf5b" + type: github_oidc_auth_intake_mapping + required: + - data + type: object + GitHubCloudAuthPersonaMappingAttributesResponse: + additionalProperties: false + description: Attributes for GitHub cloud authentication persona mapping response. + properties: + account_identifier: + description: Datadog account identifier (email or handle) mapped to the GitHub principal. + example: "test@example.com" + type: string + account_uuid: + description: Datadog account UUID. + example: "12bbdc5c-5966-47e0-8733-285f9e44bcf4" + type: string + claim_matchers: + $ref: "#/components/schemas/GitHubOIDCClaimPatterns" + required: + - claim_matchers + - account_identifier + - account_uuid + type: object + GitHubCloudAuthPersonaMappingCreateAttributes: + additionalProperties: false + description: Attributes for creating a GitHub cloud authentication persona mapping. + properties: + account_identifier: + description: Datadog account identifier (email or handle) mapped to the GitHub principal. + example: "test@example.com" + type: string + claim_matchers: + $ref: "#/components/schemas/GitHubOIDCClaimPatterns" + required: + - claim_matchers + - account_identifier + type: object + GitHubCloudAuthPersonaMappingCreateData: + additionalProperties: false + description: Data for creating a GitHub cloud authentication persona mapping. + properties: + attributes: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingCreateAttributes" + type: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingType" + required: + - type + - attributes + type: object + GitHubCloudAuthPersonaMappingCreateRequest: + additionalProperties: false + description: Request used to create a GitHub cloud authentication persona mapping. + properties: + data: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingCreateData" + required: + - data + type: object + GitHubCloudAuthPersonaMappingDataResponse: + description: Data for GitHub cloud authentication persona mapping response. + properties: + attributes: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingAttributesResponse" + id: + description: Unique identifier for the persona mapping. + example: "c5c758c6-18c2-4484-ae3f-46b84128404a" + type: string + type: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingType" + required: + - id + - type + - attributes + type: object + GitHubCloudAuthPersonaMappingResponse: + description: Response containing a single GitHub cloud authentication persona mapping. + properties: + data: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingDataResponse" + required: + - data + type: object + GitHubCloudAuthPersonaMappingType: + description: Type identifier for GitHub cloud authentication persona mapping. + enum: + - github_oidc_auth_config + example: github_oidc_auth_config + type: string + x-enum-varnames: + - GITHUB_OIDC_AUTH_CONFIG + GitHubCloudAuthPersonaMappingsData: + description: List of GitHub cloud authentication persona mappings. + items: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingDataResponse" + type: array + GitHubCloudAuthPersonaMappingsResponse: + description: Response containing a list of GitHub cloud authentication persona mappings. + properties: + data: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingsData" + example: + - attributes: + account_identifier: "test@example.com" + account_uuid: "12bbdc5c-5966-47e0-8733-285f9e44bcf4" + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + id: "c5c758c6-18c2-4484-ae3f-46b84128404a" + type: github_oidc_auth_config + required: + - data + type: object + GitHubOIDCClaimPatterns: + additionalProperties: false + description: |- + GitHub Actions OIDC claims to match against. Each field is a regular expression. + The `sub` claim is required; all other claims are optional. A token matches only when + all provided patterns match simultaneously (AND semantics). + properties: + actor: + description: Regular expression matched against the `actor` claim. + example: "octocat" + type: string + actor_id: + description: Regular expression matched against the `actor_id` claim. + example: "1234567" + type: string + enterprise: + description: Regular expression matched against the `enterprise` claim. + example: "test_enterprise" + type: string + enterprise_id: + description: Regular expression matched against the `enterprise_id` claim. + example: "42" + type: string + environment: + description: Regular expression matched against the `environment` claim. + example: "production" + type: string + event_name: + description: Regular expression matched against the `event_name` claim. + example: "push" + type: string + job_workflow_ref: + description: Regular expression matched against the `job_workflow_ref` claim. + example: "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main" + type: string + ref: + description: Regular expression matched against the `ref` claim. + example: "refs/heads/main" + type: string + ref_type: + description: Regular expression matched against the `ref_type` claim. + example: "branch" + type: string + repository: + description: Regular expression matched against the `repository` claim. + example: "test_owner/test_repo" + type: string + repository_id: + description: Regular expression matched against the `repository_id` claim. + example: "123456789" + type: string + repository_owner: + description: Regular expression matched against the `repository_owner` claim. + example: "test_owner" + type: string + repository_owner_id: + description: Regular expression matched against the `repository_owner_id` claim. + example: "987654321" + type: string + repository_visibility: + description: Regular expression matched against the `repository_visibility` claim. + example: "public" + type: string + runner_environment: + description: Regular expression matched against the `runner_environment` claim. + example: "github-hosted" + type: string + sub: + description: |- + Regular expression matched against the entire `sub` (subject) claim, the primary GitHub Actions OIDC + identifier (for example, `repo:/:ref:refs/heads/main`). The pattern must begin with + `repo:/`, where `` is a literal repository-owner name rather than a regular expression. + example: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + type: string + workflow: + description: Regular expression matched against the `workflow` claim. + example: "CI" + type: string + workflow_ref: + description: Regular expression matched against the `workflow_ref` claim. + example: "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main" + type: string + required: + - sub + type: object GitRepositoryID: description: "Git Repository ID" example: "github.com/organization/example-repository" @@ -151400,6 +151696,377 @@ paths: 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/github/intake_mapping: + get: + description: List all GitHub cloud authentication intake mappings. This endpoint retrieves all configured intake mappings that entitle matching GitHub Actions OIDC principals to request Datadog API keys. + operationId: ListGitHubCloudAuthIntakeMappings + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + id: d6d869d7-29d3-5595-bf40-57c95235cf5b + type: github_oidc_auth_intake_mapping + schema: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingsResponse" + 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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List GitHub cloud authentication intake mappings + tags: + - Cloud Authentication + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a GitHub cloud authentication intake mapping. This endpoint entitles a matching GitHub Actions OIDC principal to request Datadog API keys. + operationId: CreateGitHubCloudAuthIntakeMapping + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + type: github_oidc_auth_intake_mapping + schema: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + id: d6d869d7-29d3-5595-bf40-57c95235cf5b + type: github_oidc_auth_intake_mapping + schema: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingResponse" + 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" + summary: Create a GitHub cloud auth intake mapping + tags: + - Cloud Authentication + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cloud_auth/github/intake_mapping/{intake_mapping_id}: + delete: + description: Delete a GitHub cloud authentication intake mapping by ID. This removes a GitHub Actions OIDC principal's entitlement to request Datadog API keys. + operationId: DeleteGitHubCloudAuthIntakeMapping + parameters: + - $ref: "#/components/parameters/IntakeMappingID" + responses: + "204": + description: No Content + "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" + summary: Delete a GitHub cloud auth intake mapping + tags: + - Cloud Authentication + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a specific GitHub cloud authentication intake mapping by ID. This endpoint retrieves a single configured intake mapping that entitles a matching GitHub Actions OIDC principal to request Datadog API keys. + operationId: GetGitHubCloudAuthIntakeMapping + parameters: + - $ref: "#/components/parameters/IntakeMappingID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + id: d6d869d7-29d3-5595-bf40-57c95235cf5b + type: github_oidc_auth_intake_mapping + schema: + $ref: "#/components/schemas/GitHubCloudAuthIntakeMappingResponse" + description: OK + "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" + summary: Get a GitHub cloud authentication intake mapping + tags: + - Cloud Authentication + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cloud_auth/github/persona_mapping: + get: + description: List all GitHub cloud authentication persona mappings. This endpoint retrieves all configured persona mappings that associate GitHub Actions OpenID Connect (OIDC) principals with Datadog users. Mapped principals can request impersonation tokens. + operationId: ListGitHubCloudAuthPersonaMappings + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + account_identifier: "test@example.com" + account_uuid: "12bbdc5c-5966-47e0-8733-285f9e44bcf4" + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + id: c5c758c6-18c2-4484-ae3f-46b84128404a + type: github_oidc_auth_config + schema: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingsResponse" + 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 + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List GitHub cloud authentication persona mappings + tags: + - Cloud Authentication + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a GitHub cloud authentication persona mapping. This endpoint associates a GitHub Actions OIDC principal with a Datadog user. The mapped principal can request an impersonation token. + operationId: CreateGitHubCloudAuthPersonaMapping + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + account_identifier: "test@example.com" + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + type: github_oidc_auth_config + schema: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + account_identifier: "test@example.com" + account_uuid: "12bbdc5c-5966-47e0-8733-285f9e44bcf4" + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + id: c5c758c6-18c2-4484-ae3f-46b84128404a + type: github_oidc_auth_config + schema: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingResponse" + 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" + summary: Create a GitHub cloud auth persona mapping + tags: + - Cloud Authentication + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cloud_auth/github/persona_mapping/{persona_mapping_id}: + delete: + description: Delete a GitHub cloud authentication persona mapping by ID. This removes the association between a GitHub Actions OIDC principal and a Datadog user. + operationId: DeleteGitHubCloudAuthPersonaMapping + parameters: + - $ref: "#/components/parameters/PersonaMappingID" + responses: + "204": + description: No Content + "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" + summary: Delete a GitHub cloud auth persona mapping + tags: + - Cloud Authentication + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a specific GitHub cloud authentication persona mapping by ID. This endpoint retrieves a single configured persona mapping that associates a GitHub Actions OIDC principal with a Datadog user. The mapped principal can request an impersonation token. + operationId: GetGitHubCloudAuthPersonaMapping + parameters: + - $ref: "#/components/parameters/PersonaMappingID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + account_identifier: "test@example.com" + account_uuid: "12bbdc5c-5966-47e0-8733-285f9e44bcf4" + claim_matchers: + ref: "refs/heads/main" + repository: "test_owner/test_repo" + repository_owner: "test_owner" + sub: "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)" + id: c5c758c6-18c2-4484-ae3f-46b84128404a + type: github_oidc_auth_config + schema: + $ref: "#/components/schemas/GitHubCloudAuthPersonaMappingResponse" + description: OK + "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" + summary: Get a GitHub cloud authentication persona mapping + tags: + - Cloud Authentication + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cloud_security_management/custom_frameworks: post: description: Create a custom framework. @@ -245149,7 +245816,7 @@ tags: View and manage change requests within Change Management. See the [Case Management page](https://docs.datadoghq.com/service_management/case_management/) for more information. name: Change Management - description: |- - Configure AWS cloud authentication mappings for persona and intake authentication through the Datadog API. + Configure AWS and GitHub cloud authentication mappings for persona and intake authentication through the Datadog API. name: Cloud Authentication - description: |- The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products) and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/). diff --git a/examples/v2/cloud-authentication/CreateGitHubCloudAuthIntakeMapping.java b/examples/v2/cloud-authentication/CreateGitHubCloudAuthIntakeMapping.java new file mode 100644 index 00000000000..d62051039a5 --- /dev/null +++ b/examples/v2/cloud-authentication/CreateGitHubCloudAuthIntakeMapping.java @@ -0,0 +1,64 @@ +// Create a GitHub cloud auth intake mapping returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudAuthenticationApi; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingCreateAttributes; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingCreateData; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingCreateRequest; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingResponse; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingType; +import com.datadog.api.client.v2.model.GitHubOIDCClaimPatterns; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.createGitHubCloudAuthIntakeMapping", true); + CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient); + + GitHubCloudAuthIntakeMappingCreateRequest body = + new GitHubCloudAuthIntakeMappingCreateRequest() + .data( + new GitHubCloudAuthIntakeMappingCreateData() + .attributes( + new GitHubCloudAuthIntakeMappingCreateAttributes() + .claimMatchers( + new GitHubOIDCClaimPatterns() + .actor("octocat") + .actorId("1234567") + .enterprise("test_enterprise") + .enterpriseId("42") + .environment("production") + .eventName("push") + .jobWorkflowRef( + "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main") + .ref("refs/heads/main") + .refType("branch") + .repository("test_owner/test_repo") + .repositoryId("123456789") + .repositoryOwner("test_owner") + .repositoryOwnerId("987654321") + .repositoryVisibility("public") + .runnerEnvironment("github-hosted") + .sub( + "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)") + .workflow("CI") + .workflowRef( + "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"))) + .type(GitHubCloudAuthIntakeMappingType.GITHUB_OIDC_AUTH_INTAKE_MAPPING)); + + try { + GitHubCloudAuthIntakeMappingResponse result = + apiInstance.createGitHubCloudAuthIntakeMapping(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudAuthenticationApi#createGitHubCloudAuthIntakeMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-authentication/CreateGitHubCloudAuthPersonaMapping.java b/examples/v2/cloud-authentication/CreateGitHubCloudAuthPersonaMapping.java new file mode 100644 index 00000000000..c236d707a16 --- /dev/null +++ b/examples/v2/cloud-authentication/CreateGitHubCloudAuthPersonaMapping.java @@ -0,0 +1,65 @@ +// Create a GitHub cloud auth persona mapping returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudAuthenticationApi; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingCreateAttributes; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingCreateData; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingCreateRequest; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingResponse; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingType; +import com.datadog.api.client.v2.model.GitHubOIDCClaimPatterns; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.createGitHubCloudAuthPersonaMapping", true); + CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient); + + GitHubCloudAuthPersonaMappingCreateRequest body = + new GitHubCloudAuthPersonaMappingCreateRequest() + .data( + new GitHubCloudAuthPersonaMappingCreateData() + .attributes( + new GitHubCloudAuthPersonaMappingCreateAttributes() + .accountIdentifier("test@example.com") + .claimMatchers( + new GitHubOIDCClaimPatterns() + .actor("octocat") + .actorId("1234567") + .enterprise("test_enterprise") + .enterpriseId("42") + .environment("production") + .eventName("push") + .jobWorkflowRef( + "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main") + .ref("refs/heads/main") + .refType("branch") + .repository("test_owner/test_repo") + .repositoryId("123456789") + .repositoryOwner("test_owner") + .repositoryOwnerId("987654321") + .repositoryVisibility("public") + .runnerEnvironment("github-hosted") + .sub( + "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)") + .workflow("CI") + .workflowRef( + "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"))) + .type(GitHubCloudAuthPersonaMappingType.GITHUB_OIDC_AUTH_CONFIG)); + + try { + GitHubCloudAuthPersonaMappingResponse result = + apiInstance.createGitHubCloudAuthPersonaMapping(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudAuthenticationApi#createGitHubCloudAuthPersonaMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-authentication/DeleteGitHubCloudAuthIntakeMapping.java b/examples/v2/cloud-authentication/DeleteGitHubCloudAuthIntakeMapping.java new file mode 100644 index 00000000000..d0b1c299241 --- /dev/null +++ b/examples/v2/cloud-authentication/DeleteGitHubCloudAuthIntakeMapping.java @@ -0,0 +1,25 @@ +// Delete a GitHub cloud auth intake mapping returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudAuthenticationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.deleteGitHubCloudAuthIntakeMapping", true); + CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient); + + try { + apiInstance.deleteGitHubCloudAuthIntakeMapping("d6d869d7-29d3-5595-bf40-57c95235cf5b"); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudAuthenticationApi#deleteGitHubCloudAuthIntakeMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-authentication/DeleteGitHubCloudAuthPersonaMapping.java b/examples/v2/cloud-authentication/DeleteGitHubCloudAuthPersonaMapping.java new file mode 100644 index 00000000000..fa58bfc36f4 --- /dev/null +++ b/examples/v2/cloud-authentication/DeleteGitHubCloudAuthPersonaMapping.java @@ -0,0 +1,25 @@ +// Delete a GitHub cloud auth persona mapping returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudAuthenticationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.deleteGitHubCloudAuthPersonaMapping", true); + CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient); + + try { + apiInstance.deleteGitHubCloudAuthPersonaMapping("c5c758c6-18c2-4484-ae3f-46b84128404a"); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudAuthenticationApi#deleteGitHubCloudAuthPersonaMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-authentication/GetGitHubCloudAuthIntakeMapping.java b/examples/v2/cloud-authentication/GetGitHubCloudAuthIntakeMapping.java new file mode 100644 index 00000000000..ed69e870380 --- /dev/null +++ b/examples/v2/cloud-authentication/GetGitHubCloudAuthIntakeMapping.java @@ -0,0 +1,28 @@ +// Get a GitHub cloud authentication intake mapping returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudAuthenticationApi; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.getGitHubCloudAuthIntakeMapping", true); + CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient); + + try { + GitHubCloudAuthIntakeMappingResponse result = + apiInstance.getGitHubCloudAuthIntakeMapping("d6d869d7-29d3-5595-bf40-57c95235cf5b"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudAuthenticationApi#getGitHubCloudAuthIntakeMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-authentication/GetGitHubCloudAuthPersonaMapping.java b/examples/v2/cloud-authentication/GetGitHubCloudAuthPersonaMapping.java new file mode 100644 index 00000000000..cadf86feb21 --- /dev/null +++ b/examples/v2/cloud-authentication/GetGitHubCloudAuthPersonaMapping.java @@ -0,0 +1,28 @@ +// Get a GitHub cloud authentication persona mapping returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudAuthenticationApi; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.getGitHubCloudAuthPersonaMapping", true); + CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient); + + try { + GitHubCloudAuthPersonaMappingResponse result = + apiInstance.getGitHubCloudAuthPersonaMapping("c5c758c6-18c2-4484-ae3f-46b84128404a"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudAuthenticationApi#getGitHubCloudAuthPersonaMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-authentication/ListGitHubCloudAuthIntakeMappings.java b/examples/v2/cloud-authentication/ListGitHubCloudAuthIntakeMappings.java new file mode 100644 index 00000000000..ab75ce6e1ea --- /dev/null +++ b/examples/v2/cloud-authentication/ListGitHubCloudAuthIntakeMappings.java @@ -0,0 +1,28 @@ +// List GitHub cloud authentication intake mappings returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudAuthenticationApi; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.listGitHubCloudAuthIntakeMappings", true); + CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient); + + try { + GitHubCloudAuthIntakeMappingsResponse result = + apiInstance.listGitHubCloudAuthIntakeMappings(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudAuthenticationApi#listGitHubCloudAuthIntakeMappings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-authentication/ListGitHubCloudAuthPersonaMappings.java b/examples/v2/cloud-authentication/ListGitHubCloudAuthPersonaMappings.java new file mode 100644 index 00000000000..1191345f1c0 --- /dev/null +++ b/examples/v2/cloud-authentication/ListGitHubCloudAuthPersonaMappings.java @@ -0,0 +1,28 @@ +// List GitHub cloud authentication persona mappings returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudAuthenticationApi; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.listGitHubCloudAuthPersonaMappings", true); + CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient); + + try { + GitHubCloudAuthPersonaMappingsResponse result = + apiInstance.listGitHubCloudAuthPersonaMappings(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudAuthenticationApi#listGitHubCloudAuthPersonaMappings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 7312de0558e..a00128a3616 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1084,9 +1084,17 @@ public class ApiClient { put("v2.updateChangeRequest", false); put("v2.updateChangeRequestDecision", false); put("v2.createAWSCloudAuthPersonaMapping", false); + put("v2.createGitHubCloudAuthIntakeMapping", false); + put("v2.createGitHubCloudAuthPersonaMapping", false); put("v2.deleteAWSCloudAuthPersonaMapping", false); + put("v2.deleteGitHubCloudAuthIntakeMapping", false); + put("v2.deleteGitHubCloudAuthPersonaMapping", false); put("v2.getAWSCloudAuthPersonaMapping", false); + put("v2.getGitHubCloudAuthIntakeMapping", false); + put("v2.getGitHubCloudAuthPersonaMapping", false); put("v2.listAWSCloudAuthPersonaMappings", false); + put("v2.listGitHubCloudAuthIntakeMappings", false); + put("v2.listGitHubCloudAuthPersonaMappings", false); put("v2.activateContentPack", false); put("v2.activateIntegration", false); put("v2.batchGetSecurityMonitoringDatasetDependencies", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/CloudAuthenticationApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudAuthenticationApi.java index b7d39d26ba3..7aef23ea526 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CloudAuthenticationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CloudAuthenticationApi.java @@ -7,6 +7,12 @@ import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingCreateRequest; import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingResponse; import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingsResponse; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingCreateRequest; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingResponse; +import com.datadog.api.client.v2.model.GitHubCloudAuthIntakeMappingsResponse; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingCreateRequest; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingResponse; +import com.datadog.api.client.v2.model.GitHubCloudAuthPersonaMappingsResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -205,6 +211,326 @@ public AWSCloudAuthPersonaMappingResponse createAWSCloudAuthPersonaMapping( new GenericType() {}); } + /** + * Create a GitHub cloud auth intake mapping. + * + *

See {@link #createGitHubCloudAuthIntakeMappingWithHttpInfo}. + * + * @param body (required) + * @return GitHubCloudAuthIntakeMappingResponse + * @throws ApiException if fails to make API call + */ + public GitHubCloudAuthIntakeMappingResponse createGitHubCloudAuthIntakeMapping( + GitHubCloudAuthIntakeMappingCreateRequest body) throws ApiException { + return createGitHubCloudAuthIntakeMappingWithHttpInfo(body).getData(); + } + + /** + * Create a GitHub cloud auth intake mapping. + * + *

See {@link #createGitHubCloudAuthIntakeMappingWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<GitHubCloudAuthIntakeMappingResponse> + */ + public CompletableFuture + createGitHubCloudAuthIntakeMappingAsync(GitHubCloudAuthIntakeMappingCreateRequest body) { + return createGitHubCloudAuthIntakeMappingWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a GitHub cloud authentication intake mapping. This endpoint entitles a matching GitHub + * Actions OIDC principal to request Datadog API keys. + * + * @param body (required) + * @return ApiResponse<GitHubCloudAuthIntakeMappingResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse + createGitHubCloudAuthIntakeMappingWithHttpInfo(GitHubCloudAuthIntakeMappingCreateRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createGitHubCloudAuthIntakeMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling createGitHubCloudAuthIntakeMapping"); + } + // create path and map variables + String localVarPath = "/api/v2/cloud_auth/github/intake_mapping"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.createGitHubCloudAuthIntakeMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a GitHub cloud auth intake mapping. + * + *

See {@link #createGitHubCloudAuthIntakeMappingWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<GitHubCloudAuthIntakeMappingResponse>> + */ + public CompletableFuture> + createGitHubCloudAuthIntakeMappingWithHttpInfoAsync( + GitHubCloudAuthIntakeMappingCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createGitHubCloudAuthIntakeMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " createGitHubCloudAuthIntakeMapping")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cloud_auth/github/intake_mapping"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.createGitHubCloudAuthIntakeMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a GitHub cloud auth persona mapping. + * + *

See {@link #createGitHubCloudAuthPersonaMappingWithHttpInfo}. + * + * @param body (required) + * @return GitHubCloudAuthPersonaMappingResponse + * @throws ApiException if fails to make API call + */ + public GitHubCloudAuthPersonaMappingResponse createGitHubCloudAuthPersonaMapping( + GitHubCloudAuthPersonaMappingCreateRequest body) throws ApiException { + return createGitHubCloudAuthPersonaMappingWithHttpInfo(body).getData(); + } + + /** + * Create a GitHub cloud auth persona mapping. + * + *

See {@link #createGitHubCloudAuthPersonaMappingWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<GitHubCloudAuthPersonaMappingResponse> + */ + public CompletableFuture + createGitHubCloudAuthPersonaMappingAsync(GitHubCloudAuthPersonaMappingCreateRequest body) { + return createGitHubCloudAuthPersonaMappingWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a GitHub cloud authentication persona mapping. This endpoint associates a GitHub Actions + * OIDC principal with a Datadog user. The mapped principal can request an impersonation token. + * + * @param body (required) + * @return ApiResponse<GitHubCloudAuthPersonaMappingResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse + createGitHubCloudAuthPersonaMappingWithHttpInfo( + GitHubCloudAuthPersonaMappingCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createGitHubCloudAuthPersonaMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling createGitHubCloudAuthPersonaMapping"); + } + // create path and map variables + String localVarPath = "/api/v2/cloud_auth/github/persona_mapping"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.createGitHubCloudAuthPersonaMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a GitHub cloud auth persona mapping. + * + *

See {@link #createGitHubCloudAuthPersonaMappingWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<GitHubCloudAuthPersonaMappingResponse>> + */ + public CompletableFuture> + createGitHubCloudAuthPersonaMappingWithHttpInfoAsync( + GitHubCloudAuthPersonaMappingCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createGitHubCloudAuthPersonaMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " createGitHubCloudAuthPersonaMapping")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/cloud_auth/github/persona_mapping"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.createGitHubCloudAuthPersonaMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Delete an AWS cloud authentication persona mapping. * @@ -238,22 +564,839 @@ public CompletableFuture deleteAWSCloudAuthPersonaMappingAsync(String pers * an AWS IAM principal and a Datadog user. * * @param personaMappingId The ID of the persona mapping (required) - * @return ApiResponse<Void> + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteAWSCloudAuthPersonaMappingWithHttpInfo(String personaMappingId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteAWSCloudAuthPersonaMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'personaMappingId' is set + if (personaMappingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'personaMappingId' when calling" + + " deleteAWSCloudAuthPersonaMapping"); + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}" + .replaceAll( + "\\{" + "persona_mapping_id" + "\\}", + apiClient.escapeString(personaMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.deleteAWSCloudAuthPersonaMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete an AWS cloud authentication persona mapping. + * + *

See {@link #deleteAWSCloudAuthPersonaMappingWithHttpInfo}. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteAWSCloudAuthPersonaMappingWithHttpInfoAsync( + String personaMappingId) { + // Check if unstable operation is enabled + String operationId = "deleteAWSCloudAuthPersonaMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'personaMappingId' is set + if (personaMappingId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'personaMappingId' when calling" + + " deleteAWSCloudAuthPersonaMapping")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}" + .replaceAll( + "\\{" + "persona_mapping_id" + "\\}", + apiClient.escapeString(personaMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.deleteAWSCloudAuthPersonaMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a GitHub cloud auth intake mapping. + * + *

See {@link #deleteGitHubCloudAuthIntakeMappingWithHttpInfo}. + * + * @param intakeMappingId The ID of the intake mapping (required) + * @throws ApiException if fails to make API call + */ + public void deleteGitHubCloudAuthIntakeMapping(String intakeMappingId) throws ApiException { + deleteGitHubCloudAuthIntakeMappingWithHttpInfo(intakeMappingId); + } + + /** + * Delete a GitHub cloud auth intake mapping. + * + *

See {@link #deleteGitHubCloudAuthIntakeMappingWithHttpInfoAsync}. + * + * @param intakeMappingId The ID of the intake mapping (required) + * @return CompletableFuture + */ + public CompletableFuture deleteGitHubCloudAuthIntakeMappingAsync(String intakeMappingId) { + return deleteGitHubCloudAuthIntakeMappingWithHttpInfoAsync(intakeMappingId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a GitHub cloud authentication intake mapping by ID. This removes a GitHub Actions OIDC + * principal's entitlement to request Datadog API keys. + * + * @param intakeMappingId The ID of the intake mapping (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteGitHubCloudAuthIntakeMappingWithHttpInfo(String intakeMappingId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteGitHubCloudAuthIntakeMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'intakeMappingId' is set + if (intakeMappingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'intakeMappingId' when calling" + + " deleteGitHubCloudAuthIntakeMapping"); + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/github/intake_mapping/{intake_mapping_id}" + .replaceAll( + "\\{" + "intake_mapping_id" + "\\}", + apiClient.escapeString(intakeMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.deleteGitHubCloudAuthIntakeMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a GitHub cloud auth intake mapping. + * + *

See {@link #deleteGitHubCloudAuthIntakeMappingWithHttpInfo}. + * + * @param intakeMappingId The ID of the intake mapping (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteGitHubCloudAuthIntakeMappingWithHttpInfoAsync( + String intakeMappingId) { + // Check if unstable operation is enabled + String operationId = "deleteGitHubCloudAuthIntakeMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'intakeMappingId' is set + if (intakeMappingId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'intakeMappingId' when calling" + + " deleteGitHubCloudAuthIntakeMapping")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/github/intake_mapping/{intake_mapping_id}" + .replaceAll( + "\\{" + "intake_mapping_id" + "\\}", + apiClient.escapeString(intakeMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.deleteGitHubCloudAuthIntakeMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a GitHub cloud auth persona mapping. + * + *

See {@link #deleteGitHubCloudAuthPersonaMappingWithHttpInfo}. + * + * @param personaMappingId The ID of the persona mapping (required) + * @throws ApiException if fails to make API call + */ + public void deleteGitHubCloudAuthPersonaMapping(String personaMappingId) throws ApiException { + deleteGitHubCloudAuthPersonaMappingWithHttpInfo(personaMappingId); + } + + /** + * Delete a GitHub cloud auth persona mapping. + * + *

See {@link #deleteGitHubCloudAuthPersonaMappingWithHttpInfoAsync}. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return CompletableFuture + */ + public CompletableFuture deleteGitHubCloudAuthPersonaMappingAsync(String personaMappingId) { + return deleteGitHubCloudAuthPersonaMappingWithHttpInfoAsync(personaMappingId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a GitHub cloud authentication persona mapping by ID. This removes the association + * between a GitHub Actions OIDC principal and a Datadog user. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteGitHubCloudAuthPersonaMappingWithHttpInfo(String personaMappingId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteGitHubCloudAuthPersonaMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'personaMappingId' is set + if (personaMappingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'personaMappingId' when calling" + + " deleteGitHubCloudAuthPersonaMapping"); + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/github/persona_mapping/{persona_mapping_id}" + .replaceAll( + "\\{" + "persona_mapping_id" + "\\}", + apiClient.escapeString(personaMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.deleteGitHubCloudAuthPersonaMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a GitHub cloud auth persona mapping. + * + *

See {@link #deleteGitHubCloudAuthPersonaMappingWithHttpInfo}. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteGitHubCloudAuthPersonaMappingWithHttpInfoAsync( + String personaMappingId) { + // Check if unstable operation is enabled + String operationId = "deleteGitHubCloudAuthPersonaMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'personaMappingId' is set + if (personaMappingId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'personaMappingId' when calling" + + " deleteGitHubCloudAuthPersonaMapping")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/github/persona_mapping/{persona_mapping_id}" + .replaceAll( + "\\{" + "persona_mapping_id" + "\\}", + apiClient.escapeString(personaMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.deleteGitHubCloudAuthPersonaMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get an AWS cloud authentication persona mapping. + * + *

See {@link #getAWSCloudAuthPersonaMappingWithHttpInfo}. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return AWSCloudAuthPersonaMappingResponse + * @throws ApiException if fails to make API call + */ + public AWSCloudAuthPersonaMappingResponse getAWSCloudAuthPersonaMapping(String personaMappingId) + throws ApiException { + return getAWSCloudAuthPersonaMappingWithHttpInfo(personaMappingId).getData(); + } + + /** + * Get an AWS cloud authentication persona mapping. + * + *

See {@link #getAWSCloudAuthPersonaMappingWithHttpInfoAsync}. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return CompletableFuture<AWSCloudAuthPersonaMappingResponse> + */ + public CompletableFuture getAWSCloudAuthPersonaMappingAsync( + String personaMappingId) { + return getAWSCloudAuthPersonaMappingWithHttpInfoAsync(personaMappingId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return ApiResponse<AWSCloudAuthPersonaMappingResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getAWSCloudAuthPersonaMappingWithHttpInfo( + String personaMappingId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getAWSCloudAuthPersonaMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'personaMappingId' is set + if (personaMappingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'personaMappingId' when calling" + + " getAWSCloudAuthPersonaMapping"); + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}" + .replaceAll( + "\\{" + "persona_mapping_id" + "\\}", + apiClient.escapeString(personaMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.getAWSCloudAuthPersonaMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an AWS cloud authentication persona mapping. + * + *

See {@link #getAWSCloudAuthPersonaMappingWithHttpInfo}. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return CompletableFuture<ApiResponse<AWSCloudAuthPersonaMappingResponse>> + */ + public CompletableFuture> + getAWSCloudAuthPersonaMappingWithHttpInfoAsync(String personaMappingId) { + // Check if unstable operation is enabled + String operationId = "getAWSCloudAuthPersonaMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'personaMappingId' is set + if (personaMappingId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'personaMappingId' when calling" + + " getAWSCloudAuthPersonaMapping")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}" + .replaceAll( + "\\{" + "persona_mapping_id" + "\\}", + apiClient.escapeString(personaMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.getAWSCloudAuthPersonaMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a GitHub cloud authentication intake mapping. + * + *

See {@link #getGitHubCloudAuthIntakeMappingWithHttpInfo}. + * + * @param intakeMappingId The ID of the intake mapping (required) + * @return GitHubCloudAuthIntakeMappingResponse + * @throws ApiException if fails to make API call + */ + public GitHubCloudAuthIntakeMappingResponse getGitHubCloudAuthIntakeMapping( + String intakeMappingId) throws ApiException { + return getGitHubCloudAuthIntakeMappingWithHttpInfo(intakeMappingId).getData(); + } + + /** + * Get a GitHub cloud authentication intake mapping. + * + *

See {@link #getGitHubCloudAuthIntakeMappingWithHttpInfoAsync}. + * + * @param intakeMappingId The ID of the intake mapping (required) + * @return CompletableFuture<GitHubCloudAuthIntakeMappingResponse> + */ + public CompletableFuture + getGitHubCloudAuthIntakeMappingAsync(String intakeMappingId) { + return getGitHubCloudAuthIntakeMappingWithHttpInfoAsync(intakeMappingId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific GitHub cloud authentication intake mapping by ID. This endpoint retrieves a + * single configured intake mapping that entitles a matching GitHub Actions OIDC principal to + * request Datadog API keys. + * + * @param intakeMappingId The ID of the intake mapping (required) + * @return ApiResponse<GitHubCloudAuthIntakeMappingResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse + getGitHubCloudAuthIntakeMappingWithHttpInfo(String intakeMappingId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getGitHubCloudAuthIntakeMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'intakeMappingId' is set + if (intakeMappingId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'intakeMappingId' when calling" + + " getGitHubCloudAuthIntakeMapping"); + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/github/intake_mapping/{intake_mapping_id}" + .replaceAll( + "\\{" + "intake_mapping_id" + "\\}", + apiClient.escapeString(intakeMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.getGitHubCloudAuthIntakeMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a GitHub cloud authentication intake mapping. + * + *

See {@link #getGitHubCloudAuthIntakeMappingWithHttpInfo}. + * + * @param intakeMappingId The ID of the intake mapping (required) + * @return CompletableFuture<ApiResponse<GitHubCloudAuthIntakeMappingResponse>> + */ + public CompletableFuture> + getGitHubCloudAuthIntakeMappingWithHttpInfoAsync(String intakeMappingId) { + // Check if unstable operation is enabled + String operationId = "getGitHubCloudAuthIntakeMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'intakeMappingId' is set + if (intakeMappingId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'intakeMappingId' when calling" + + " getGitHubCloudAuthIntakeMapping")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cloud_auth/github/intake_mapping/{intake_mapping_id}" + .replaceAll( + "\\{" + "intake_mapping_id" + "\\}", + apiClient.escapeString(intakeMappingId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.getGitHubCloudAuthIntakeMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a GitHub cloud authentication persona mapping. + * + *

See {@link #getGitHubCloudAuthPersonaMappingWithHttpInfo}. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return GitHubCloudAuthPersonaMappingResponse + * @throws ApiException if fails to make API call + */ + public GitHubCloudAuthPersonaMappingResponse getGitHubCloudAuthPersonaMapping( + String personaMappingId) throws ApiException { + return getGitHubCloudAuthPersonaMappingWithHttpInfo(personaMappingId).getData(); + } + + /** + * Get a GitHub cloud authentication persona mapping. + * + *

See {@link #getGitHubCloudAuthPersonaMappingWithHttpInfoAsync}. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return CompletableFuture<GitHubCloudAuthPersonaMappingResponse> + */ + public CompletableFuture + getGitHubCloudAuthPersonaMappingAsync(String personaMappingId) { + return getGitHubCloudAuthPersonaMappingWithHttpInfoAsync(personaMappingId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific GitHub cloud authentication persona mapping by ID. This endpoint retrieves a + * single configured persona mapping that associates a GitHub Actions OIDC principal with a + * Datadog user. The mapped principal can request an impersonation token. + * + * @param personaMappingId The ID of the persona mapping (required) + * @return ApiResponse<GitHubCloudAuthPersonaMappingResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * *
Response details
Status Code Description Response Headers
204 No Content -
200 OK -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteAWSCloudAuthPersonaMappingWithHttpInfo(String personaMappingId) - throws ApiException { + public ApiResponse + getGitHubCloudAuthPersonaMappingWithHttpInfo(String personaMappingId) throws ApiException { // Check if unstable operation is enabled - String operationId = "deleteAWSCloudAuthPersonaMapping"; + String operationId = "getGitHubCloudAuthPersonaMapping"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -266,11 +1409,11 @@ public ApiResponse deleteAWSCloudAuthPersonaMappingWithHttpInfo(String per throw new ApiException( 400, "Missing the required parameter 'personaMappingId' when calling" - + " deleteAWSCloudAuthPersonaMapping"); + + " getGitHubCloudAuthPersonaMapping"); } // create path and map variables String localVarPath = - "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}" + "/api/v2/cloud_auth/github/persona_mapping/{persona_mapping_id}" .replaceAll( "\\{" + "persona_mapping_id" + "\\}", apiClient.escapeString(personaMappingId.toString())); @@ -279,40 +1422,41 @@ public ApiResponse deleteAWSCloudAuthPersonaMappingWithHttpInfo(String per Invocation.Builder builder = apiClient.createBuilder( - "v2.CloudAuthenticationApi.deleteAWSCloudAuthPersonaMapping", + "v2.CloudAuthenticationApi.getGitHubCloudAuthPersonaMapping", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "GET", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Delete an AWS cloud authentication persona mapping. + * Get a GitHub cloud authentication persona mapping. * - *

See {@link #deleteAWSCloudAuthPersonaMappingWithHttpInfo}. + *

See {@link #getGitHubCloudAuthPersonaMappingWithHttpInfo}. * * @param personaMappingId The ID of the persona mapping (required) - * @return CompletableFuture<ApiResponse<Void>> + * @return CompletableFuture<ApiResponse<GitHubCloudAuthPersonaMappingResponse>> */ - public CompletableFuture> deleteAWSCloudAuthPersonaMappingWithHttpInfoAsync( - String personaMappingId) { + public CompletableFuture> + getGitHubCloudAuthPersonaMappingWithHttpInfoAsync(String personaMappingId) { // Check if unstable operation is enabled - String operationId = "deleteAWSCloudAuthPersonaMapping"; + String operationId = "getGitHubCloudAuthPersonaMapping"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; @@ -321,17 +1465,18 @@ public CompletableFuture> deleteAWSCloudAuthPersonaMappingWith // verify the required parameter 'personaMappingId' is set if (personaMappingId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'personaMappingId' when calling" - + " deleteAWSCloudAuthPersonaMapping")); + + " getGitHubCloudAuthPersonaMapping")); return result; } // create path and map variables String localVarPath = - "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}" + "/api/v2/cloud_auth/github/persona_mapping/{persona_mapping_id}" .replaceAll( "\\{" + "persona_mapping_id" + "\\}", apiClient.escapeString(personaMappingId.toString())); @@ -342,54 +1487,52 @@ public CompletableFuture> deleteAWSCloudAuthPersonaMappingWith try { builder = apiClient.createBuilder( - "v2.CloudAuthenticationApi.deleteAWSCloudAuthPersonaMapping", + "v2.CloudAuthenticationApi.getGitHubCloudAuthPersonaMapping", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "GET", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Get an AWS cloud authentication persona mapping. + * List AWS cloud authentication persona mappings. * - *

See {@link #getAWSCloudAuthPersonaMappingWithHttpInfo}. + *

See {@link #listAWSCloudAuthPersonaMappingsWithHttpInfo}. * - * @param personaMappingId The ID of the persona mapping (required) - * @return AWSCloudAuthPersonaMappingResponse + * @return AWSCloudAuthPersonaMappingsResponse * @throws ApiException if fails to make API call */ - public AWSCloudAuthPersonaMappingResponse getAWSCloudAuthPersonaMapping(String personaMappingId) - throws ApiException { - return getAWSCloudAuthPersonaMappingWithHttpInfo(personaMappingId).getData(); + public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() throws ApiException { + return listAWSCloudAuthPersonaMappingsWithHttpInfo().getData(); } /** - * Get an AWS cloud authentication persona mapping. + * List AWS cloud authentication persona mappings. * - *

See {@link #getAWSCloudAuthPersonaMappingWithHttpInfoAsync}. + *

See {@link #listAWSCloudAuthPersonaMappingsWithHttpInfoAsync}. * - * @param personaMappingId The ID of the persona mapping (required) - * @return CompletableFuture<AWSCloudAuthPersonaMappingResponse> + * @return CompletableFuture<AWSCloudAuthPersonaMappingsResponse> */ - public CompletableFuture getAWSCloudAuthPersonaMappingAsync( - String personaMappingId) { - return getAWSCloudAuthPersonaMappingWithHttpInfoAsync(personaMappingId) + public CompletableFuture + listAWSCloudAuthPersonaMappingsAsync() { + return listAWSCloudAuthPersonaMappingsWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -397,52 +1540,39 @@ public CompletableFuture getAWSCloudAuthPers } /** - * 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. + * List all AWS cloud authentication persona mappings. This endpoint retrieves all configured + * persona mappings that associate AWS IAM principals with Datadog users. * - * @param personaMappingId The ID of the persona mapping (required) - * @return ApiResponse<AWSCloudAuthPersonaMappingResponse> + * @return ApiResponse<AWSCloudAuthPersonaMappingsResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * * - * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getAWSCloudAuthPersonaMappingWithHttpInfo( - String personaMappingId) throws ApiException { + public ApiResponse + listAWSCloudAuthPersonaMappingsWithHttpInfo() throws ApiException { // Check if unstable operation is enabled - String operationId = "getAWSCloudAuthPersonaMapping"; + String operationId = "listAWSCloudAuthPersonaMappings"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } Object localVarPostBody = null; - - // verify the required parameter 'personaMappingId' is set - if (personaMappingId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'personaMappingId' when calling" - + " getAWSCloudAuthPersonaMapping"); - } // create path and map variables - String localVarPath = - "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}" - .replaceAll( - "\\{" + "persona_mapping_id" + "\\}", - apiClient.escapeString(personaMappingId.toString())); + String localVarPath = "/api/v2/cloud_auth/aws/persona_mapping"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CloudAuthenticationApi.getAWSCloudAuthPersonaMapping", + "v2.CloudAuthenticationApi.listAWSCloudAuthPersonaMappings", localVarPath, new ArrayList(), localVarHeaderParams, @@ -457,49 +1587,167 @@ public ApiResponse getAWSCloudAuthPersonaMap localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get an AWS cloud authentication persona mapping. + * List AWS cloud authentication persona mappings. * - *

See {@link #getAWSCloudAuthPersonaMappingWithHttpInfo}. + *

See {@link #listAWSCloudAuthPersonaMappingsWithHttpInfo}. * - * @param personaMappingId The ID of the persona mapping (required) - * @return CompletableFuture<ApiResponse<AWSCloudAuthPersonaMappingResponse>> + * @return CompletableFuture<ApiResponse<AWSCloudAuthPersonaMappingsResponse>> */ - public CompletableFuture> - getAWSCloudAuthPersonaMappingWithHttpInfoAsync(String personaMappingId) { + public CompletableFuture> + listAWSCloudAuthPersonaMappingsWithHttpInfoAsync() { // Check if unstable operation is enabled - String operationId = "getAWSCloudAuthPersonaMapping"; + String operationId = "listAWSCloudAuthPersonaMappings"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cloud_auth/aws/persona_mapping"; - // verify the required parameter 'personaMappingId' is set - if (personaMappingId == null) { - CompletableFuture> result = + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.listAWSCloudAuthPersonaMappings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List GitHub cloud authentication intake mappings. + * + *

See {@link #listGitHubCloudAuthIntakeMappingsWithHttpInfo}. + * + * @return GitHubCloudAuthIntakeMappingsResponse + * @throws ApiException if fails to make API call + */ + public GitHubCloudAuthIntakeMappingsResponse listGitHubCloudAuthIntakeMappings() + throws ApiException { + return listGitHubCloudAuthIntakeMappingsWithHttpInfo().getData(); + } + + /** + * List GitHub cloud authentication intake mappings. + * + *

See {@link #listGitHubCloudAuthIntakeMappingsWithHttpInfoAsync}. + * + * @return CompletableFuture<GitHubCloudAuthIntakeMappingsResponse> + */ + public CompletableFuture + listGitHubCloudAuthIntakeMappingsAsync() { + return listGitHubCloudAuthIntakeMappingsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all GitHub cloud authentication intake mappings. This endpoint retrieves all configured + * intake mappings that entitle matching GitHub Actions OIDC principals to request Datadog API + * keys. + * + * @return ApiResponse<GitHubCloudAuthIntakeMappingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse + listGitHubCloudAuthIntakeMappingsWithHttpInfo() throws ApiException { + // Check if unstable operation is enabled + String operationId = "listGitHubCloudAuthIntakeMappings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cloud_auth/github/intake_mapping"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudAuthenticationApi.listGitHubCloudAuthIntakeMappings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List GitHub cloud authentication intake mappings. + * + *

See {@link #listGitHubCloudAuthIntakeMappingsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<GitHubCloudAuthIntakeMappingsResponse>> + */ + public CompletableFuture> + listGitHubCloudAuthIntakeMappingsWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listGitHubCloudAuthIntakeMappings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'personaMappingId' when calling" - + " getAWSCloudAuthPersonaMapping")); + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } + Object localVarPostBody = null; // create path and map variables - String localVarPath = - "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}" - .replaceAll( - "\\{" + "persona_mapping_id" + "\\}", - apiClient.escapeString(personaMappingId.toString())); + String localVarPath = "/api/v2/cloud_auth/github/intake_mapping"; Map localVarHeaderParams = new HashMap(); @@ -507,7 +1755,7 @@ public ApiResponse getAWSCloudAuthPersonaMap try { builder = apiClient.createBuilder( - "v2.CloudAuthenticationApi.getAWSCloudAuthPersonaMapping", + "v2.CloudAuthenticationApi.listGitHubCloudAuthIntakeMappings", localVarPath, new ArrayList(), localVarHeaderParams, @@ -515,7 +1763,7 @@ public ApiResponse getAWSCloudAuthPersonaMap new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -528,31 +1776,32 @@ public ApiResponse getAWSCloudAuthPersonaMap localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List AWS cloud authentication persona mappings. + * List GitHub cloud authentication persona mappings. * - *

See {@link #listAWSCloudAuthPersonaMappingsWithHttpInfo}. + *

See {@link #listGitHubCloudAuthPersonaMappingsWithHttpInfo}. * - * @return AWSCloudAuthPersonaMappingsResponse + * @return GitHubCloudAuthPersonaMappingsResponse * @throws ApiException if fails to make API call */ - public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() throws ApiException { - return listAWSCloudAuthPersonaMappingsWithHttpInfo().getData(); + public GitHubCloudAuthPersonaMappingsResponse listGitHubCloudAuthPersonaMappings() + throws ApiException { + return listGitHubCloudAuthPersonaMappingsWithHttpInfo().getData(); } /** - * List AWS cloud authentication persona mappings. + * List GitHub cloud authentication persona mappings. * - *

See {@link #listAWSCloudAuthPersonaMappingsWithHttpInfoAsync}. + *

See {@link #listGitHubCloudAuthPersonaMappingsWithHttpInfoAsync}. * - * @return CompletableFuture<AWSCloudAuthPersonaMappingsResponse> + * @return CompletableFuture<GitHubCloudAuthPersonaMappingsResponse> */ - public CompletableFuture - listAWSCloudAuthPersonaMappingsAsync() { - return listAWSCloudAuthPersonaMappingsWithHttpInfoAsync() + public CompletableFuture + listGitHubCloudAuthPersonaMappingsAsync() { + return listGitHubCloudAuthPersonaMappingsWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -560,10 +1809,11 @@ public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() thr } /** - * List all AWS cloud authentication persona mappings. This endpoint retrieves all configured - * persona mappings that associate AWS IAM principals with Datadog users. + * List all GitHub cloud authentication persona mappings. This endpoint retrieves all configured + * persona mappings that associate GitHub Actions OpenID Connect (OIDC) principals with Datadog + * users. Mapped principals can request impersonation tokens. * - * @return ApiResponse<AWSCloudAuthPersonaMappingsResponse> + * @return ApiResponse<GitHubCloudAuthPersonaMappingsResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -575,10 +1825,10 @@ public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() thr * *
429 Too many requests -
*/ - public ApiResponse - listAWSCloudAuthPersonaMappingsWithHttpInfo() throws ApiException { + public ApiResponse + listGitHubCloudAuthPersonaMappingsWithHttpInfo() throws ApiException { // Check if unstable operation is enabled - String operationId = "listAWSCloudAuthPersonaMappings"; + String operationId = "listGitHubCloudAuthPersonaMappings"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -586,13 +1836,13 @@ public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() thr } Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v2/cloud_auth/aws/persona_mapping"; + String localVarPath = "/api/v2/cloud_auth/github/persona_mapping"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.CloudAuthenticationApi.listAWSCloudAuthPersonaMappings", + "v2.CloudAuthenticationApi.listGitHubCloudAuthPersonaMappings", localVarPath, new ArrayList(), localVarHeaderParams, @@ -607,24 +1857,24 @@ public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() thr localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List AWS cloud authentication persona mappings. + * List GitHub cloud authentication persona mappings. * - *

See {@link #listAWSCloudAuthPersonaMappingsWithHttpInfo}. + *

See {@link #listGitHubCloudAuthPersonaMappingsWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<AWSCloudAuthPersonaMappingsResponse>> + * @return CompletableFuture<ApiResponse<GitHubCloudAuthPersonaMappingsResponse>> */ - public CompletableFuture> - listAWSCloudAuthPersonaMappingsWithHttpInfoAsync() { + public CompletableFuture> + listGitHubCloudAuthPersonaMappingsWithHttpInfoAsync() { // Check if unstable operation is enabled - String operationId = "listAWSCloudAuthPersonaMappings"; + String operationId = "listGitHubCloudAuthPersonaMappings"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); @@ -632,7 +1882,7 @@ public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() thr } Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v2/cloud_auth/aws/persona_mapping"; + String localVarPath = "/api/v2/cloud_auth/github/persona_mapping"; Map localVarHeaderParams = new HashMap(); @@ -640,7 +1890,7 @@ public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() thr try { builder = apiClient.createBuilder( - "v2.CloudAuthenticationApi.listAWSCloudAuthPersonaMappings", + "v2.CloudAuthenticationApi.listGitHubCloudAuthPersonaMappings", localVarPath, new ArrayList(), localVarHeaderParams, @@ -648,7 +1898,7 @@ public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() thr new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -661,6 +1911,6 @@ public AWSCloudAuthPersonaMappingsResponse listAWSCloudAuthPersonaMappings() thr localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } } diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingAttributesResponse.java new file mode 100644 index 00000000000..8c9b1815441 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingAttributesResponse.java @@ -0,0 +1,100 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Attributes for GitHub cloud authentication intake mapping response. */ +@JsonPropertyOrder({GitHubCloudAuthIntakeMappingAttributesResponse.JSON_PROPERTY_CLAIM_MATCHERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthIntakeMappingAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLAIM_MATCHERS = "claim_matchers"; + private GitHubOIDCClaimPatterns claimMatchers; + + public GitHubCloudAuthIntakeMappingAttributesResponse() {} + + @JsonCreator + public GitHubCloudAuthIntakeMappingAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_CLAIM_MATCHERS) + GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + this.unparsed |= claimMatchers.unparsed; + } + + public GitHubCloudAuthIntakeMappingAttributesResponse claimMatchers( + GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + this.unparsed |= claimMatchers.unparsed; + return this; + } + + /** + * GitHub Actions OIDC claims to match against. Each field is a regular expression. The sub + * claim is required; all other claims are optional. A token matches only when all + * provided patterns match simultaneously (AND semantics). + * + * @return claimMatchers + */ + @JsonProperty(JSON_PROPERTY_CLAIM_MATCHERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubOIDCClaimPatterns getClaimMatchers() { + return claimMatchers; + } + + public void setClaimMatchers(GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + if (claimMatchers != null) { + this.unparsed |= claimMatchers.unparsed; + } + } + + /** Return true if this GitHubCloudAuthIntakeMappingAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthIntakeMappingAttributesResponse gitHubCloudAuthIntakeMappingAttributesResponse = + (GitHubCloudAuthIntakeMappingAttributesResponse) o; + return Objects.equals( + this.claimMatchers, gitHubCloudAuthIntakeMappingAttributesResponse.claimMatchers); + } + + @Override + public int hashCode() { + return Objects.hash(claimMatchers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthIntakeMappingAttributesResponse {\n"); + sb.append(" claimMatchers: ").append(toIndentedString(claimMatchers)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateAttributes.java new file mode 100644 index 00000000000..82176bcefae --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateAttributes.java @@ -0,0 +1,100 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Attributes for creating a GitHub cloud authentication intake mapping */ +@JsonPropertyOrder({GitHubCloudAuthIntakeMappingCreateAttributes.JSON_PROPERTY_CLAIM_MATCHERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthIntakeMappingCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLAIM_MATCHERS = "claim_matchers"; + private GitHubOIDCClaimPatterns claimMatchers; + + public GitHubCloudAuthIntakeMappingCreateAttributes() {} + + @JsonCreator + public GitHubCloudAuthIntakeMappingCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CLAIM_MATCHERS) + GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + this.unparsed |= claimMatchers.unparsed; + } + + public GitHubCloudAuthIntakeMappingCreateAttributes claimMatchers( + GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + this.unparsed |= claimMatchers.unparsed; + return this; + } + + /** + * GitHub Actions OIDC claims to match against. Each field is a regular expression. The sub + * claim is required; all other claims are optional. A token matches only when all + * provided patterns match simultaneously (AND semantics). + * + * @return claimMatchers + */ + @JsonProperty(JSON_PROPERTY_CLAIM_MATCHERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubOIDCClaimPatterns getClaimMatchers() { + return claimMatchers; + } + + public void setClaimMatchers(GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + if (claimMatchers != null) { + this.unparsed |= claimMatchers.unparsed; + } + } + + /** Return true if this GitHubCloudAuthIntakeMappingCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthIntakeMappingCreateAttributes gitHubCloudAuthIntakeMappingCreateAttributes = + (GitHubCloudAuthIntakeMappingCreateAttributes) o; + return Objects.equals( + this.claimMatchers, gitHubCloudAuthIntakeMappingCreateAttributes.claimMatchers); + } + + @Override + public int hashCode() { + return Objects.hash(claimMatchers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthIntakeMappingCreateAttributes {\n"); + sb.append(" claimMatchers: ").append(toIndentedString(claimMatchers)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateData.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateData.java new file mode 100644 index 00000000000..c03d082812e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateData.java @@ -0,0 +1,133 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Data for creating a GitHub cloud authentication intake mapping. */ +@JsonPropertyOrder({ + GitHubCloudAuthIntakeMappingCreateData.JSON_PROPERTY_ATTRIBUTES, + GitHubCloudAuthIntakeMappingCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthIntakeMappingCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GitHubCloudAuthIntakeMappingCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GitHubCloudAuthIntakeMappingType type; + + public GitHubCloudAuthIntakeMappingCreateData() {} + + @JsonCreator + public GitHubCloudAuthIntakeMappingCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GitHubCloudAuthIntakeMappingCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GitHubCloudAuthIntakeMappingType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GitHubCloudAuthIntakeMappingCreateData attributes( + GitHubCloudAuthIntakeMappingCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a GitHub cloud authentication intake mapping + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthIntakeMappingCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GitHubCloudAuthIntakeMappingCreateAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public GitHubCloudAuthIntakeMappingCreateData type(GitHubCloudAuthIntakeMappingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for GitHub cloud authentication intake mapping. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthIntakeMappingType getType() { + return type; + } + + public void setType(GitHubCloudAuthIntakeMappingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this GitHubCloudAuthIntakeMappingCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthIntakeMappingCreateData gitHubCloudAuthIntakeMappingCreateData = + (GitHubCloudAuthIntakeMappingCreateData) o; + return Objects.equals(this.attributes, gitHubCloudAuthIntakeMappingCreateData.attributes) + && Objects.equals(this.type, gitHubCloudAuthIntakeMappingCreateData.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthIntakeMappingCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateRequest.java new file mode 100644 index 00000000000..ab2b2b53a48 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingCreateRequest.java @@ -0,0 +1,97 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Request used to create a GitHub cloud authentication intake mapping. */ +@JsonPropertyOrder({GitHubCloudAuthIntakeMappingCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthIntakeMappingCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GitHubCloudAuthIntakeMappingCreateData data; + + public GitHubCloudAuthIntakeMappingCreateRequest() {} + + @JsonCreator + public GitHubCloudAuthIntakeMappingCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GitHubCloudAuthIntakeMappingCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GitHubCloudAuthIntakeMappingCreateRequest data( + GitHubCloudAuthIntakeMappingCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating a GitHub cloud authentication intake mapping. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthIntakeMappingCreateData getData() { + return data; + } + + public void setData(GitHubCloudAuthIntakeMappingCreateData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** Return true if this GitHubCloudAuthIntakeMappingCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthIntakeMappingCreateRequest gitHubCloudAuthIntakeMappingCreateRequest = + (GitHubCloudAuthIntakeMappingCreateRequest) o; + return Objects.equals(this.data, gitHubCloudAuthIntakeMappingCreateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthIntakeMappingCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingDataResponse.java new file mode 100644 index 00000000000..bd63de42ea9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingDataResponse.java @@ -0,0 +1,217 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for GitHub cloud authentication intake mapping response. */ +@JsonPropertyOrder({ + GitHubCloudAuthIntakeMappingDataResponse.JSON_PROPERTY_ATTRIBUTES, + GitHubCloudAuthIntakeMappingDataResponse.JSON_PROPERTY_ID, + GitHubCloudAuthIntakeMappingDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthIntakeMappingDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GitHubCloudAuthIntakeMappingAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GitHubCloudAuthIntakeMappingType type; + + public GitHubCloudAuthIntakeMappingDataResponse() {} + + @JsonCreator + public GitHubCloudAuthIntakeMappingDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GitHubCloudAuthIntakeMappingAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GitHubCloudAuthIntakeMappingType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GitHubCloudAuthIntakeMappingDataResponse attributes( + GitHubCloudAuthIntakeMappingAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for GitHub cloud authentication intake mapping response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthIntakeMappingAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(GitHubCloudAuthIntakeMappingAttributesResponse attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public GitHubCloudAuthIntakeMappingDataResponse id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the intake mapping. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GitHubCloudAuthIntakeMappingDataResponse type(GitHubCloudAuthIntakeMappingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for GitHub cloud authentication intake mapping. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthIntakeMappingType getType() { + return type; + } + + public void setType(GitHubCloudAuthIntakeMappingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GitHubCloudAuthIntakeMappingDataResponse + */ + @JsonAnySetter + public GitHubCloudAuthIntakeMappingDataResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GitHubCloudAuthIntakeMappingDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthIntakeMappingDataResponse gitHubCloudAuthIntakeMappingDataResponse = + (GitHubCloudAuthIntakeMappingDataResponse) o; + return Objects.equals(this.attributes, gitHubCloudAuthIntakeMappingDataResponse.attributes) + && Objects.equals(this.id, gitHubCloudAuthIntakeMappingDataResponse.id) + && Objects.equals(this.type, gitHubCloudAuthIntakeMappingDataResponse.type) + && Objects.equals( + this.additionalProperties, + gitHubCloudAuthIntakeMappingDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthIntakeMappingDataResponse {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingResponse.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingResponse.java new file mode 100644 index 00000000000..8405b490345 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingResponse.java @@ -0,0 +1,151 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single GitHub cloud authentication intake mapping. */ +@JsonPropertyOrder({GitHubCloudAuthIntakeMappingResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthIntakeMappingResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GitHubCloudAuthIntakeMappingDataResponse data; + + public GitHubCloudAuthIntakeMappingResponse() {} + + @JsonCreator + public GitHubCloudAuthIntakeMappingResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GitHubCloudAuthIntakeMappingDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GitHubCloudAuthIntakeMappingResponse data(GitHubCloudAuthIntakeMappingDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for GitHub cloud authentication intake mapping response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthIntakeMappingDataResponse getData() { + return data; + } + + public void setData(GitHubCloudAuthIntakeMappingDataResponse data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GitHubCloudAuthIntakeMappingResponse + */ + @JsonAnySetter + public GitHubCloudAuthIntakeMappingResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GitHubCloudAuthIntakeMappingResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthIntakeMappingResponse gitHubCloudAuthIntakeMappingResponse = + (GitHubCloudAuthIntakeMappingResponse) o; + return Objects.equals(this.data, gitHubCloudAuthIntakeMappingResponse.data) + && Objects.equals( + this.additionalProperties, gitHubCloudAuthIntakeMappingResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthIntakeMappingResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingType.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingType.java new file mode 100644 index 00000000000..0e99126d77f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type identifier for GitHub cloud authentication intake mapping. */ +@JsonSerialize( + using = GitHubCloudAuthIntakeMappingType.GitHubCloudAuthIntakeMappingTypeSerializer.class) +public class GitHubCloudAuthIntakeMappingType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("github_oidc_auth_intake_mapping")); + + public static final GitHubCloudAuthIntakeMappingType GITHUB_OIDC_AUTH_INTAKE_MAPPING = + new GitHubCloudAuthIntakeMappingType("github_oidc_auth_intake_mapping"); + + GitHubCloudAuthIntakeMappingType(String value) { + super(value, allowedValues); + } + + public static class GitHubCloudAuthIntakeMappingTypeSerializer + extends StdSerializer { + public GitHubCloudAuthIntakeMappingTypeSerializer(Class t) { + super(t); + } + + public GitHubCloudAuthIntakeMappingTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GitHubCloudAuthIntakeMappingType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GitHubCloudAuthIntakeMappingType fromValue(String value) { + return new GitHubCloudAuthIntakeMappingType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingsResponse.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingsResponse.java new file mode 100644 index 00000000000..3896ba9408a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthIntakeMappingsResponse.java @@ -0,0 +1,167 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of GitHub cloud authentication intake mappings. */ +@JsonPropertyOrder({GitHubCloudAuthIntakeMappingsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthIntakeMappingsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public GitHubCloudAuthIntakeMappingsResponse() {} + + @JsonCreator + public GitHubCloudAuthIntakeMappingsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + for (GitHubCloudAuthIntakeMappingDataResponse item : data) { + this.unparsed |= item.unparsed; + } + } + + public GitHubCloudAuthIntakeMappingsResponse data( + List data) { + this.data = data; + for (GitHubCloudAuthIntakeMappingDataResponse item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GitHubCloudAuthIntakeMappingsResponse addDataItem( + GitHubCloudAuthIntakeMappingDataResponse dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of GitHub cloud authentication intake mappings. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (GitHubCloudAuthIntakeMappingDataResponse item : data) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GitHubCloudAuthIntakeMappingsResponse + */ + @JsonAnySetter + public GitHubCloudAuthIntakeMappingsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GitHubCloudAuthIntakeMappingsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthIntakeMappingsResponse gitHubCloudAuthIntakeMappingsResponse = + (GitHubCloudAuthIntakeMappingsResponse) o; + return Objects.equals(this.data, gitHubCloudAuthIntakeMappingsResponse.data) + && Objects.equals( + this.additionalProperties, gitHubCloudAuthIntakeMappingsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthIntakeMappingsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingAttributesResponse.java new file mode 100644 index 00000000000..ab1bf57142c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingAttributesResponse.java @@ -0,0 +1,164 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Attributes for GitHub cloud authentication persona mapping response. */ +@JsonPropertyOrder({ + GitHubCloudAuthPersonaMappingAttributesResponse.JSON_PROPERTY_ACCOUNT_IDENTIFIER, + GitHubCloudAuthPersonaMappingAttributesResponse.JSON_PROPERTY_ACCOUNT_UUID, + GitHubCloudAuthPersonaMappingAttributesResponse.JSON_PROPERTY_CLAIM_MATCHERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthPersonaMappingAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_IDENTIFIER = "account_identifier"; + private String accountIdentifier; + + public static final String JSON_PROPERTY_ACCOUNT_UUID = "account_uuid"; + private String accountUuid; + + public static final String JSON_PROPERTY_CLAIM_MATCHERS = "claim_matchers"; + private GitHubOIDCClaimPatterns claimMatchers; + + public GitHubCloudAuthPersonaMappingAttributesResponse() {} + + @JsonCreator + public GitHubCloudAuthPersonaMappingAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_IDENTIFIER) + String accountIdentifier, + @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_UUID) String accountUuid, + @JsonProperty(required = true, value = JSON_PROPERTY_CLAIM_MATCHERS) + GitHubOIDCClaimPatterns claimMatchers) { + this.accountIdentifier = accountIdentifier; + this.accountUuid = accountUuid; + this.claimMatchers = claimMatchers; + this.unparsed |= claimMatchers.unparsed; + } + + public GitHubCloudAuthPersonaMappingAttributesResponse accountIdentifier( + String accountIdentifier) { + this.accountIdentifier = accountIdentifier; + return this; + } + + /** + * Datadog account identifier (email or handle) mapped to the GitHub principal. + * + * @return accountIdentifier + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountIdentifier() { + return accountIdentifier; + } + + public void setAccountIdentifier(String accountIdentifier) { + this.accountIdentifier = accountIdentifier; + } + + public GitHubCloudAuthPersonaMappingAttributesResponse accountUuid(String accountUuid) { + this.accountUuid = accountUuid; + return this; + } + + /** + * Datadog account UUID. + * + * @return accountUuid + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_UUID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountUuid() { + return accountUuid; + } + + public void setAccountUuid(String accountUuid) { + this.accountUuid = accountUuid; + } + + public GitHubCloudAuthPersonaMappingAttributesResponse claimMatchers( + GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + this.unparsed |= claimMatchers.unparsed; + return this; + } + + /** + * GitHub Actions OIDC claims to match against. Each field is a regular expression. The sub + * claim is required; all other claims are optional. A token matches only when all + * provided patterns match simultaneously (AND semantics). + * + * @return claimMatchers + */ + @JsonProperty(JSON_PROPERTY_CLAIM_MATCHERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubOIDCClaimPatterns getClaimMatchers() { + return claimMatchers; + } + + public void setClaimMatchers(GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + if (claimMatchers != null) { + this.unparsed |= claimMatchers.unparsed; + } + } + + /** Return true if this GitHubCloudAuthPersonaMappingAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthPersonaMappingAttributesResponse + gitHubCloudAuthPersonaMappingAttributesResponse = + (GitHubCloudAuthPersonaMappingAttributesResponse) o; + return Objects.equals( + this.accountIdentifier, + gitHubCloudAuthPersonaMappingAttributesResponse.accountIdentifier) + && Objects.equals( + this.accountUuid, gitHubCloudAuthPersonaMappingAttributesResponse.accountUuid) + && Objects.equals( + this.claimMatchers, gitHubCloudAuthPersonaMappingAttributesResponse.claimMatchers); + } + + @Override + public int hashCode() { + return Objects.hash(accountIdentifier, accountUuid, claimMatchers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthPersonaMappingAttributesResponse {\n"); + sb.append(" accountIdentifier: ").append(toIndentedString(accountIdentifier)).append("\n"); + sb.append(" accountUuid: ").append(toIndentedString(accountUuid)).append("\n"); + sb.append(" claimMatchers: ").append(toIndentedString(claimMatchers)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateAttributes.java new file mode 100644 index 00000000000..3f5b4332cf6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateAttributes.java @@ -0,0 +1,132 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Attributes for creating a GitHub cloud authentication persona mapping. */ +@JsonPropertyOrder({ + GitHubCloudAuthPersonaMappingCreateAttributes.JSON_PROPERTY_ACCOUNT_IDENTIFIER, + GitHubCloudAuthPersonaMappingCreateAttributes.JSON_PROPERTY_CLAIM_MATCHERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthPersonaMappingCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_IDENTIFIER = "account_identifier"; + private String accountIdentifier; + + public static final String JSON_PROPERTY_CLAIM_MATCHERS = "claim_matchers"; + private GitHubOIDCClaimPatterns claimMatchers; + + public GitHubCloudAuthPersonaMappingCreateAttributes() {} + + @JsonCreator + public GitHubCloudAuthPersonaMappingCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_IDENTIFIER) + String accountIdentifier, + @JsonProperty(required = true, value = JSON_PROPERTY_CLAIM_MATCHERS) + GitHubOIDCClaimPatterns claimMatchers) { + this.accountIdentifier = accountIdentifier; + this.claimMatchers = claimMatchers; + this.unparsed |= claimMatchers.unparsed; + } + + public GitHubCloudAuthPersonaMappingCreateAttributes accountIdentifier(String accountIdentifier) { + this.accountIdentifier = accountIdentifier; + return this; + } + + /** + * Datadog account identifier (email or handle) mapped to the GitHub principal. + * + * @return accountIdentifier + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_IDENTIFIER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountIdentifier() { + return accountIdentifier; + } + + public void setAccountIdentifier(String accountIdentifier) { + this.accountIdentifier = accountIdentifier; + } + + public GitHubCloudAuthPersonaMappingCreateAttributes claimMatchers( + GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + this.unparsed |= claimMatchers.unparsed; + return this; + } + + /** + * GitHub Actions OIDC claims to match against. Each field is a regular expression. The sub + * claim is required; all other claims are optional. A token matches only when all + * provided patterns match simultaneously (AND semantics). + * + * @return claimMatchers + */ + @JsonProperty(JSON_PROPERTY_CLAIM_MATCHERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubOIDCClaimPatterns getClaimMatchers() { + return claimMatchers; + } + + public void setClaimMatchers(GitHubOIDCClaimPatterns claimMatchers) { + this.claimMatchers = claimMatchers; + if (claimMatchers != null) { + this.unparsed |= claimMatchers.unparsed; + } + } + + /** Return true if this GitHubCloudAuthPersonaMappingCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthPersonaMappingCreateAttributes gitHubCloudAuthPersonaMappingCreateAttributes = + (GitHubCloudAuthPersonaMappingCreateAttributes) o; + return Objects.equals( + this.accountIdentifier, gitHubCloudAuthPersonaMappingCreateAttributes.accountIdentifier) + && Objects.equals( + this.claimMatchers, gitHubCloudAuthPersonaMappingCreateAttributes.claimMatchers); + } + + @Override + public int hashCode() { + return Objects.hash(accountIdentifier, claimMatchers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthPersonaMappingCreateAttributes {\n"); + sb.append(" accountIdentifier: ").append(toIndentedString(accountIdentifier)).append("\n"); + sb.append(" claimMatchers: ").append(toIndentedString(claimMatchers)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateData.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateData.java new file mode 100644 index 00000000000..82708385c3f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateData.java @@ -0,0 +1,133 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Data for creating a GitHub cloud authentication persona mapping. */ +@JsonPropertyOrder({ + GitHubCloudAuthPersonaMappingCreateData.JSON_PROPERTY_ATTRIBUTES, + GitHubCloudAuthPersonaMappingCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthPersonaMappingCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GitHubCloudAuthPersonaMappingCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GitHubCloudAuthPersonaMappingType type; + + public GitHubCloudAuthPersonaMappingCreateData() {} + + @JsonCreator + public GitHubCloudAuthPersonaMappingCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GitHubCloudAuthPersonaMappingCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GitHubCloudAuthPersonaMappingType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GitHubCloudAuthPersonaMappingCreateData attributes( + GitHubCloudAuthPersonaMappingCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a GitHub cloud authentication persona mapping. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthPersonaMappingCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GitHubCloudAuthPersonaMappingCreateAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public GitHubCloudAuthPersonaMappingCreateData type(GitHubCloudAuthPersonaMappingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for GitHub cloud authentication persona mapping. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthPersonaMappingType getType() { + return type; + } + + public void setType(GitHubCloudAuthPersonaMappingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this GitHubCloudAuthPersonaMappingCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthPersonaMappingCreateData gitHubCloudAuthPersonaMappingCreateData = + (GitHubCloudAuthPersonaMappingCreateData) o; + return Objects.equals(this.attributes, gitHubCloudAuthPersonaMappingCreateData.attributes) + && Objects.equals(this.type, gitHubCloudAuthPersonaMappingCreateData.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthPersonaMappingCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateRequest.java new file mode 100644 index 00000000000..1a54fc35dca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingCreateRequest.java @@ -0,0 +1,97 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Request used to create a GitHub cloud authentication persona mapping. */ +@JsonPropertyOrder({GitHubCloudAuthPersonaMappingCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthPersonaMappingCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GitHubCloudAuthPersonaMappingCreateData data; + + public GitHubCloudAuthPersonaMappingCreateRequest() {} + + @JsonCreator + public GitHubCloudAuthPersonaMappingCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GitHubCloudAuthPersonaMappingCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GitHubCloudAuthPersonaMappingCreateRequest data( + GitHubCloudAuthPersonaMappingCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating a GitHub cloud authentication persona mapping. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthPersonaMappingCreateData getData() { + return data; + } + + public void setData(GitHubCloudAuthPersonaMappingCreateData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** Return true if this GitHubCloudAuthPersonaMappingCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthPersonaMappingCreateRequest gitHubCloudAuthPersonaMappingCreateRequest = + (GitHubCloudAuthPersonaMappingCreateRequest) o; + return Objects.equals(this.data, gitHubCloudAuthPersonaMappingCreateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthPersonaMappingCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingDataResponse.java new file mode 100644 index 00000000000..7cbaaa912e1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingDataResponse.java @@ -0,0 +1,217 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for GitHub cloud authentication persona mapping response. */ +@JsonPropertyOrder({ + GitHubCloudAuthPersonaMappingDataResponse.JSON_PROPERTY_ATTRIBUTES, + GitHubCloudAuthPersonaMappingDataResponse.JSON_PROPERTY_ID, + GitHubCloudAuthPersonaMappingDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthPersonaMappingDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GitHubCloudAuthPersonaMappingAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private GitHubCloudAuthPersonaMappingType type; + + public GitHubCloudAuthPersonaMappingDataResponse() {} + + @JsonCreator + public GitHubCloudAuthPersonaMappingDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GitHubCloudAuthPersonaMappingAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + GitHubCloudAuthPersonaMappingType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GitHubCloudAuthPersonaMappingDataResponse attributes( + GitHubCloudAuthPersonaMappingAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for GitHub cloud authentication persona mapping response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthPersonaMappingAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(GitHubCloudAuthPersonaMappingAttributesResponse attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public GitHubCloudAuthPersonaMappingDataResponse id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the persona mapping. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GitHubCloudAuthPersonaMappingDataResponse type(GitHubCloudAuthPersonaMappingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type identifier for GitHub cloud authentication persona mapping. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthPersonaMappingType getType() { + return type; + } + + public void setType(GitHubCloudAuthPersonaMappingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GitHubCloudAuthPersonaMappingDataResponse + */ + @JsonAnySetter + public GitHubCloudAuthPersonaMappingDataResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GitHubCloudAuthPersonaMappingDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthPersonaMappingDataResponse gitHubCloudAuthPersonaMappingDataResponse = + (GitHubCloudAuthPersonaMappingDataResponse) o; + return Objects.equals(this.attributes, gitHubCloudAuthPersonaMappingDataResponse.attributes) + && Objects.equals(this.id, gitHubCloudAuthPersonaMappingDataResponse.id) + && Objects.equals(this.type, gitHubCloudAuthPersonaMappingDataResponse.type) + && Objects.equals( + this.additionalProperties, + gitHubCloudAuthPersonaMappingDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthPersonaMappingDataResponse {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingResponse.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingResponse.java new file mode 100644 index 00000000000..1e174bbdbd5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingResponse.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single GitHub cloud authentication persona mapping. */ +@JsonPropertyOrder({GitHubCloudAuthPersonaMappingResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthPersonaMappingResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GitHubCloudAuthPersonaMappingDataResponse data; + + public GitHubCloudAuthPersonaMappingResponse() {} + + @JsonCreator + public GitHubCloudAuthPersonaMappingResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GitHubCloudAuthPersonaMappingDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public GitHubCloudAuthPersonaMappingResponse data( + GitHubCloudAuthPersonaMappingDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for GitHub cloud authentication persona mapping response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GitHubCloudAuthPersonaMappingDataResponse getData() { + return data; + } + + public void setData(GitHubCloudAuthPersonaMappingDataResponse data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GitHubCloudAuthPersonaMappingResponse + */ + @JsonAnySetter + public GitHubCloudAuthPersonaMappingResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GitHubCloudAuthPersonaMappingResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthPersonaMappingResponse gitHubCloudAuthPersonaMappingResponse = + (GitHubCloudAuthPersonaMappingResponse) o; + return Objects.equals(this.data, gitHubCloudAuthPersonaMappingResponse.data) + && Objects.equals( + this.additionalProperties, gitHubCloudAuthPersonaMappingResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthPersonaMappingResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingType.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingType.java new file mode 100644 index 00000000000..74630202b96 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type identifier for GitHub cloud authentication persona mapping. */ +@JsonSerialize( + using = GitHubCloudAuthPersonaMappingType.GitHubCloudAuthPersonaMappingTypeSerializer.class) +public class GitHubCloudAuthPersonaMappingType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("github_oidc_auth_config")); + + public static final GitHubCloudAuthPersonaMappingType GITHUB_OIDC_AUTH_CONFIG = + new GitHubCloudAuthPersonaMappingType("github_oidc_auth_config"); + + GitHubCloudAuthPersonaMappingType(String value) { + super(value, allowedValues); + } + + public static class GitHubCloudAuthPersonaMappingTypeSerializer + extends StdSerializer { + public GitHubCloudAuthPersonaMappingTypeSerializer(Class t) { + super(t); + } + + public GitHubCloudAuthPersonaMappingTypeSerializer() { + this(null); + } + + @Override + public void serialize( + GitHubCloudAuthPersonaMappingType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static GitHubCloudAuthPersonaMappingType fromValue(String value) { + return new GitHubCloudAuthPersonaMappingType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingsResponse.java b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingsResponse.java new file mode 100644 index 00000000000..96e4442bd98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubCloudAuthPersonaMappingsResponse.java @@ -0,0 +1,167 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of GitHub cloud authentication persona mappings. */ +@JsonPropertyOrder({GitHubCloudAuthPersonaMappingsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubCloudAuthPersonaMappingsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public GitHubCloudAuthPersonaMappingsResponse() {} + + @JsonCreator + public GitHubCloudAuthPersonaMappingsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + for (GitHubCloudAuthPersonaMappingDataResponse item : data) { + this.unparsed |= item.unparsed; + } + } + + public GitHubCloudAuthPersonaMappingsResponse data( + List data) { + this.data = data; + for (GitHubCloudAuthPersonaMappingDataResponse item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GitHubCloudAuthPersonaMappingsResponse addDataItem( + GitHubCloudAuthPersonaMappingDataResponse dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of GitHub cloud authentication persona mappings. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (GitHubCloudAuthPersonaMappingDataResponse item : data) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GitHubCloudAuthPersonaMappingsResponse + */ + @JsonAnySetter + public GitHubCloudAuthPersonaMappingsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GitHubCloudAuthPersonaMappingsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubCloudAuthPersonaMappingsResponse gitHubCloudAuthPersonaMappingsResponse = + (GitHubCloudAuthPersonaMappingsResponse) o; + return Objects.equals(this.data, gitHubCloudAuthPersonaMappingsResponse.data) + && Objects.equals( + this.additionalProperties, gitHubCloudAuthPersonaMappingsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubCloudAuthPersonaMappingsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GitHubOIDCClaimPatterns.java b/src/main/java/com/datadog/api/client/v2/model/GitHubOIDCClaimPatterns.java new file mode 100644 index 00000000000..048ac263f76 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GitHubOIDCClaimPatterns.java @@ -0,0 +1,578 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * GitHub Actions OIDC claims to match against. Each field is a regular expression. The sub + * claim is required; all other claims are optional. A token matches only when all provided + * patterns match simultaneously (AND semantics). + */ +@JsonPropertyOrder({ + GitHubOIDCClaimPatterns.JSON_PROPERTY_ACTOR, + GitHubOIDCClaimPatterns.JSON_PROPERTY_ACTOR_ID, + GitHubOIDCClaimPatterns.JSON_PROPERTY_ENTERPRISE, + GitHubOIDCClaimPatterns.JSON_PROPERTY_ENTERPRISE_ID, + GitHubOIDCClaimPatterns.JSON_PROPERTY_ENVIRONMENT, + GitHubOIDCClaimPatterns.JSON_PROPERTY_EVENT_NAME, + GitHubOIDCClaimPatterns.JSON_PROPERTY_JOB_WORKFLOW_REF, + GitHubOIDCClaimPatterns.JSON_PROPERTY_REF, + GitHubOIDCClaimPatterns.JSON_PROPERTY_REF_TYPE, + GitHubOIDCClaimPatterns.JSON_PROPERTY_REPOSITORY, + GitHubOIDCClaimPatterns.JSON_PROPERTY_REPOSITORY_ID, + GitHubOIDCClaimPatterns.JSON_PROPERTY_REPOSITORY_OWNER, + GitHubOIDCClaimPatterns.JSON_PROPERTY_REPOSITORY_OWNER_ID, + GitHubOIDCClaimPatterns.JSON_PROPERTY_REPOSITORY_VISIBILITY, + GitHubOIDCClaimPatterns.JSON_PROPERTY_RUNNER_ENVIRONMENT, + GitHubOIDCClaimPatterns.JSON_PROPERTY_SUB, + GitHubOIDCClaimPatterns.JSON_PROPERTY_WORKFLOW, + GitHubOIDCClaimPatterns.JSON_PROPERTY_WORKFLOW_REF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GitHubOIDCClaimPatterns { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTOR = "actor"; + private String actor; + + public static final String JSON_PROPERTY_ACTOR_ID = "actor_id"; + private String actorId; + + public static final String JSON_PROPERTY_ENTERPRISE = "enterprise"; + private String enterprise; + + public static final String JSON_PROPERTY_ENTERPRISE_ID = "enterprise_id"; + private String enterpriseId; + + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; + private String environment; + + public static final String JSON_PROPERTY_EVENT_NAME = "event_name"; + private String eventName; + + public static final String JSON_PROPERTY_JOB_WORKFLOW_REF = "job_workflow_ref"; + private String jobWorkflowRef; + + public static final String JSON_PROPERTY_REF = "ref"; + private String ref; + + public static final String JSON_PROPERTY_REF_TYPE = "ref_type"; + private String refType; + + public static final String JSON_PROPERTY_REPOSITORY = "repository"; + private String repository; + + public static final String JSON_PROPERTY_REPOSITORY_ID = "repository_id"; + private String repositoryId; + + public static final String JSON_PROPERTY_REPOSITORY_OWNER = "repository_owner"; + private String repositoryOwner; + + public static final String JSON_PROPERTY_REPOSITORY_OWNER_ID = "repository_owner_id"; + private String repositoryOwnerId; + + public static final String JSON_PROPERTY_REPOSITORY_VISIBILITY = "repository_visibility"; + private String repositoryVisibility; + + public static final String JSON_PROPERTY_RUNNER_ENVIRONMENT = "runner_environment"; + private String runnerEnvironment; + + public static final String JSON_PROPERTY_SUB = "sub"; + private String sub; + + public static final String JSON_PROPERTY_WORKFLOW = "workflow"; + private String workflow; + + public static final String JSON_PROPERTY_WORKFLOW_REF = "workflow_ref"; + private String workflowRef; + + public GitHubOIDCClaimPatterns() {} + + @JsonCreator + public GitHubOIDCClaimPatterns( + @JsonProperty(required = true, value = JSON_PROPERTY_SUB) String sub) { + this.sub = sub; + } + + public GitHubOIDCClaimPatterns actor(String actor) { + this.actor = actor; + return this; + } + + /** + * Regular expression matched against the actor claim. + * + * @return actor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getActor() { + return actor; + } + + public void setActor(String actor) { + this.actor = actor; + } + + public GitHubOIDCClaimPatterns actorId(String actorId) { + this.actorId = actorId; + return this; + } + + /** + * Regular expression matched against the actor_id claim. + * + * @return actorId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getActorId() { + return actorId; + } + + public void setActorId(String actorId) { + this.actorId = actorId; + } + + public GitHubOIDCClaimPatterns enterprise(String enterprise) { + this.enterprise = enterprise; + return this; + } + + /** + * Regular expression matched against the enterprise claim. + * + * @return enterprise + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTERPRISE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnterprise() { + return enterprise; + } + + public void setEnterprise(String enterprise) { + this.enterprise = enterprise; + } + + public GitHubOIDCClaimPatterns enterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + return this; + } + + /** + * Regular expression matched against the enterprise_id claim. + * + * @return enterpriseId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENTERPRISE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnterpriseId() { + return enterpriseId; + } + + public void setEnterpriseId(String enterpriseId) { + this.enterpriseId = enterpriseId; + } + + public GitHubOIDCClaimPatterns environment(String environment) { + this.environment = environment; + return this; + } + + /** + * Regular expression matched against the environment claim. + * + * @return environment + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnvironment() { + return environment; + } + + public void setEnvironment(String environment) { + this.environment = environment; + } + + public GitHubOIDCClaimPatterns eventName(String eventName) { + this.eventName = eventName; + return this; + } + + /** + * Regular expression matched against the event_name claim. + * + * @return eventName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventName() { + return eventName; + } + + public void setEventName(String eventName) { + this.eventName = eventName; + } + + public GitHubOIDCClaimPatterns jobWorkflowRef(String jobWorkflowRef) { + this.jobWorkflowRef = jobWorkflowRef; + return this; + } + + /** + * Regular expression matched against the job_workflow_ref claim. + * + * @return jobWorkflowRef + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JOB_WORKFLOW_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getJobWorkflowRef() { + return jobWorkflowRef; + } + + public void setJobWorkflowRef(String jobWorkflowRef) { + this.jobWorkflowRef = jobWorkflowRef; + } + + public GitHubOIDCClaimPatterns ref(String ref) { + this.ref = ref; + return this; + } + + /** + * Regular expression matched against the ref claim. + * + * @return ref + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRef() { + return ref; + } + + public void setRef(String ref) { + this.ref = ref; + } + + public GitHubOIDCClaimPatterns refType(String refType) { + this.refType = refType; + return this; + } + + /** + * Regular expression matched against the ref_type claim. + * + * @return refType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REF_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRefType() { + return refType; + } + + public void setRefType(String refType) { + this.refType = refType; + } + + public GitHubOIDCClaimPatterns repository(String repository) { + this.repository = repository; + return this; + } + + /** + * Regular expression matched against the repository claim. + * + * @return repository + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPOSITORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepository() { + return repository; + } + + public void setRepository(String repository) { + this.repository = repository; + } + + public GitHubOIDCClaimPatterns repositoryId(String repositoryId) { + this.repositoryId = repositoryId; + return this; + } + + /** + * Regular expression matched against the repository_id claim. + * + * @return repositoryId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPOSITORY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepositoryId() { + return repositoryId; + } + + public void setRepositoryId(String repositoryId) { + this.repositoryId = repositoryId; + } + + public GitHubOIDCClaimPatterns repositoryOwner(String repositoryOwner) { + this.repositoryOwner = repositoryOwner; + return this; + } + + /** + * Regular expression matched against the repository_owner claim. + * + * @return repositoryOwner + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPOSITORY_OWNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepositoryOwner() { + return repositoryOwner; + } + + public void setRepositoryOwner(String repositoryOwner) { + this.repositoryOwner = repositoryOwner; + } + + public GitHubOIDCClaimPatterns repositoryOwnerId(String repositoryOwnerId) { + this.repositoryOwnerId = repositoryOwnerId; + return this; + } + + /** + * Regular expression matched against the repository_owner_id claim. + * + * @return repositoryOwnerId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPOSITORY_OWNER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepositoryOwnerId() { + return repositoryOwnerId; + } + + public void setRepositoryOwnerId(String repositoryOwnerId) { + this.repositoryOwnerId = repositoryOwnerId; + } + + public GitHubOIDCClaimPatterns repositoryVisibility(String repositoryVisibility) { + this.repositoryVisibility = repositoryVisibility; + return this; + } + + /** + * Regular expression matched against the repository_visibility claim. + * + * @return repositoryVisibility + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPOSITORY_VISIBILITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRepositoryVisibility() { + return repositoryVisibility; + } + + public void setRepositoryVisibility(String repositoryVisibility) { + this.repositoryVisibility = repositoryVisibility; + } + + public GitHubOIDCClaimPatterns runnerEnvironment(String runnerEnvironment) { + this.runnerEnvironment = runnerEnvironment; + return this; + } + + /** + * Regular expression matched against the runner_environment claim. + * + * @return runnerEnvironment + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RUNNER_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRunnerEnvironment() { + return runnerEnvironment; + } + + public void setRunnerEnvironment(String runnerEnvironment) { + this.runnerEnvironment = runnerEnvironment; + } + + public GitHubOIDCClaimPatterns sub(String sub) { + this.sub = sub; + return this; + } + + /** + * Regular expression matched against the entire sub (subject) claim, the primary + * GitHub Actions OIDC identifier (for example, + * repo:<OWNER>/<REPO>:ref:refs/heads/main). The pattern must begin with + * repo:<OWNER>/, where <OWNER> is a literal repository-owner name + * rather than a regular expression. + * + * @return sub + */ + @JsonProperty(JSON_PROPERTY_SUB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSub() { + return sub; + } + + public void setSub(String sub) { + this.sub = sub; + } + + public GitHubOIDCClaimPatterns workflow(String workflow) { + this.workflow = workflow; + return this; + } + + /** + * Regular expression matched against the workflow claim. + * + * @return workflow + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WORKFLOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWorkflow() { + return workflow; + } + + public void setWorkflow(String workflow) { + this.workflow = workflow; + } + + public GitHubOIDCClaimPatterns workflowRef(String workflowRef) { + this.workflowRef = workflowRef; + return this; + } + + /** + * Regular expression matched against the workflow_ref claim. + * + * @return workflowRef + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WORKFLOW_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWorkflowRef() { + return workflowRef; + } + + public void setWorkflowRef(String workflowRef) { + this.workflowRef = workflowRef; + } + + /** Return true if this GitHubOIDCClaimPatterns object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GitHubOIDCClaimPatterns gitHubOidcClaimPatterns = (GitHubOIDCClaimPatterns) o; + return Objects.equals(this.actor, gitHubOidcClaimPatterns.actor) + && Objects.equals(this.actorId, gitHubOidcClaimPatterns.actorId) + && Objects.equals(this.enterprise, gitHubOidcClaimPatterns.enterprise) + && Objects.equals(this.enterpriseId, gitHubOidcClaimPatterns.enterpriseId) + && Objects.equals(this.environment, gitHubOidcClaimPatterns.environment) + && Objects.equals(this.eventName, gitHubOidcClaimPatterns.eventName) + && Objects.equals(this.jobWorkflowRef, gitHubOidcClaimPatterns.jobWorkflowRef) + && Objects.equals(this.ref, gitHubOidcClaimPatterns.ref) + && Objects.equals(this.refType, gitHubOidcClaimPatterns.refType) + && Objects.equals(this.repository, gitHubOidcClaimPatterns.repository) + && Objects.equals(this.repositoryId, gitHubOidcClaimPatterns.repositoryId) + && Objects.equals(this.repositoryOwner, gitHubOidcClaimPatterns.repositoryOwner) + && Objects.equals(this.repositoryOwnerId, gitHubOidcClaimPatterns.repositoryOwnerId) + && Objects.equals(this.repositoryVisibility, gitHubOidcClaimPatterns.repositoryVisibility) + && Objects.equals(this.runnerEnvironment, gitHubOidcClaimPatterns.runnerEnvironment) + && Objects.equals(this.sub, gitHubOidcClaimPatterns.sub) + && Objects.equals(this.workflow, gitHubOidcClaimPatterns.workflow) + && Objects.equals(this.workflowRef, gitHubOidcClaimPatterns.workflowRef); + } + + @Override + public int hashCode() { + return Objects.hash( + actor, + actorId, + enterprise, + enterpriseId, + environment, + eventName, + jobWorkflowRef, + ref, + refType, + repository, + repositoryId, + repositoryOwner, + repositoryOwnerId, + repositoryVisibility, + runnerEnvironment, + sub, + workflow, + workflowRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GitHubOIDCClaimPatterns {\n"); + sb.append(" actor: ").append(toIndentedString(actor)).append("\n"); + sb.append(" actorId: ").append(toIndentedString(actorId)).append("\n"); + sb.append(" enterprise: ").append(toIndentedString(enterprise)).append("\n"); + sb.append(" enterpriseId: ").append(toIndentedString(enterpriseId)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" eventName: ").append(toIndentedString(eventName)).append("\n"); + sb.append(" jobWorkflowRef: ").append(toIndentedString(jobWorkflowRef)).append("\n"); + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" refType: ").append(toIndentedString(refType)).append("\n"); + sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); + sb.append(" repositoryId: ").append(toIndentedString(repositoryId)).append("\n"); + sb.append(" repositoryOwner: ").append(toIndentedString(repositoryOwner)).append("\n"); + sb.append(" repositoryOwnerId: ").append(toIndentedString(repositoryOwnerId)).append("\n"); + sb.append(" repositoryVisibility: ") + .append(toIndentedString(repositoryVisibility)) + .append("\n"); + sb.append(" runnerEnvironment: ").append(toIndentedString(runnerEnvironment)).append("\n"); + sb.append(" sub: ").append(toIndentedString(sub)).append("\n"); + sb.append(" workflow: ").append(toIndentedString(workflow)).append("\n"); + sb.append(" workflowRef: ").append(toIndentedString(workflowRef)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/cloud_authentication.feature b/src/test/resources/com/datadog/api/client/v2/api/cloud_authentication.feature index 5833fe53036..6debf5b1d04 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/cloud_authentication.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/cloud_authentication.feature @@ -1,13 +1,61 @@ @endpoint(cloud-authentication) @endpoint(cloud-authentication-v2) Feature: Cloud Authentication - Configure AWS cloud authentication mappings for persona and intake - authentication through the Datadog API. + Configure AWS and GitHub cloud authentication mappings for persona and + intake authentication through the Datadog API. Background: Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system And an instance of "CloudAuthentication" API + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Create a GitHub cloud auth intake mapping returns "Bad Request" response + Given operation "CreateGitHubCloudAuthIntakeMapping" enabled + And new "CreateGitHubCloudAuthIntakeMapping" request + And body with value {"data": {"attributes": {"claim_matchers": {"actor": "octocat", "actor_id": "1234567", "enterprise": "test_enterprise", "enterprise_id": "42", "environment": "production", "event_name": "push", "job_workflow_ref": "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main", "ref": "refs/heads/main", "ref_type": "branch", "repository": "test_owner/test_repo", "repository_id": "123456789", "repository_owner": "test_owner", "repository_owner_id": "987654321", "repository_visibility": "public", "runner_environment": "github-hosted", "sub": "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)", "workflow": "CI", "workflow_ref": "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"}}, "type": "github_oidc_auth_intake_mapping"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Create a GitHub cloud auth intake mapping returns "Conflict" response + Given operation "CreateGitHubCloudAuthIntakeMapping" enabled + And new "CreateGitHubCloudAuthIntakeMapping" request + And body with value {"data": {"attributes": {"claim_matchers": {"actor": "octocat", "actor_id": "1234567", "enterprise": "test_enterprise", "enterprise_id": "42", "environment": "production", "event_name": "push", "job_workflow_ref": "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main", "ref": "refs/heads/main", "ref_type": "branch", "repository": "test_owner/test_repo", "repository_id": "123456789", "repository_owner": "test_owner", "repository_owner_id": "987654321", "repository_visibility": "public", "runner_environment": "github-hosted", "sub": "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)", "workflow": "CI", "workflow_ref": "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"}}, "type": "github_oidc_auth_intake_mapping"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Create a GitHub cloud auth intake mapping returns "Created" response + Given operation "CreateGitHubCloudAuthIntakeMapping" enabled + And new "CreateGitHubCloudAuthIntakeMapping" request + And body with value {"data": {"attributes": {"claim_matchers": {"actor": "octocat", "actor_id": "1234567", "enterprise": "test_enterprise", "enterprise_id": "42", "environment": "production", "event_name": "push", "job_workflow_ref": "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main", "ref": "refs/heads/main", "ref_type": "branch", "repository": "test_owner/test_repo", "repository_id": "123456789", "repository_owner": "test_owner", "repository_owner_id": "987654321", "repository_visibility": "public", "runner_environment": "github-hosted", "sub": "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)", "workflow": "CI", "workflow_ref": "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"}}, "type": "github_oidc_auth_intake_mapping"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Create a GitHub cloud auth persona mapping returns "Bad Request" response + Given operation "CreateGitHubCloudAuthPersonaMapping" enabled + And new "CreateGitHubCloudAuthPersonaMapping" request + And body with value {"data": {"attributes": {"account_identifier": "test@example.com", "claim_matchers": {"actor": "octocat", "actor_id": "1234567", "enterprise": "test_enterprise", "enterprise_id": "42", "environment": "production", "event_name": "push", "job_workflow_ref": "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main", "ref": "refs/heads/main", "ref_type": "branch", "repository": "test_owner/test_repo", "repository_id": "123456789", "repository_owner": "test_owner", "repository_owner_id": "987654321", "repository_visibility": "public", "runner_environment": "github-hosted", "sub": "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)", "workflow": "CI", "workflow_ref": "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"}}, "type": "github_oidc_auth_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Create a GitHub cloud auth persona mapping returns "Conflict" response + Given operation "CreateGitHubCloudAuthPersonaMapping" enabled + And new "CreateGitHubCloudAuthPersonaMapping" request + And body with value {"data": {"attributes": {"account_identifier": "test@example.com", "claim_matchers": {"actor": "octocat", "actor_id": "1234567", "enterprise": "test_enterprise", "enterprise_id": "42", "environment": "production", "event_name": "push", "job_workflow_ref": "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main", "ref": "refs/heads/main", "ref_type": "branch", "repository": "test_owner/test_repo", "repository_id": "123456789", "repository_owner": "test_owner", "repository_owner_id": "987654321", "repository_visibility": "public", "runner_environment": "github-hosted", "sub": "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)", "workflow": "CI", "workflow_ref": "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"}}, "type": "github_oidc_auth_config"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Create a GitHub cloud auth persona mapping returns "Created" response + Given operation "CreateGitHubCloudAuthPersonaMapping" enabled + And new "CreateGitHubCloudAuthPersonaMapping" request + And body with value {"data": {"attributes": {"account_identifier": "test@example.com", "claim_matchers": {"actor": "octocat", "actor_id": "1234567", "enterprise": "test_enterprise", "enterprise_id": "42", "environment": "production", "event_name": "push", "job_workflow_ref": "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main", "ref": "refs/heads/main", "ref_type": "branch", "repository": "test_owner/test_repo", "repository_id": "123456789", "repository_owner": "test_owner", "repository_owner_id": "987654321", "repository_visibility": "public", "runner_environment": "github-hosted", "sub": "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)", "workflow": "CI", "workflow_ref": "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"}}, "type": "github_oidc_auth_config"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:ddoghq/team-aaaauthn Scenario: Create an AWS cloud authentication persona mapping returns "Bad Request" response Given operation "CreateAWSCloudAuthPersonaMapping" enabled @@ -32,6 +80,38 @@ Feature: Cloud Authentication When the request is sent Then the response status is 201 Created + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Delete a GitHub cloud auth intake mapping returns "No Content" response + Given operation "DeleteGitHubCloudAuthIntakeMapping" enabled + And new "DeleteGitHubCloudAuthIntakeMapping" request + And request contains "intake_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Delete a GitHub cloud auth intake mapping returns "Not Found" response + Given operation "DeleteGitHubCloudAuthIntakeMapping" enabled + And new "DeleteGitHubCloudAuthIntakeMapping" request + And request contains "intake_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Delete a GitHub cloud auth persona mapping returns "No Content" response + Given operation "DeleteGitHubCloudAuthPersonaMapping" enabled + And new "DeleteGitHubCloudAuthPersonaMapping" request + And request contains "persona_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Delete a GitHub cloud auth persona mapping returns "Not Found" response + Given operation "DeleteGitHubCloudAuthPersonaMapping" enabled + And new "DeleteGitHubCloudAuthPersonaMapping" request + And request contains "persona_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:ddoghq/team-aaaauthn Scenario: Delete an AWS cloud authentication persona mapping returns "No Content" response Given operation "DeleteAWSCloudAuthPersonaMapping" enabled @@ -48,6 +128,38 @@ Feature: Cloud Authentication When the request is sent Then the response status is 404 Not Found + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Get a GitHub cloud authentication intake mapping returns "Not Found" response + Given operation "GetGitHubCloudAuthIntakeMapping" enabled + And new "GetGitHubCloudAuthIntakeMapping" request + And request contains "intake_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Get a GitHub cloud authentication intake mapping returns "OK" response + Given operation "GetGitHubCloudAuthIntakeMapping" enabled + And new "GetGitHubCloudAuthIntakeMapping" request + And request contains "intake_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Get a GitHub cloud authentication persona mapping returns "Not Found" response + Given operation "GetGitHubCloudAuthPersonaMapping" enabled + And new "GetGitHubCloudAuthPersonaMapping" request + And request contains "persona_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: Get a GitHub cloud authentication persona mapping returns "OK" response + Given operation "GetGitHubCloudAuthPersonaMapping" enabled + And new "GetGitHubCloudAuthPersonaMapping" request + And request contains "persona_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/team-aaaauthn Scenario: Get an AWS cloud authentication persona mapping returns "Not Found" response Given operation "GetAWSCloudAuthPersonaMapping" enabled @@ -77,3 +189,31 @@ Feature: Cloud Authentication And new "ListAWSCloudAuthPersonaMappings" request When the request is sent Then the response status is 200 OK + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: List GitHub cloud authentication intake mappings returns "Bad Request" response + Given operation "ListGitHubCloudAuthIntakeMappings" enabled + And new "ListGitHubCloudAuthIntakeMappings" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: List GitHub cloud authentication intake mappings returns "OK" response + Given operation "ListGitHubCloudAuthIntakeMappings" enabled + And new "ListGitHubCloudAuthIntakeMappings" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: List GitHub cloud authentication persona mappings returns "Bad Request" response + Given operation "ListGitHubCloudAuthPersonaMappings" enabled + And new "ListGitHubCloudAuthPersonaMappings" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/team-aaaauthn + Scenario: List GitHub cloud authentication persona mappings returns "OK" response + Given operation "ListGitHubCloudAuthPersonaMappings" enabled + And new "ListGitHubCloudAuthPersonaMappings" request + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index b54343dc540..3c60ae2cd5e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1526,6 +1526,68 @@ "type": "safe" } }, + "ListGitHubCloudAuthIntakeMappings": { + "tag": "Cloud Authentication", + "undo": { + "type": "safe" + } + }, + "CreateGitHubCloudAuthIntakeMapping": { + "tag": "Cloud Authentication", + "undo": { + "operationId": "DeleteGitHubCloudAuthIntakeMapping", + "parameters": [ + { + "name": "intake_mapping_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteGitHubCloudAuthIntakeMapping": { + "tag": "Cloud Authentication", + "undo": { + "type": "idempotent" + } + }, + "GetGitHubCloudAuthIntakeMapping": { + "tag": "Cloud Authentication", + "undo": { + "type": "safe" + } + }, + "ListGitHubCloudAuthPersonaMappings": { + "tag": "Cloud Authentication", + "undo": { + "type": "safe" + } + }, + "CreateGitHubCloudAuthPersonaMapping": { + "tag": "Cloud Authentication", + "undo": { + "operationId": "DeleteGitHubCloudAuthPersonaMapping", + "parameters": [ + { + "name": "persona_mapping_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteGitHubCloudAuthPersonaMapping": { + "tag": "Cloud Authentication", + "undo": { + "type": "idempotent" + } + }, + "GetGitHubCloudAuthPersonaMapping": { + "tag": "Cloud Authentication", + "undo": { + "type": "safe" + } + }, "CreateCustomFramework": { "tag": "Security Monitoring", "undo": {