diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5861fba12e8..8d66d8407cc 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1140,9 +1140,9 @@ components: schema: type: string PersonalAccessTokenID: - description: The ID of the personal access token. + description: The UUID of the personal access token. in: path - name: pat_id + name: pat_uuid required: true schema: example: "00000000-0000-1234-0000-000000000000" @@ -29180,6 +29180,11 @@ components: FullPersonalAccessTokenAttributes: description: Attributes of a full personal access token, including the token key. properties: + alias: + description: The alias (short identifier) of the personal access token. + example: "2H9MCNMBM8FQjQ16YucXkX" + readOnly: true + type: string created_at: description: Creation date of the personal access token. example: "2024-01-01T00:00:00+00:00" @@ -30985,7 +30990,7 @@ components: properties: org_site: description: The site of the organization. - example: "us1" + example: "datadoghq.com" type: string org_uuid: description: The UUID of the organization. @@ -42278,6 +42283,74 @@ components: - type - id type: object + ManagedOrgsData: + description: The managed organizations resource. + properties: + id: + description: The UUID of the current organization. + example: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + format: uuid + type: string + relationships: + $ref: "#/components/schemas/ManagedOrgsRelationships" + type: + $ref: "#/components/schemas/ManagedOrgsType" + required: + - id + - type + - relationships + type: object + ManagedOrgsRelationshipToOrg: + description: Relationship to the current organization. + properties: + data: + $ref: "#/components/schemas/OrgRelationshipData" + required: + - data + type: object + ManagedOrgsRelationshipToOrgs: + description: Relationship to the managed organizations. + properties: + data: + description: List of managed organization references. + items: + $ref: "#/components/schemas/OrgRelationshipData" + type: array + required: + - data + type: object + ManagedOrgsRelationships: + description: Relationships of the managed organizations resource. + properties: + current_org: + $ref: "#/components/schemas/ManagedOrgsRelationshipToOrg" + managed_orgs: + $ref: "#/components/schemas/ManagedOrgsRelationshipToOrgs" + required: + - current_org + - managed_orgs + type: object + ManagedOrgsResponse: + description: Response containing the current organization and its managed organizations. + properties: + data: + $ref: "#/components/schemas/ManagedOrgsData" + included: + description: Included organization resources. + items: + $ref: "#/components/schemas/OrgData" + type: array + required: + - data + - included + type: object + ManagedOrgsType: + description: The resource type for managed organizations. + enum: [managed_orgs] + example: "managed_orgs" + type: string + x-enum-varnames: + - MANAGED_ORGS MemberTeam: description: A member team properties: @@ -50973,6 +51046,53 @@ components: x-enum-varnames: - ASC - DESC + OrgAttributes: + description: Attributes of an organization. + properties: + created_at: + description: The creation timestamp of the organization. + example: "2019-09-26T17:28:28Z" + format: date-time + type: string + description: + description: A description of the organization. + example: "Production organization." + type: string + disabled: + description: Whether the organization is disabled. + example: false + type: boolean + modified_at: + description: The last modification timestamp of the organization. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + name: + description: The name of the organization. + example: "My Organization" + type: string + public_id: + description: The public identifier of the organization. + example: "abcdef12345" + type: string + sharing: + description: The sharing setting of the organization. + example: "none" + type: string + url: + description: The URL of the organization. + example: "https://app.datadoghq.com/account/my-org" + type: string + required: + - public_id + - name + - description + - sharing + - url + - disabled + - created_at + - modified_at + type: object OrgConfigGetResponse: description: A response with a single Org Config. properties: @@ -51274,6 +51394,23 @@ components: type: string x-enum-varnames: - USERS + OrgData: + description: An organization resource. + properties: + attributes: + $ref: "#/components/schemas/OrgAttributes" + id: + description: The UUID of the organization. + example: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + format: uuid + type: string + type: + $ref: "#/components/schemas/OrgResourceType" + required: + - id + - type + - attributes + type: object OrgGroupAttributes: description: Attributes of an org group. properties: @@ -51293,7 +51430,7 @@ components: type: string owner_org_site: description: The site of the organization that owns this org group. - example: "us1" + example: "datadoghq.com" type: string owner_org_uuid: description: The UUID of the organization that owns this org group. @@ -51399,7 +51536,7 @@ components: type: string org_site: description: The site of the member organization. - example: "us1" + example: "datadoghq.com" type: string org_uuid: description: The UUID of the member organization. @@ -51620,8 +51757,11 @@ components: example: value: "UTC" type: object - enforcement_tier: - $ref: "#/components/schemas/OrgGroupPolicyEnforcementTier" + enforced_at: + description: Timestamp when the policy was enforced. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string modified_at: description: Timestamp when the policy was last modified. example: "2024-01-15T10:30:00Z" @@ -51631,12 +51771,9 @@ components: description: The name of the policy. example: "monitor_timezone" type: string - policy_type: - $ref: "#/components/schemas/OrgGroupPolicyPolicyType" required: - policy_name - - policy_type - - enforcement_tier + - enforced_at - modified_at type: object OrgGroupPolicyConfigAttributes: @@ -51707,8 +51844,7 @@ components: x-enum-varnames: - ORG_GROUP_POLICY_CONFIGS OrgGroupPolicyCreateAttributes: - description: >- - Attributes for creating an org group policy. If `policy_type` or `enforcement_tier` are not provided, they default to `org_config` and `DEFAULT` respectively. + description: Attributes for creating an org group policy. properties: content: additionalProperties: {} @@ -51716,14 +51852,10 @@ components: example: value: "UTC" type: object - enforcement_tier: - $ref: "#/components/schemas/OrgGroupPolicyEnforcementTier" policy_name: description: The name of the policy. example: "monitor_timezone" type: string - policy_type: - $ref: "#/components/schemas/OrgGroupPolicyPolicyType" required: - policy_name - content @@ -51777,20 +51909,6 @@ components: - type - attributes type: object - OrgGroupPolicyEnforcementTier: - default: DEFAULT - description: >- - The enforcement tier of the policy. `DEFAULT` means the policy is set but member orgs may mutate it. `ENFORCE` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. - enum: - - DEFAULT - - ENFORCE - - DELEGATE - example: DEFAULT - type: string - x-enum-varnames: - - DEFAULT - - ENFORCE - - DELEGATE OrgGroupPolicyListResponse: description: Response containing a list of org group policies. properties: @@ -51823,7 +51941,7 @@ components: type: string org_site: description: The site of the organization that has the override. - example: "us1" + example: "datadoghq.com" type: string org_uuid: description: The UUID of the organization that has the override. @@ -51841,7 +51959,7 @@ components: properties: org_site: description: The site of the organization. - example: "us1" + example: "datadoghq.com" type: string org_uuid: description: The UUID of the organization to grant the override. @@ -51957,12 +52075,11 @@ components: x-enum-varnames: - ORG_GROUP_POLICY_OVERRIDES OrgGroupPolicyOverrideUpdateAttributes: - description: >- - Attributes for updating a policy override. The `org_uuid` and `org_site` fields must match the existing override and cannot be changed. + description: Attributes for updating a policy override. properties: org_site: description: The site of the organization. - example: "us1" + example: "datadoghq.com" type: string org_uuid: description: The UUID of the organization. @@ -51998,16 +52115,6 @@ components: required: - data type: object - OrgGroupPolicyPolicyType: - default: org_config - description: >- - The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. - enum: - - org_config - example: org_config - type: string - x-enum-varnames: - - ORG_CONFIG OrgGroupPolicyRelationshipToOne: description: Relationship to a single org group policy. properties: @@ -52076,8 +52183,6 @@ components: example: value: "UTC" type: object - enforcement_tier: - $ref: "#/components/schemas/OrgGroupPolicyEnforcementTier" type: object OrgGroupPolicyUpdateData: description: Data for updating an org group policy. @@ -52198,6 +52303,27 @@ components: required: - data type: object + OrgRelationshipData: + description: Reference to an organization resource. + properties: + id: + description: The UUID of the organization. + example: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + format: uuid + type: string + type: + $ref: "#/components/schemas/OrgResourceType" + required: + - id + - type + type: object + OrgResourceType: + description: The resource type for organizations. + enum: [orgs] + example: "orgs" + type: string + x-enum-varnames: + - ORGS Organization: description: Organization object. properties: @@ -53442,6 +53568,11 @@ components: PersonalAccessTokenAttributes: description: Attributes of a personal access token. properties: + alias: + description: The alias (short identifier) of the personal access token. + example: "2H9MCNMBM8FQjQ16YucXkX" + readOnly: true + type: string created_at: description: Creation date of the personal access token. example: "2024-01-01T00:00:00+00:00" @@ -77987,10 +78118,6 @@ components: description: Title of the user. nullable: true type: string - uuid: - description: UUID of the user. - readOnly: true - type: string verified: description: Whether the user is verified. type: boolean @@ -108027,6 +108154,83 @@ paths: operator: OR permissions: - on_call_read + /api/v2/org: + get: + description: Returns the current organization and its managed organizations in JSON:API format. + operationId: ListOrgs + parameters: + - description: Filter managed organizations by name. + example: "My Child Org" + in: query + name: "filter[name]" + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + id: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + relationships: + current_org: + data: + id: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + type: "orgs" + managed_orgs: + data: + - id: "a1b2c3d4-00cc-11ea-a77b-570c9d03c6c5" + type: "orgs" + type: "managed_orgs" + included: + - attributes: + created_at: "2019-09-26T17:28:28Z" + description: "Production organization." + disabled: false + modified_at: "2024-01-15T10:30:00Z" + name: "My Organization" + public_id: "abcdef12345" + sharing: "none" + url: "https://app.datadoghq.com/account/my-org" + id: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + type: "orgs" + - attributes: + created_at: "2020-05-10T12:00:00Z" + description: "Child organization." + disabled: false + modified_at: "2024-06-20T08:15:00Z" + name: "My Child Org" + public_id: "ghijkl67890" + sharing: "none" + url: "https://app.datadoghq.com/account/my-child-org" + id: "a1b2c3d4-00cc-11ea-a77b-570c9d03c6c5" + type: "orgs" + schema: + $ref: "#/components/schemas/ManagedOrgsResponse" + description: OK + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + - org_connections_write + summary: List your managed organizations + tags: + - Organizations + "x-permission": + operator: OR + permissions: + - org_management + - org_connections_write /api/v2/org_configs: get: description: Returns all Org Configs (name, description, and value). @@ -108315,7 +108519,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" org_name: "Acme Corp" - org_site: "us1" + org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "f1e2d3c4-b5a6-7890-1234-567890abcdef" relationships: @@ -108373,7 +108577,7 @@ paths: data: attributes: orgs: - - org_site: "us1" + - org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" relationships: source_org_group: @@ -108400,7 +108604,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-16T14:00:00Z" org_name: "Acme Corp" - org_site: "us1" + org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "f1e2d3c4-b5a6-7890-1234-567890abcdef" relationships: @@ -108465,7 +108669,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" org_name: "Acme Corp" - org_site: "us1" + org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "f1e2d3c4-b5a6-7890-1234-567890abcdef" relationships: @@ -108546,7 +108750,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-16T14:00:00Z" org_name: "Acme Corp" - org_site: "us1" + org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "f1e2d3c4-b5a6-7890-1234-567890abcdef" relationships: @@ -108614,10 +108818,9 @@ paths: - attributes: content: value: "UTC" - enforcement_tier: "DEFAULT" + enforced_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" policy_name: "monitor_timezone" - policy_type: "org_config" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" relationships: org_group: @@ -108673,9 +108876,7 @@ paths: attributes: content: value: "UTC" - enforcement_tier: "DEFAULT" policy_name: "monitor_timezone" - policy_type: "org_config" relationships: org_group: data: @@ -108696,10 +108897,9 @@ paths: attributes: content: value: "UTC" - enforcement_tier: "DEFAULT" + enforced_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" policy_name: "monitor_timezone" - policy_type: "org_config" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" relationships: org_group: @@ -108789,73 +108989,8 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - get: - description: Get a specific organization group policy by its ID. - operationId: GetOrgGroupPolicy - parameters: - - $ref: "#/components/parameters/OrgGroupPolicyId" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - content: - value: "UTC" - enforcement_tier: "DEFAULT" - modified_at: "2024-01-15T10:30:00Z" - policy_name: "monitor_timezone" - policy_type: "org_config" - id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" - relationships: - org_group: - data: - id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" - type: org_groups - type: org_group_policies - schema: - $ref: "#/components/schemas/OrgGroupPolicyResponse" - description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "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 an org group policy - tags: [Org Groups] - "x-permission": - operator: OR - permissions: - - org_group_read - x-unstable: |- - **Note**: This endpoint is in Preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). patch: - description: Update an existing organization group policy. + description: Update the content of an existing organization group policy. operationId: UpdateOrgGroupPolicy parameters: - $ref: "#/components/parameters/OrgGroupPolicyId" @@ -108869,7 +109004,6 @@ paths: attributes: content: value: "US/Eastern" - enforcement_tier: "ENFORCE" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" type: org_group_policies schema: @@ -108886,10 +109020,9 @@ paths: attributes: content: value: "US/Eastern" - enforcement_tier: "ENFORCE" + enforced_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-16T14:00:00Z" policy_name: "monitor_timezone" - policy_type: "org_config" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" relationships: org_group: @@ -109003,7 +109136,7 @@ paths: - attributes: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" - org_site: "us1" + org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" relationships: @@ -109062,7 +109195,7 @@ paths: value: data: attributes: - org_site: "us1" + org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" relationships: org_group: @@ -109088,7 +109221,7 @@ paths: attributes: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" - org_site: "us1" + org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" relationships: @@ -109183,73 +109316,6 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - get: - description: Get a specific organization group policy override by its ID. - operationId: GetOrgGroupPolicyOverride - parameters: - - $ref: "#/components/parameters/OrgGroupPolicyOverrideId" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - created_at: "2024-01-15T10:30:00Z" - modified_at: "2024-01-15T10:30:00Z" - org_site: "us1" - org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" - id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" - relationships: - org_group: - data: - id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" - type: org_groups - org_group_policy: - data: - id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" - type: org_group_policies - type: org_group_policy_overrides - schema: - $ref: "#/components/schemas/OrgGroupPolicyOverrideResponse" - description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "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 an org group policy override - tags: [Org Groups] - "x-permission": - operator: OR - permissions: - - org_group_read - x-unstable: |- - **Note**: This endpoint is in Preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). patch: description: Update an existing organization group policy override. operationId: UpdateOrgGroupPolicyOverride @@ -109263,7 +109329,7 @@ paths: value: data: attributes: - org_site: "us1" + org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" type: org_group_policy_overrides @@ -109281,7 +109347,7 @@ paths: attributes: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-16T14:00:00Z" - org_site: "us1" + org_site: "datadoghq.com" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" relationships: @@ -109353,7 +109419,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" name: "My Org Group" - owner_org_site: "us1" + owner_org_site: "datadoghq.com" owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups @@ -109420,7 +109486,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" name: "My Org Group" - owner_org_site: "us1" + owner_org_site: "datadoghq.com" owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups @@ -109523,7 +109589,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" name: "My Org Group" - owner_org_site: "us1" + owner_org_site: "datadoghq.com" owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups @@ -109596,7 +109662,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-16T14:00:00Z" name: "Updated Org Group Name" - owner_org_site: "us1" + owner_org_site: "datadoghq.com" owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups @@ -109764,7 +109830,7 @@ paths: operator: OR permissions: - user_app_keys - /api/v2/personal_access_tokens/{pat_id}: + /api/v2/personal_access_tokens/{pat_uuid}: delete: description: Revoke a specific personal access token. operationId: RevokePersonalAccessToken @@ -121343,7 +121409,7 @@ paths: operator: OR permissions: - service_account_write - /api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}: + /api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}: delete: description: Revoke a specific access token for a service account. operationId: RevokeServiceAccountAccessToken @@ -129399,6 +129465,50 @@ paths: permissions: - user_access_manage - service_account_write + /api/v2/users/{user_id}/invitations: + delete: + description: |- + Cancel all pending invitations for a specified user. + Requires the `user_access_invite` permission. + operationId: DeleteUserInvitations + parameters: + - description: The UUID of the user whose pending invitations should be canceled. + in: path + name: user_id + required: true + schema: + example: "4dee724d-00cc-11ea-a77b-570c9d03c6c5" + format: uuid + type: string + responses: + "200": + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_invite + summary: Delete a pending user's invitations + tags: + - Users + "x-permission": + operator: OR + permissions: + - user_access_invite /api/v2/users/{user_id}/orgs: get: description: |- diff --git a/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.java b/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.java index 7f873ad5dc0..2fe8696448f 100644 --- a/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.java +++ b/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.java @@ -31,7 +31,7 @@ public static void main(String[] args) { .orgs( Collections.singletonList( new GlobalOrgIdentifier() - .orgSite("us1") + .orgSite("datadoghq.com") .orgUuid( UUID.fromString( "c3d4e5f6-a7b8-9012-cdef-012345678901"))))) diff --git a/examples/v2/org-groups/CreateOrgGroupPolicy.java b/examples/v2/org-groups/CreateOrgGroupPolicy.java index 2520e6e84e7..2550c0b516a 100644 --- a/examples/v2/org-groups/CreateOrgGroupPolicy.java +++ b/examples/v2/org-groups/CreateOrgGroupPolicy.java @@ -7,8 +7,6 @@ import com.datadog.api.client.v2.model.OrgGroupPolicyCreateData; import com.datadog.api.client.v2.model.OrgGroupPolicyCreateRelationships; import com.datadog.api.client.v2.model.OrgGroupPolicyCreateRequest; -import com.datadog.api.client.v2.model.OrgGroupPolicyEnforcementTier; -import com.datadog.api.client.v2.model.OrgGroupPolicyPolicyType; import com.datadog.api.client.v2.model.OrgGroupPolicyResponse; import com.datadog.api.client.v2.model.OrgGroupPolicyType; import com.datadog.api.client.v2.model.OrgGroupRelationshipToOne; @@ -30,9 +28,7 @@ public static void main(String[] args) { .attributes( new OrgGroupPolicyCreateAttributes() .content(Map.ofEntries(Map.entry("value", "UTC"))) - .enforcementTier(OrgGroupPolicyEnforcementTier.DEFAULT) - .policyName("monitor_timezone") - .policyType(OrgGroupPolicyPolicyType.ORG_CONFIG)) + .policyName("monitor_timezone")) .relationships( new OrgGroupPolicyCreateRelationships() .orgGroup( diff --git a/examples/v2/org-groups/CreateOrgGroupPolicyOverride.java b/examples/v2/org-groups/CreateOrgGroupPolicyOverride.java index 10ffeedc2dd..7feb4026590 100644 --- a/examples/v2/org-groups/CreateOrgGroupPolicyOverride.java +++ b/examples/v2/org-groups/CreateOrgGroupPolicyOverride.java @@ -29,7 +29,7 @@ public static void main(String[] args) { new OrgGroupPolicyOverrideCreateData() .attributes( new OrgGroupPolicyOverrideCreateAttributes() - .orgSite("us1") + .orgSite("datadoghq.com") .orgUuid(UUID.fromString("c3d4e5f6-a7b8-9012-cdef-012345678901"))) .relationships( new OrgGroupPolicyOverrideCreateRelationships() diff --git a/examples/v2/org-groups/GetOrgGroupPolicy.java b/examples/v2/org-groups/GetOrgGroupPolicy.java deleted file mode 100644 index 5c405fc2f6c..00000000000 --- a/examples/v2/org-groups/GetOrgGroupPolicy.java +++ /dev/null @@ -1,27 +0,0 @@ -// Get an org group policy returns "OK" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.OrgGroupsApi; -import com.datadog.api.client.v2.model.OrgGroupPolicyResponse; -import java.util.UUID; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.getOrgGroupPolicy", true); - OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient); - - try { - OrgGroupPolicyResponse result = - apiInstance.getOrgGroupPolicy(UUID.fromString("1a2b3c4d-5e6f-7890-abcd-ef0123456789")); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrgGroupsApi#getOrgGroupPolicy"); - 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/org-groups/GetOrgGroupPolicyOverride.java b/examples/v2/org-groups/GetOrgGroupPolicyOverride.java deleted file mode 100644 index 6989093b49e..00000000000 --- a/examples/v2/org-groups/GetOrgGroupPolicyOverride.java +++ /dev/null @@ -1,28 +0,0 @@ -// Get an org group policy override returns "OK" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.OrgGroupsApi; -import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideResponse; -import java.util.UUID; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.getOrgGroupPolicyOverride", true); - OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient); - - try { - OrgGroupPolicyOverrideResponse result = - apiInstance.getOrgGroupPolicyOverride( - UUID.fromString("9f8e7d6c-5b4a-3210-fedc-ba0987654321")); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling OrgGroupsApi#getOrgGroupPolicyOverride"); - 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/org-groups/UpdateOrgGroupPolicy.java b/examples/v2/org-groups/UpdateOrgGroupPolicy.java index e71c05b963e..a21e4b34543 100644 --- a/examples/v2/org-groups/UpdateOrgGroupPolicy.java +++ b/examples/v2/org-groups/UpdateOrgGroupPolicy.java @@ -3,7 +3,6 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.OrgGroupsApi; -import com.datadog.api.client.v2.model.OrgGroupPolicyEnforcementTier; import com.datadog.api.client.v2.model.OrgGroupPolicyResponse; import com.datadog.api.client.v2.model.OrgGroupPolicyType; import com.datadog.api.client.v2.model.OrgGroupPolicyUpdateAttributes; @@ -24,8 +23,7 @@ public static void main(String[] args) { new OrgGroupPolicyUpdateData() .attributes( new OrgGroupPolicyUpdateAttributes() - .content(Map.ofEntries(Map.entry("value", "UTC"))) - .enforcementTier(OrgGroupPolicyEnforcementTier.DEFAULT)) + .content(Map.ofEntries(Map.entry("value", "UTC")))) .id(UUID.fromString("1a2b3c4d-5e6f-7890-abcd-ef0123456789")) .type(OrgGroupPolicyType.ORG_GROUP_POLICIES)); diff --git a/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.java b/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.java index 1b29b6ff01a..1f553b641e5 100644 --- a/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.java +++ b/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.java @@ -22,7 +22,7 @@ public static void main(String[] args) { new OrgGroupPolicyOverrideUpdateData() .attributes( new OrgGroupPolicyOverrideUpdateAttributes() - .orgSite("us1") + .orgSite("datadoghq.com") .orgUuid(UUID.fromString("c3d4e5f6-a7b8-9012-cdef-012345678901"))) .id(UUID.fromString("9f8e7d6c-5b4a-3210-fedc-ba0987654321")) .type(OrgGroupPolicyOverrideType.ORG_GROUP_POLICY_OVERRIDES)); diff --git a/examples/v2/organizations/ListOrgs.java b/examples/v2/organizations/ListOrgs.java new file mode 100644 index 00000000000..27a9c735d19 --- /dev/null +++ b/examples/v2/organizations/ListOrgs.java @@ -0,0 +1,24 @@ +// List your managed organizations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OrganizationsApi; +import com.datadog.api.client.v2.model.ManagedOrgsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + OrganizationsApi apiInstance = new OrganizationsApi(defaultClient); + + try { + ManagedOrgsResponse result = apiInstance.listOrgs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationsApi#listOrgs"); + 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/users/DeleteUserInvitations.java b/examples/v2/users/DeleteUserInvitations.java new file mode 100644 index 00000000000..33ca7b2bc13 --- /dev/null +++ b/examples/v2/users/DeleteUserInvitations.java @@ -0,0 +1,23 @@ +// Delete a pending user's invitations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.UsersApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + UsersApi apiInstance = new UsersApi(defaultClient); + + try { + apiInstance.deleteUserInvitations(UUID.fromString("4dee724d-00cc-11ea-a77b-570c9d03c6c5")); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#deleteUserInvitations"); + 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 d903d232150..661be57e8db 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -975,8 +975,6 @@ public class ApiClient { put("v2.deleteOrgGroupPolicyOverride", false); put("v2.getOrgGroup", false); put("v2.getOrgGroupMembership", false); - put("v2.getOrgGroupPolicy", false); - put("v2.getOrgGroupPolicyOverride", false); put("v2.listOrgGroupMemberships", false); put("v2.listOrgGroupPolicies", false); put("v2.listOrgGroupPolicyConfigs", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/KeyManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/KeyManagementApi.java index 56de4559fd1..1db4055410e 100644 --- a/src/main/java/com/datadog/api/client/v2/api/KeyManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/KeyManagementApi.java @@ -1402,12 +1402,12 @@ public ApiResponse getCurrentUserApplicationKeyWithHttpI * *

See {@link #getPersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return PersonalAccessTokenResponse * @throws ApiException if fails to make API call */ - public PersonalAccessTokenResponse getPersonalAccessToken(String patId) throws ApiException { - return getPersonalAccessTokenWithHttpInfo(patId).getData(); + public PersonalAccessTokenResponse getPersonalAccessToken(String patUuid) throws ApiException { + return getPersonalAccessTokenWithHttpInfo(patUuid).getData(); } /** @@ -1415,11 +1415,12 @@ public PersonalAccessTokenResponse getPersonalAccessToken(String patId) throws A * *

See {@link #getPersonalAccessTokenWithHttpInfoAsync}. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return CompletableFuture<PersonalAccessTokenResponse> */ - public CompletableFuture getPersonalAccessTokenAsync(String patId) { - return getPersonalAccessTokenWithHttpInfoAsync(patId) + public CompletableFuture getPersonalAccessTokenAsync( + String patUuid) { + return getPersonalAccessTokenWithHttpInfoAsync(patUuid) .thenApply( response -> { return response.getData(); @@ -1429,7 +1430,7 @@ public CompletableFuture getPersonalAccessTokenAsyn /** * Get a specific personal access token by its UUID. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return ApiResponse<PersonalAccessTokenResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -1442,19 +1443,19 @@ public CompletableFuture getPersonalAccessTokenAsyn * 429 Too many requests - * */ - public ApiResponse getPersonalAccessTokenWithHttpInfo(String patId) + public ApiResponse getPersonalAccessTokenWithHttpInfo(String patUuid) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { throw new ApiException( - 400, "Missing the required parameter 'patId' when calling getPersonalAccessToken"); + 400, "Missing the required parameter 'patUuid' when calling getPersonalAccessToken"); } // create path and map variables String localVarPath = - "/api/v2/personal_access_tokens/{pat_id}" - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + "/api/v2/personal_access_tokens/{pat_uuid}" + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -1483,26 +1484,26 @@ public ApiResponse getPersonalAccessTokenWithHttpIn * *

See {@link #getPersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return CompletableFuture<ApiResponse<PersonalAccessTokenResponse>> */ public CompletableFuture> - getPersonalAccessTokenWithHttpInfoAsync(String patId) { + getPersonalAccessTokenWithHttpInfoAsync(String patUuid) { Object localVarPostBody = null; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'patId' when calling getPersonalAccessToken")); + 400, "Missing the required parameter 'patUuid' when calling getPersonalAccessToken")); return result; } // create path and map variables String localVarPath = - "/api/v2/personal_access_tokens/{pat_id}" - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + "/api/v2/personal_access_tokens/{pat_uuid}" + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -2694,11 +2695,11 @@ public ApiResponse listPersonalAccessTokensWit * *

See {@link #revokePersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @throws ApiException if fails to make API call */ - public void revokePersonalAccessToken(String patId) throws ApiException { - revokePersonalAccessTokenWithHttpInfo(patId); + public void revokePersonalAccessToken(String patUuid) throws ApiException { + revokePersonalAccessTokenWithHttpInfo(patUuid); } /** @@ -2706,11 +2707,11 @@ public void revokePersonalAccessToken(String patId) throws ApiException { * *

See {@link #revokePersonalAccessTokenWithHttpInfoAsync}. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return CompletableFuture */ - public CompletableFuture revokePersonalAccessTokenAsync(String patId) { - return revokePersonalAccessTokenWithHttpInfoAsync(patId) + public CompletableFuture revokePersonalAccessTokenAsync(String patUuid) { + return revokePersonalAccessTokenWithHttpInfoAsync(patUuid) .thenApply( response -> { return response.getData(); @@ -2720,7 +2721,7 @@ public CompletableFuture revokePersonalAccessTokenAsync(String patId) { /** * Revoke a specific personal access token. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -2733,18 +2734,19 @@ public CompletableFuture revokePersonalAccessTokenAsync(String patId) { * 429 Too many requests - * */ - public ApiResponse revokePersonalAccessTokenWithHttpInfo(String patId) throws ApiException { + public ApiResponse revokePersonalAccessTokenWithHttpInfo(String patUuid) + throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { throw new ApiException( - 400, "Missing the required parameter 'patId' when calling revokePersonalAccessToken"); + 400, "Missing the required parameter 'patUuid' when calling revokePersonalAccessToken"); } // create path and map variables String localVarPath = - "/api/v2/personal_access_tokens/{pat_id}" - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + "/api/v2/personal_access_tokens/{pat_uuid}" + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -2773,26 +2775,26 @@ public ApiResponse revokePersonalAccessTokenWithHttpInfo(String patId) thr * *

See {@link #revokePersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return CompletableFuture<ApiResponse<Void>> */ public CompletableFuture> revokePersonalAccessTokenWithHttpInfoAsync( - String patId) { + String patUuid) { Object localVarPostBody = null; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling revokePersonalAccessToken")); + "Missing the required parameter 'patUuid' when calling revokePersonalAccessToken")); return result; } // create path and map variables String localVarPath = - "/api/v2/personal_access_tokens/{pat_id}" - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + "/api/v2/personal_access_tokens/{pat_uuid}" + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -3308,14 +3310,14 @@ public ApiResponse updateCurrentUserApplicationKeyWithHt * *

See {@link #updatePersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @param body (required) * @return PersonalAccessTokenResponse * @throws ApiException if fails to make API call */ public PersonalAccessTokenResponse updatePersonalAccessToken( - String patId, PersonalAccessTokenUpdateRequest body) throws ApiException { - return updatePersonalAccessTokenWithHttpInfo(patId, body).getData(); + String patUuid, PersonalAccessTokenUpdateRequest body) throws ApiException { + return updatePersonalAccessTokenWithHttpInfo(patUuid, body).getData(); } /** @@ -3323,13 +3325,13 @@ public PersonalAccessTokenResponse updatePersonalAccessToken( * *

See {@link #updatePersonalAccessTokenWithHttpInfoAsync}. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @param body (required) * @return CompletableFuture<PersonalAccessTokenResponse> */ public CompletableFuture updatePersonalAccessTokenAsync( - String patId, PersonalAccessTokenUpdateRequest body) { - return updatePersonalAccessTokenWithHttpInfoAsync(patId, body) + String patUuid, PersonalAccessTokenUpdateRequest body) { + return updatePersonalAccessTokenWithHttpInfoAsync(patUuid, body) .thenApply( response -> { return response.getData(); @@ -3339,7 +3341,7 @@ public CompletableFuture updatePersonalAccessTokenA /** * Update a specific personal access token. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @param body (required) * @return ApiResponse<PersonalAccessTokenResponse> * @throws ApiException if fails to make API call @@ -3355,13 +3357,13 @@ public CompletableFuture updatePersonalAccessTokenA * */ public ApiResponse updatePersonalAccessTokenWithHttpInfo( - String patId, PersonalAccessTokenUpdateRequest body) throws ApiException { + String patUuid, PersonalAccessTokenUpdateRequest body) throws ApiException { Object localVarPostBody = body; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { throw new ApiException( - 400, "Missing the required parameter 'patId' when calling updatePersonalAccessToken"); + 400, "Missing the required parameter 'patUuid' when calling updatePersonalAccessToken"); } // verify the required parameter 'body' is set @@ -3371,8 +3373,8 @@ public ApiResponse updatePersonalAccessTokenWithHtt } // create path and map variables String localVarPath = - "/api/v2/personal_access_tokens/{pat_id}" - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + "/api/v2/personal_access_tokens/{pat_uuid}" + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -3401,23 +3403,23 @@ public ApiResponse updatePersonalAccessTokenWithHtt * *

See {@link #updatePersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @param body (required) * @return CompletableFuture<ApiResponse<PersonalAccessTokenResponse>> */ public CompletableFuture> updatePersonalAccessTokenWithHttpInfoAsync( - String patId, PersonalAccessTokenUpdateRequest body) { + String patUuid, PersonalAccessTokenUpdateRequest body) { Object localVarPostBody = body; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling updatePersonalAccessToken")); + "Missing the required parameter 'patUuid' when calling updatePersonalAccessToken")); return result; } @@ -3432,8 +3434,8 @@ public ApiResponse updatePersonalAccessTokenWithHtt } // create path and map variables String localVarPath = - "/api/v2/personal_access_tokens/{pat_id}" - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + "/api/v2/personal_access_tokens/{pat_uuid}" + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); diff --git a/src/main/java/com/datadog/api/client/v2/api/OrgGroupsApi.java b/src/main/java/com/datadog/api/client/v2/api/OrgGroupsApi.java index 3c0f5b30a56..f834931d079 100644 --- a/src/main/java/com/datadog/api/client/v2/api/OrgGroupsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/OrgGroupsApi.java @@ -1475,332 +1475,6 @@ public ApiResponse getOrgGroupMembershipWithHttpInfo new GenericType() {}); } - /** - * Get an org group policy. - * - *

See {@link #getOrgGroupPolicyWithHttpInfo}. - * - * @param orgGroupPolicyId The ID of the org group policy. (required) - * @return OrgGroupPolicyResponse - * @throws ApiException if fails to make API call - */ - public OrgGroupPolicyResponse getOrgGroupPolicy(UUID orgGroupPolicyId) throws ApiException { - return getOrgGroupPolicyWithHttpInfo(orgGroupPolicyId).getData(); - } - - /** - * Get an org group policy. - * - *

See {@link #getOrgGroupPolicyWithHttpInfoAsync}. - * - * @param orgGroupPolicyId The ID of the org group policy. (required) - * @return CompletableFuture<OrgGroupPolicyResponse> - */ - public CompletableFuture getOrgGroupPolicyAsync(UUID orgGroupPolicyId) { - return getOrgGroupPolicyWithHttpInfoAsync(orgGroupPolicyId) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Get a specific organization group policy by its ID. - * - * @param orgGroupPolicyId The ID of the org group policy. (required) - * @return ApiResponse<OrgGroupPolicyResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
- */ - public ApiResponse getOrgGroupPolicyWithHttpInfo(UUID orgGroupPolicyId) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "getOrgGroupPolicy"; - 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 'orgGroupPolicyId' is set - if (orgGroupPolicyId == null) { - throw new ApiException( - 400, "Missing the required parameter 'orgGroupPolicyId' when calling getOrgGroupPolicy"); - } - // create path and map variables - String localVarPath = - "/api/v2/org_group_policies/{org_group_policy_id}" - .replaceAll( - "\\{" + "org_group_policy_id" + "\\}", - apiClient.escapeString(orgGroupPolicyId.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.OrgGroupsApi.getOrgGroupPolicy", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Get an org group policy. - * - *

See {@link #getOrgGroupPolicyWithHttpInfo}. - * - * @param orgGroupPolicyId The ID of the org group policy. (required) - * @return CompletableFuture<ApiResponse<OrgGroupPolicyResponse>> - */ - public CompletableFuture> getOrgGroupPolicyWithHttpInfoAsync( - UUID orgGroupPolicyId) { - // Check if unstable operation is enabled - String operationId = "getOrgGroupPolicy"; - 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 'orgGroupPolicyId' is set - if (orgGroupPolicyId == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'orgGroupPolicyId' when calling getOrgGroupPolicy")); - return result; - } - // create path and map variables - String localVarPath = - "/api/v2/org_group_policies/{org_group_policy_id}" - .replaceAll( - "\\{" + "org_group_policy_id" + "\\}", - apiClient.escapeString(orgGroupPolicyId.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.OrgGroupsApi.getOrgGroupPolicy", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; - } - return apiClient.invokeAPIAsync( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Get an org group policy override. - * - *

See {@link #getOrgGroupPolicyOverrideWithHttpInfo}. - * - * @param orgGroupPolicyOverrideId The ID of the org group policy override. (required) - * @return OrgGroupPolicyOverrideResponse - * @throws ApiException if fails to make API call - */ - public OrgGroupPolicyOverrideResponse getOrgGroupPolicyOverride(UUID orgGroupPolicyOverrideId) - throws ApiException { - return getOrgGroupPolicyOverrideWithHttpInfo(orgGroupPolicyOverrideId).getData(); - } - - /** - * Get an org group policy override. - * - *

See {@link #getOrgGroupPolicyOverrideWithHttpInfoAsync}. - * - * @param orgGroupPolicyOverrideId The ID of the org group policy override. (required) - * @return CompletableFuture<OrgGroupPolicyOverrideResponse> - */ - public CompletableFuture getOrgGroupPolicyOverrideAsync( - UUID orgGroupPolicyOverrideId) { - return getOrgGroupPolicyOverrideWithHttpInfoAsync(orgGroupPolicyOverrideId) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Get a specific organization group policy override by its ID. - * - * @param orgGroupPolicyOverrideId The ID of the org group policy override. (required) - * @return ApiResponse<OrgGroupPolicyOverrideResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
- */ - public ApiResponse getOrgGroupPolicyOverrideWithHttpInfo( - UUID orgGroupPolicyOverrideId) throws ApiException { - // Check if unstable operation is enabled - String operationId = "getOrgGroupPolicyOverride"; - 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 'orgGroupPolicyOverrideId' is set - if (orgGroupPolicyOverrideId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'orgGroupPolicyOverrideId' when calling" - + " getOrgGroupPolicyOverride"); - } - // create path and map variables - String localVarPath = - "/api/v2/org_group_policy_overrides/{org_group_policy_override_id}" - .replaceAll( - "\\{" + "org_group_policy_override_id" + "\\}", - apiClient.escapeString(orgGroupPolicyOverrideId.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.OrgGroupsApi.getOrgGroupPolicyOverride", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Get an org group policy override. - * - *

See {@link #getOrgGroupPolicyOverrideWithHttpInfo}. - * - * @param orgGroupPolicyOverrideId The ID of the org group policy override. (required) - * @return CompletableFuture<ApiResponse<OrgGroupPolicyOverrideResponse>> - */ - public CompletableFuture> - getOrgGroupPolicyOverrideWithHttpInfoAsync(UUID orgGroupPolicyOverrideId) { - // Check if unstable operation is enabled - String operationId = "getOrgGroupPolicyOverride"; - 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 'orgGroupPolicyOverrideId' is set - if (orgGroupPolicyOverrideId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'orgGroupPolicyOverrideId' when calling" - + " getOrgGroupPolicyOverride")); - return result; - } - // create path and map variables - String localVarPath = - "/api/v2/org_group_policy_overrides/{org_group_policy_override_id}" - .replaceAll( - "\\{" + "org_group_policy_override_id" + "\\}", - apiClient.escapeString(orgGroupPolicyOverrideId.toString())); - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.OrgGroupsApi.getOrgGroupPolicyOverride", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; - } - return apiClient.invokeAPIAsync( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - /** Manage optional parameters to listOrgGroupMemberships. */ public static class ListOrgGroupMembershipsOptionalParameters { private UUID filterOrgGroupId; @@ -3380,7 +3054,7 @@ public CompletableFuture updateOrgGroupPolicyAsync( } /** - * Update an existing organization group policy. + * Update the content of an existing organization group policy. * * @param orgGroupPolicyId The ID of the org group policy. (required) * @param body (required) diff --git a/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java b/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java index 4300bee6882..5580fbb74ce 100644 --- a/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java @@ -4,6 +4,7 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.ManagedOrgsResponse; import com.datadog.api.client.v2.model.OrgConfigGetResponse; import com.datadog.api.client.v2.model.OrgConfigListResponse; import com.datadog.api.client.v2.model.OrgConfigWriteRequest; @@ -12,6 +13,7 @@ import java.io.File; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; @@ -298,6 +300,174 @@ public CompletableFuture> listOrgConfigsWithH new GenericType() {}); } + /** Manage optional parameters to listOrgs. */ + public static class ListOrgsOptionalParameters { + private String filterName; + + /** + * Set filterName. + * + * @param filterName Filter managed organizations by name. (optional) + * @return ListOrgsOptionalParameters + */ + public ListOrgsOptionalParameters filterName(String filterName) { + this.filterName = filterName; + return this; + } + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfo}. + * + * @return ManagedOrgsResponse + * @throws ApiException if fails to make API call + */ + public ManagedOrgsResponse listOrgs() throws ApiException { + return listOrgsWithHttpInfo(new ListOrgsOptionalParameters()).getData(); + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfoAsync}. + * + * @return CompletableFuture<ManagedOrgsResponse> + */ + public CompletableFuture listOrgsAsync() { + return listOrgsWithHttpInfoAsync(new ListOrgsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ManagedOrgsResponse + * @throws ApiException if fails to make API call + */ + public ManagedOrgsResponse listOrgs(ListOrgsOptionalParameters parameters) throws ApiException { + return listOrgsWithHttpInfo(parameters).getData(); + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ManagedOrgsResponse> + */ + public CompletableFuture listOrgsAsync( + ListOrgsOptionalParameters parameters) { + return listOrgsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns the current organization and its managed organizations in JSON:API format. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ManagedOrgsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listOrgsWithHttpInfo( + ListOrgsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + String filterName = parameters.filterName; + // create path and map variables + String localVarPath = "/api/v2/org"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OrganizationsApi.listOrgs", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List your managed organizations. + * + *

See {@link #listOrgsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ManagedOrgsResponse>> + */ + public CompletableFuture> listOrgsWithHttpInfoAsync( + ListOrgsOptionalParameters parameters) { + Object localVarPostBody = null; + String filterName = parameters.filterName; + // create path and map variables + String localVarPath = "/api/v2/org"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OrganizationsApi.listOrgs", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update a specific Org Config. * diff --git a/src/main/java/com/datadog/api/client/v2/api/ServiceAccountsApi.java b/src/main/java/com/datadog/api/client/v2/api/ServiceAccountsApi.java index 51d74b62f06..bf9dd0283b1 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ServiceAccountsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ServiceAccountsApi.java @@ -704,13 +704,13 @@ public CompletableFuture> deleteServiceAccountApplicationKeyWi *

See {@link #getServiceAccountAccessTokenWithHttpInfo}. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return PersonalAccessTokenResponse * @throws ApiException if fails to make API call */ public PersonalAccessTokenResponse getServiceAccountAccessToken( - String serviceAccountId, String patId) throws ApiException { - return getServiceAccountAccessTokenWithHttpInfo(serviceAccountId, patId).getData(); + String serviceAccountId, String patUuid) throws ApiException { + return getServiceAccountAccessTokenWithHttpInfo(serviceAccountId, patUuid).getData(); } /** @@ -719,12 +719,12 @@ public PersonalAccessTokenResponse getServiceAccountAccessToken( *

See {@link #getServiceAccountAccessTokenWithHttpInfoAsync}. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return CompletableFuture<PersonalAccessTokenResponse> */ public CompletableFuture getServiceAccountAccessTokenAsync( - String serviceAccountId, String patId) { - return getServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, patId) + String serviceAccountId, String patUuid) { + return getServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, patUuid) .thenApply( response -> { return response.getData(); @@ -735,7 +735,7 @@ public CompletableFuture getServiceAccountAccessTok * Get a specific access token for a service account by its UUID. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return ApiResponse<PersonalAccessTokenResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -749,7 +749,7 @@ public CompletableFuture getServiceAccountAccessTok * */ public ApiResponse getServiceAccountAccessTokenWithHttpInfo( - String serviceAccountId, String patId) throws ApiException { + String serviceAccountId, String patUuid) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'serviceAccountId' is set @@ -760,18 +760,19 @@ public ApiResponse getServiceAccountAccessTokenWith + " getServiceAccountAccessToken"); } - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { throw new ApiException( - 400, "Missing the required parameter 'patId' when calling getServiceAccountAccessToken"); + 400, + "Missing the required parameter 'patUuid' when calling getServiceAccountAccessToken"); } // create path and map variables String localVarPath = - "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}" + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -801,11 +802,11 @@ public ApiResponse getServiceAccountAccessTokenWith *

See {@link #getServiceAccountAccessTokenWithHttpInfo}. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return CompletableFuture<ApiResponse<PersonalAccessTokenResponse>> */ public CompletableFuture> - getServiceAccountAccessTokenWithHttpInfoAsync(String serviceAccountId, String patId) { + getServiceAccountAccessTokenWithHttpInfoAsync(String serviceAccountId, String patUuid) { Object localVarPostBody = null; // verify the required parameter 'serviceAccountId' is set @@ -820,23 +821,24 @@ public ApiResponse getServiceAccountAccessTokenWith return result; } - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling getServiceAccountAccessToken")); + "Missing the required parameter 'patUuid' when calling" + + " getServiceAccountAccessToken")); return result; } // create path and map variables String localVarPath = - "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}" + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -1614,12 +1616,12 @@ public ApiResponse listServiceAccountApplicationKey *

See {@link #revokeServiceAccountAccessTokenWithHttpInfo}. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @throws ApiException if fails to make API call */ - public void revokeServiceAccountAccessToken(String serviceAccountId, String patId) + public void revokeServiceAccountAccessToken(String serviceAccountId, String patUuid) throws ApiException { - revokeServiceAccountAccessTokenWithHttpInfo(serviceAccountId, patId); + revokeServiceAccountAccessTokenWithHttpInfo(serviceAccountId, patUuid); } /** @@ -1628,12 +1630,12 @@ public void revokeServiceAccountAccessToken(String serviceAccountId, String patI *

See {@link #revokeServiceAccountAccessTokenWithHttpInfoAsync}. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return CompletableFuture */ public CompletableFuture revokeServiceAccountAccessTokenAsync( - String serviceAccountId, String patId) { - return revokeServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, patId) + String serviceAccountId, String patUuid) { + return revokeServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, patUuid) .thenApply( response -> { return response.getData(); @@ -1644,7 +1646,7 @@ public CompletableFuture revokeServiceAccountAccessTokenAsync( * Revoke a specific access token for a service account. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -1658,7 +1660,7 @@ public CompletableFuture revokeServiceAccountAccessTokenAsync( * */ public ApiResponse revokeServiceAccountAccessTokenWithHttpInfo( - String serviceAccountId, String patId) throws ApiException { + String serviceAccountId, String patUuid) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'serviceAccountId' is set @@ -1669,19 +1671,19 @@ public ApiResponse revokeServiceAccountAccessTokenWithHttpInfo( + " revokeServiceAccountAccessToken"); } - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { throw new ApiException( 400, - "Missing the required parameter 'patId' when calling revokeServiceAccountAccessToken"); + "Missing the required parameter 'patUuid' when calling revokeServiceAccountAccessToken"); } // create path and map variables String localVarPath = - "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}" + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -1711,11 +1713,11 @@ public ApiResponse revokeServiceAccountAccessTokenWithHttpInfo( *

See {@link #revokeServiceAccountAccessTokenWithHttpInfo}. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @return CompletableFuture<ApiResponse<Void>> */ public CompletableFuture> revokeServiceAccountAccessTokenWithHttpInfoAsync( - String serviceAccountId, String patId) { + String serviceAccountId, String patUuid) { Object localVarPostBody = null; // verify the required parameter 'serviceAccountId' is set @@ -1729,23 +1731,23 @@ public CompletableFuture> revokeServiceAccountAccessTokenWithH return result; } - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling" + "Missing the required parameter 'patUuid' when calling" + " revokeServiceAccountAccessToken")); return result; } // create path and map variables String localVarPath = - "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}" + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -1782,15 +1784,15 @@ public CompletableFuture> revokeServiceAccountAccessTokenWithH *

See {@link #updateServiceAccountAccessTokenWithHttpInfo}. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @param body (required) * @return PersonalAccessTokenResponse * @throws ApiException if fails to make API call */ public PersonalAccessTokenResponse updateServiceAccountAccessToken( - String serviceAccountId, String patId, PersonalAccessTokenUpdateRequest body) + String serviceAccountId, String patUuid, PersonalAccessTokenUpdateRequest body) throws ApiException { - return updateServiceAccountAccessTokenWithHttpInfo(serviceAccountId, patId, body).getData(); + return updateServiceAccountAccessTokenWithHttpInfo(serviceAccountId, patUuid, body).getData(); } /** @@ -1799,13 +1801,13 @@ public PersonalAccessTokenResponse updateServiceAccountAccessToken( *

See {@link #updateServiceAccountAccessTokenWithHttpInfoAsync}. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @param body (required) * @return CompletableFuture<PersonalAccessTokenResponse> */ public CompletableFuture updateServiceAccountAccessTokenAsync( - String serviceAccountId, String patId, PersonalAccessTokenUpdateRequest body) { - return updateServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, patId, body) + String serviceAccountId, String patUuid, PersonalAccessTokenUpdateRequest body) { + return updateServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, patUuid, body) .thenApply( response -> { return response.getData(); @@ -1816,7 +1818,7 @@ public CompletableFuture updateServiceAccountAccess * Update a specific access token for a service account. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @param body (required) * @return ApiResponse<PersonalAccessTokenResponse> * @throws ApiException if fails to make API call @@ -1832,7 +1834,7 @@ public CompletableFuture updateServiceAccountAccess * */ public ApiResponse updateServiceAccountAccessTokenWithHttpInfo( - String serviceAccountId, String patId, PersonalAccessTokenUpdateRequest body) + String serviceAccountId, String patUuid, PersonalAccessTokenUpdateRequest body) throws ApiException { Object localVarPostBody = body; @@ -1844,11 +1846,11 @@ public ApiResponse updateServiceAccountAccessTokenW + " updateServiceAccountAccessToken"); } - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { throw new ApiException( 400, - "Missing the required parameter 'patId' when calling updateServiceAccountAccessToken"); + "Missing the required parameter 'patUuid' when calling updateServiceAccountAccessToken"); } // verify the required parameter 'body' is set @@ -1859,11 +1861,11 @@ public ApiResponse updateServiceAccountAccessTokenW } // create path and map variables String localVarPath = - "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}" + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); @@ -1893,13 +1895,13 @@ public ApiResponse updateServiceAccountAccessTokenW *

See {@link #updateServiceAccountAccessTokenWithHttpInfo}. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) + * @param patUuid The UUID of the personal access token. (required) * @param body (required) * @return CompletableFuture<ApiResponse<PersonalAccessTokenResponse>> */ public CompletableFuture> updateServiceAccountAccessTokenWithHttpInfoAsync( - String serviceAccountId, String patId, PersonalAccessTokenUpdateRequest body) { + String serviceAccountId, String patUuid, PersonalAccessTokenUpdateRequest body) { Object localVarPostBody = body; // verify the required parameter 'serviceAccountId' is set @@ -1914,14 +1916,14 @@ public ApiResponse updateServiceAccountAccessTokenW return result; } - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'patUuid' is set + if (patUuid == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling" + "Missing the required parameter 'patUuid' when calling" + " updateServiceAccountAccessToken")); return result; } @@ -1939,11 +1941,11 @@ public ApiResponse updateServiceAccountAccessTokenW } // create path and map variables String localVarPath = - "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}" + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "pat_uuid" + "\\}", apiClient.escapeString(patUuid.toString())); Map localVarHeaderParams = new HashMap(); diff --git a/src/main/java/com/datadog/api/client/v2/api/UsersApi.java b/src/main/java/com/datadog/api/client/v2/api/UsersApi.java index f348e82138d..27e4a8b31be 100644 --- a/src/main/java/com/datadog/api/client/v2/api/UsersApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/UsersApi.java @@ -22,6 +22,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.concurrent.CompletableFuture; @jakarta.annotation.Generated( @@ -184,6 +185,139 @@ public CompletableFuture> createUserWithHttpInfoAsync( new GenericType() {}); } + /** + * Delete a pending user's invitations. + * + *

See {@link #deleteUserInvitationsWithHttpInfo}. + * + * @param userId The UUID of the user whose pending invitations should be canceled. (required) + * @throws ApiException if fails to make API call + */ + public void deleteUserInvitations(UUID userId) throws ApiException { + deleteUserInvitationsWithHttpInfo(userId); + } + + /** + * Delete a pending user's invitations. + * + *

See {@link #deleteUserInvitationsWithHttpInfoAsync}. + * + * @param userId The UUID of the user whose pending invitations should be canceled. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteUserInvitationsAsync(UUID userId) { + return deleteUserInvitationsWithHttpInfoAsync(userId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Cancel all pending invitations for a specified user. Requires the user_access_invite + * permission. + * + * @param userId The UUID of the user whose pending invitations should be canceled. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse deleteUserInvitationsWithHttpInfo(UUID userId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException( + 400, "Missing the required parameter 'userId' when calling deleteUserInvitations"); + } + // create path and map variables + String localVarPath = + "/api/v2/users/{user_id}/invitations" + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.UsersApi.deleteUserInvitations", + 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 pending user's invitations. + * + *

See {@link #deleteUserInvitationsWithHttpInfo}. + * + * @param userId The UUID of the user whose pending invitations should be canceled. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteUserInvitationsWithHttpInfoAsync(UUID userId) { + Object localVarPostBody = null; + + // verify the required parameter 'userId' is set + if (userId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'userId' when calling deleteUserInvitations")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/users/{user_id}/invitations" + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.UsersApi.deleteUserInvitations", + 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); + } + /** * Disable a user. * diff --git a/src/main/java/com/datadog/api/client/v2/model/FullPersonalAccessTokenAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FullPersonalAccessTokenAttributes.java index f715e51361d..59a9d4e5d07 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FullPersonalAccessTokenAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/FullPersonalAccessTokenAttributes.java @@ -22,6 +22,7 @@ /** Attributes of a full personal access token, including the token key. */ @JsonPropertyOrder({ + FullPersonalAccessTokenAttributes.JSON_PROPERTY_ALIAS, FullPersonalAccessTokenAttributes.JSON_PROPERTY_CREATED_AT, FullPersonalAccessTokenAttributes.JSON_PROPERTY_EXPIRES_AT, FullPersonalAccessTokenAttributes.JSON_PROPERTY_KEY, @@ -33,6 +34,9 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class FullPersonalAccessTokenAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALIAS = "alias"; + private String alias; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; private OffsetDateTime createdAt; @@ -51,6 +55,18 @@ public class FullPersonalAccessTokenAttributes { public static final String JSON_PROPERTY_SCOPES = "scopes"; private List scopes = null; + /** + * The alias (short identifier) of the personal access token. + * + * @return alias + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALIAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlias() { + return alias; + } + /** * Creation date of the personal access token. * @@ -220,7 +236,8 @@ public boolean equals(Object o) { } FullPersonalAccessTokenAttributes fullPersonalAccessTokenAttributes = (FullPersonalAccessTokenAttributes) o; - return Objects.equals(this.createdAt, fullPersonalAccessTokenAttributes.createdAt) + return Objects.equals(this.alias, fullPersonalAccessTokenAttributes.alias) + && Objects.equals(this.createdAt, fullPersonalAccessTokenAttributes.createdAt) && Objects.equals(this.expiresAt, fullPersonalAccessTokenAttributes.expiresAt) && Objects.equals(this.key, fullPersonalAccessTokenAttributes.key) && Objects.equals(this.name, fullPersonalAccessTokenAttributes.name) @@ -233,13 +250,14 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - createdAt, expiresAt, key, name, publicPortion, scopes, additionalProperties); + alias, createdAt, expiresAt, key, name, publicPortion, scopes, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FullPersonalAccessTokenAttributes {\n"); + sb.append(" alias: ").append(toIndentedString(alias)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsData.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsData.java new file mode 100644 index 00000000000..9e9f9072ed5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsData.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** The managed organizations resource. */ +@JsonPropertyOrder({ + ManagedOrgsData.JSON_PROPERTY_ID, + ManagedOrgsData.JSON_PROPERTY_RELATIONSHIPS, + ManagedOrgsData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ManagedOrgsRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ManagedOrgsType type; + + public ManagedOrgsData() {} + + @JsonCreator + public ManagedOrgsData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + ManagedOrgsRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ManagedOrgsType type) { + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ManagedOrgsData id(UUID id) { + this.id = id; + return this; + } + + /** + * The UUID of the current organization. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ManagedOrgsData relationships(ManagedOrgsRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the managed organizations resource. + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ManagedOrgsRelationships relationships) { + this.relationships = relationships; + } + + public ManagedOrgsData type(ManagedOrgsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for managed organizations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsType getType() { + return type; + } + + public void setType(ManagedOrgsType 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 ManagedOrgsData + */ + @JsonAnySetter + public ManagedOrgsData 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 ManagedOrgsData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsData managedOrgsData = (ManagedOrgsData) o; + return Objects.equals(this.id, managedOrgsData.id) + && Objects.equals(this.relationships, managedOrgsData.relationships) + && Objects.equals(this.type, managedOrgsData.type) + && Objects.equals(this.additionalProperties, managedOrgsData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).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/ManagedOrgsRelationshipToOrg.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrg.java new file mode 100644 index 00000000000..de1813d6b75 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrg.java @@ -0,0 +1,146 @@ +/* + * 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; + +/** Relationship to the current organization. */ +@JsonPropertyOrder({ManagedOrgsRelationshipToOrg.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsRelationshipToOrg { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private OrgRelationshipData data; + + public ManagedOrgsRelationshipToOrg() {} + + @JsonCreator + public ManagedOrgsRelationshipToOrg( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) OrgRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ManagedOrgsRelationshipToOrg data(OrgRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Reference to an organization resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OrgRelationshipData getData() { + return data; + } + + public void setData(OrgRelationshipData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ManagedOrgsRelationshipToOrg + */ + @JsonAnySetter + public ManagedOrgsRelationshipToOrg 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 ManagedOrgsRelationshipToOrg object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsRelationshipToOrg managedOrgsRelationshipToOrg = (ManagedOrgsRelationshipToOrg) o; + return Objects.equals(this.data, managedOrgsRelationshipToOrg.data) + && Objects.equals( + this.additionalProperties, managedOrgsRelationshipToOrg.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsRelationshipToOrg {\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/ManagedOrgsRelationshipToOrgs.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrgs.java new file mode 100644 index 00000000000..be1d4a1f34c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationshipToOrgs.java @@ -0,0 +1,155 @@ +/* + * 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; + +/** Relationship to the managed organizations. */ +@JsonPropertyOrder({ManagedOrgsRelationshipToOrgs.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsRelationshipToOrgs { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ManagedOrgsRelationshipToOrgs() {} + + @JsonCreator + public ManagedOrgsRelationshipToOrgs( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public ManagedOrgsRelationshipToOrgs data(List data) { + this.data = data; + for (OrgRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ManagedOrgsRelationshipToOrgs addDataItem(OrgRelationshipData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of managed organization references. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ManagedOrgsRelationshipToOrgs + */ + @JsonAnySetter + public ManagedOrgsRelationshipToOrgs 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 ManagedOrgsRelationshipToOrgs object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsRelationshipToOrgs managedOrgsRelationshipToOrgs = (ManagedOrgsRelationshipToOrgs) o; + return Objects.equals(this.data, managedOrgsRelationshipToOrgs.data) + && Objects.equals( + this.additionalProperties, managedOrgsRelationshipToOrgs.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsRelationshipToOrgs {\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/ManagedOrgsRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationships.java new file mode 100644 index 00000000000..659b07a2059 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsRelationships.java @@ -0,0 +1,179 @@ +/* + * 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; + +/** Relationships of the managed organizations resource. */ +@JsonPropertyOrder({ + ManagedOrgsRelationships.JSON_PROPERTY_CURRENT_ORG, + ManagedOrgsRelationships.JSON_PROPERTY_MANAGED_ORGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CURRENT_ORG = "current_org"; + private ManagedOrgsRelationshipToOrg currentOrg; + + public static final String JSON_PROPERTY_MANAGED_ORGS = "managed_orgs"; + private ManagedOrgsRelationshipToOrgs managedOrgs; + + public ManagedOrgsRelationships() {} + + @JsonCreator + public ManagedOrgsRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_CURRENT_ORG) + ManagedOrgsRelationshipToOrg currentOrg, + @JsonProperty(required = true, value = JSON_PROPERTY_MANAGED_ORGS) + ManagedOrgsRelationshipToOrgs managedOrgs) { + this.currentOrg = currentOrg; + this.unparsed |= currentOrg.unparsed; + this.managedOrgs = managedOrgs; + this.unparsed |= managedOrgs.unparsed; + } + + public ManagedOrgsRelationships currentOrg(ManagedOrgsRelationshipToOrg currentOrg) { + this.currentOrg = currentOrg; + this.unparsed |= currentOrg.unparsed; + return this; + } + + /** + * Relationship to the current organization. + * + * @return currentOrg + */ + @JsonProperty(JSON_PROPERTY_CURRENT_ORG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsRelationshipToOrg getCurrentOrg() { + return currentOrg; + } + + public void setCurrentOrg(ManagedOrgsRelationshipToOrg currentOrg) { + this.currentOrg = currentOrg; + } + + public ManagedOrgsRelationships managedOrgs(ManagedOrgsRelationshipToOrgs managedOrgs) { + this.managedOrgs = managedOrgs; + this.unparsed |= managedOrgs.unparsed; + return this; + } + + /** + * Relationship to the managed organizations. + * + * @return managedOrgs + */ + @JsonProperty(JSON_PROPERTY_MANAGED_ORGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsRelationshipToOrgs getManagedOrgs() { + return managedOrgs; + } + + public void setManagedOrgs(ManagedOrgsRelationshipToOrgs managedOrgs) { + this.managedOrgs = managedOrgs; + } + + /** + * 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 ManagedOrgsRelationships + */ + @JsonAnySetter + public ManagedOrgsRelationships 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 ManagedOrgsRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsRelationships managedOrgsRelationships = (ManagedOrgsRelationships) o; + return Objects.equals(this.currentOrg, managedOrgsRelationships.currentOrg) + && Objects.equals(this.managedOrgs, managedOrgsRelationships.managedOrgs) + && Objects.equals(this.additionalProperties, managedOrgsRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(currentOrg, managedOrgs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsRelationships {\n"); + sb.append(" currentOrg: ").append(toIndentedString(currentOrg)).append("\n"); + sb.append(" managedOrgs: ").append(toIndentedString(managedOrgs)).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/ManagedOrgsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsResponse.java new file mode 100644 index 00000000000..d469c9d953d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsResponse.java @@ -0,0 +1,186 @@ +/* + * 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 the current organization and its managed organizations. */ +@JsonPropertyOrder({ + ManagedOrgsResponse.JSON_PROPERTY_DATA, + ManagedOrgsResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ManagedOrgsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ManagedOrgsData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = new ArrayList<>(); + + public ManagedOrgsResponse() {} + + @JsonCreator + public ManagedOrgsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) ManagedOrgsData data, + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDED) List included) { + this.data = data; + this.unparsed |= data.unparsed; + this.included = included; + } + + public ManagedOrgsResponse data(ManagedOrgsData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The managed organizations resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ManagedOrgsData getData() { + return data; + } + + public void setData(ManagedOrgsData data) { + this.data = data; + } + + public ManagedOrgsResponse included(List included) { + this.included = included; + for (OrgData item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ManagedOrgsResponse addIncludedItem(OrgData includedItem) { + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included organization resources. + * + * @return included + */ + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * 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 ManagedOrgsResponse + */ + @JsonAnySetter + public ManagedOrgsResponse 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 ManagedOrgsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedOrgsResponse managedOrgsResponse = (ManagedOrgsResponse) o; + return Objects.equals(this.data, managedOrgsResponse.data) + && Objects.equals(this.included, managedOrgsResponse.included) + && Objects.equals(this.additionalProperties, managedOrgsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedOrgsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).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/ManagedOrgsType.java b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsType.java new file mode 100644 index 00000000000..6e62edf76bf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ManagedOrgsType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type for managed organizations. */ +@JsonSerialize(using = ManagedOrgsType.ManagedOrgsTypeSerializer.class) +public class ManagedOrgsType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("managed_orgs")); + + public static final ManagedOrgsType MANAGED_ORGS = new ManagedOrgsType("managed_orgs"); + + ManagedOrgsType(String value) { + super(value, allowedValues); + } + + public static class ManagedOrgsTypeSerializer extends StdSerializer { + public ManagedOrgsTypeSerializer(Class t) { + super(t); + } + + public ManagedOrgsTypeSerializer() { + this(null); + } + + @Override + public void serialize(ManagedOrgsType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ManagedOrgsType fromValue(String value) { + return new ManagedOrgsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgAttributes.java new file mode 100644 index 00000000000..d639720e76c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrgAttributes.java @@ -0,0 +1,351 @@ +/* + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an organization. */ +@JsonPropertyOrder({ + OrgAttributes.JSON_PROPERTY_CREATED_AT, + OrgAttributes.JSON_PROPERTY_DESCRIPTION, + OrgAttributes.JSON_PROPERTY_DISABLED, + OrgAttributes.JSON_PROPERTY_MODIFIED_AT, + OrgAttributes.JSON_PROPERTY_NAME, + OrgAttributes.JSON_PROPERTY_PUBLIC_ID, + OrgAttributes.JSON_PROPERTY_SHARING, + OrgAttributes.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OrgAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DISABLED = "disabled"; + private Boolean disabled; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PUBLIC_ID = "public_id"; + private String publicId; + + public static final String JSON_PROPERTY_SHARING = "sharing"; + private String sharing; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public OrgAttributes() {} + + @JsonCreator + public OrgAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_DISABLED) Boolean disabled, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PUBLIC_ID) String publicId, + @JsonProperty(required = true, value = JSON_PROPERTY_SHARING) String sharing, + @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url) { + this.createdAt = createdAt; + this.description = description; + this.disabled = disabled; + this.modifiedAt = modifiedAt; + this.name = name; + this.publicId = publicId; + this.sharing = sharing; + this.url = url; + } + + public OrgAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The creation timestamp of the organization. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public OrgAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of the organization. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public OrgAttributes disabled(Boolean disabled) { + this.disabled = disabled; + return this; + } + + /** + * Whether the organization is disabled. + * + * @return disabled + */ + @JsonProperty(JSON_PROPERTY_DISABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getDisabled() { + return disabled; + } + + public void setDisabled(Boolean disabled) { + this.disabled = disabled; + } + + public OrgAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The last modification timestamp of the organization. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public OrgAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the organization. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public OrgAttributes publicId(String publicId) { + this.publicId = publicId; + return this; + } + + /** + * The public identifier of the organization. + * + * @return publicId + */ + @JsonProperty(JSON_PROPERTY_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPublicId() { + return publicId; + } + + public void setPublicId(String publicId) { + this.publicId = publicId; + } + + public OrgAttributes sharing(String sharing) { + this.sharing = sharing; + return this; + } + + /** + * The sharing setting of the organization. + * + * @return sharing + */ + @JsonProperty(JSON_PROPERTY_SHARING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSharing() { + return sharing; + } + + public void setSharing(String sharing) { + this.sharing = sharing; + } + + public OrgAttributes url(String url) { + this.url = url; + return this; + } + + /** + * The URL of the organization. + * + * @return url + */ + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * 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 OrgAttributes + */ + @JsonAnySetter + public OrgAttributes 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 OrgAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrgAttributes orgAttributes = (OrgAttributes) o; + return Objects.equals(this.createdAt, orgAttributes.createdAt) + && Objects.equals(this.description, orgAttributes.description) + && Objects.equals(this.disabled, orgAttributes.disabled) + && Objects.equals(this.modifiedAt, orgAttributes.modifiedAt) + && Objects.equals(this.name, orgAttributes.name) + && Objects.equals(this.publicId, orgAttributes.publicId) + && Objects.equals(this.sharing, orgAttributes.sharing) + && Objects.equals(this.url, orgAttributes.url) + && Objects.equals(this.additionalProperties, orgAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + description, + disabled, + modifiedAt, + name, + publicId, + sharing, + url, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrgAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" publicId: ").append(toIndentedString(publicId)).append("\n"); + sb.append(" sharing: ").append(toIndentedString(sharing)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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/OrgData.java b/src/main/java/com/datadog/api/client/v2/model/OrgData.java new file mode 100644 index 00000000000..8116c9b7077 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrgData.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** An organization resource. */ +@JsonPropertyOrder({ + OrgData.JSON_PROPERTY_ATTRIBUTES, + OrgData.JSON_PROPERTY_ID, + OrgData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OrgData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private OrgAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OrgResourceType type; + + public OrgData() {} + + @JsonCreator + public OrgData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) OrgAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OrgResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OrgData attributes(OrgAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an organization. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OrgAttributes getAttributes() { + return attributes; + } + + public void setAttributes(OrgAttributes attributes) { + this.attributes = attributes; + } + + public OrgData id(UUID id) { + this.id = id; + return this; + } + + /** + * The UUID of the organization. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public OrgData type(OrgResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for organizations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OrgResourceType getType() { + return type; + } + + public void setType(OrgResourceType 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 OrgData + */ + @JsonAnySetter + public OrgData 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 OrgData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrgData orgData = (OrgData) o; + return Objects.equals(this.attributes, orgData.attributes) + && Objects.equals(this.id, orgData.id) + && Objects.equals(this.type, orgData.type) + && Objects.equals(this.additionalProperties, orgData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrgData {\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/OrgGroupPolicyAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyAttributes.java index 82362a36e5e..cc19fe78892 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyAttributes.java @@ -21,10 +21,9 @@ /** Attributes of an org group policy. */ @JsonPropertyOrder({ OrgGroupPolicyAttributes.JSON_PROPERTY_CONTENT, - OrgGroupPolicyAttributes.JSON_PROPERTY_ENFORCEMENT_TIER, + OrgGroupPolicyAttributes.JSON_PROPERTY_ENFORCED_AT, OrgGroupPolicyAttributes.JSON_PROPERTY_MODIFIED_AT, - OrgGroupPolicyAttributes.JSON_PROPERTY_POLICY_NAME, - OrgGroupPolicyAttributes.JSON_PROPERTY_POLICY_TYPE + OrgGroupPolicyAttributes.JSON_PROPERTY_POLICY_NAME }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -33,8 +32,8 @@ public class OrgGroupPolicyAttributes { public static final String JSON_PROPERTY_CONTENT = "content"; private Map content = null; - public static final String JSON_PROPERTY_ENFORCEMENT_TIER = "enforcement_tier"; - private OrgGroupPolicyEnforcementTier enforcementTier = OrgGroupPolicyEnforcementTier.DEFAULT; + public static final String JSON_PROPERTY_ENFORCED_AT = "enforced_at"; + private OffsetDateTime enforcedAt; public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; private OffsetDateTime modifiedAt; @@ -42,25 +41,16 @@ public class OrgGroupPolicyAttributes { public static final String JSON_PROPERTY_POLICY_NAME = "policy_name"; private String policyName; - public static final String JSON_PROPERTY_POLICY_TYPE = "policy_type"; - private OrgGroupPolicyPolicyType policyType = OrgGroupPolicyPolicyType.ORG_CONFIG; - public OrgGroupPolicyAttributes() {} @JsonCreator public OrgGroupPolicyAttributes( - @JsonProperty(required = true, value = JSON_PROPERTY_ENFORCEMENT_TIER) - OrgGroupPolicyEnforcementTier enforcementTier, + @JsonProperty(required = true, value = JSON_PROPERTY_ENFORCED_AT) OffsetDateTime enforcedAt, @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, - @JsonProperty(required = true, value = JSON_PROPERTY_POLICY_NAME) String policyName, - @JsonProperty(required = true, value = JSON_PROPERTY_POLICY_TYPE) - OrgGroupPolicyPolicyType policyType) { - this.enforcementTier = enforcementTier; - this.unparsed |= !enforcementTier.isValid(); + @JsonProperty(required = true, value = JSON_PROPERTY_POLICY_NAME) String policyName) { + this.enforcedAt = enforcedAt; this.modifiedAt = modifiedAt; this.policyName = policyName; - this.policyType = policyType; - this.unparsed |= !policyType.isValid(); } public OrgGroupPolicyAttributes content(Map content) { @@ -92,31 +82,24 @@ public void setContent(Map content) { this.content = content; } - public OrgGroupPolicyAttributes enforcementTier(OrgGroupPolicyEnforcementTier enforcementTier) { - this.enforcementTier = enforcementTier; - this.unparsed |= !enforcementTier.isValid(); + public OrgGroupPolicyAttributes enforcedAt(OffsetDateTime enforcedAt) { + this.enforcedAt = enforcedAt; return this; } /** - * The enforcement tier of the policy. DEFAULT means the policy is set but member - * orgs may mutate it. ENFORCE means the policy is strictly controlled and mutations - * are blocked for affected orgs. DELEGATE means each member org controls its own - * value. + * Timestamp when the policy was enforced. * - * @return enforcementTier + * @return enforcedAt */ - @JsonProperty(JSON_PROPERTY_ENFORCEMENT_TIER) + @JsonProperty(JSON_PROPERTY_ENFORCED_AT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OrgGroupPolicyEnforcementTier getEnforcementTier() { - return enforcementTier; + public OffsetDateTime getEnforcedAt() { + return enforcedAt; } - public void setEnforcementTier(OrgGroupPolicyEnforcementTier enforcementTier) { - if (!enforcementTier.isValid()) { - this.unparsed = true; - } - this.enforcementTier = enforcementTier; + public void setEnforcedAt(OffsetDateTime enforcedAt) { + this.enforcedAt = enforcedAt; } public OrgGroupPolicyAttributes modifiedAt(OffsetDateTime modifiedAt) { @@ -159,31 +142,6 @@ public void setPolicyName(String policyName) { this.policyName = policyName; } - public OrgGroupPolicyAttributes policyType(OrgGroupPolicyPolicyType policyType) { - this.policyType = policyType; - this.unparsed |= !policyType.isValid(); - return this; - } - - /** - * The type of the policy. Only org_config is supported, indicating a policy backed - * by an organization configuration setting. - * - * @return policyType - */ - @JsonProperty(JSON_PROPERTY_POLICY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OrgGroupPolicyPolicyType getPolicyType() { - return policyType; - } - - public void setPolicyType(OrgGroupPolicyPolicyType policyType) { - if (!policyType.isValid()) { - this.unparsed = true; - } - this.policyType = policyType; - } - /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -241,17 +199,15 @@ public boolean equals(Object o) { } OrgGroupPolicyAttributes orgGroupPolicyAttributes = (OrgGroupPolicyAttributes) o; return Objects.equals(this.content, orgGroupPolicyAttributes.content) - && Objects.equals(this.enforcementTier, orgGroupPolicyAttributes.enforcementTier) + && Objects.equals(this.enforcedAt, orgGroupPolicyAttributes.enforcedAt) && Objects.equals(this.modifiedAt, orgGroupPolicyAttributes.modifiedAt) && Objects.equals(this.policyName, orgGroupPolicyAttributes.policyName) - && Objects.equals(this.policyType, orgGroupPolicyAttributes.policyType) && Objects.equals(this.additionalProperties, orgGroupPolicyAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash( - content, enforcementTier, modifiedAt, policyName, policyType, additionalProperties); + return Objects.hash(content, enforcedAt, modifiedAt, policyName, additionalProperties); } @Override @@ -259,10 +215,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrgGroupPolicyAttributes {\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" enforcementTier: ").append(toIndentedString(enforcementTier)).append("\n"); + sb.append(" enforcedAt: ").append(toIndentedString(enforcedAt)).append("\n"); sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" policyName: ").append(toIndentedString(policyName)).append("\n"); - sb.append(" policyType: ").append(toIndentedString(policyType)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateAttributes.java index 9e541d95040..0be94b1f43d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateAttributes.java @@ -17,16 +17,10 @@ import java.util.Map; import java.util.Objects; -/** - * Attributes for creating an org group policy. If policy_type or - * enforcement_tier are not provided, they default to org_config and - * DEFAULT respectively. - */ +/** Attributes for creating an org group policy. */ @JsonPropertyOrder({ OrgGroupPolicyCreateAttributes.JSON_PROPERTY_CONTENT, - OrgGroupPolicyCreateAttributes.JSON_PROPERTY_ENFORCEMENT_TIER, - OrgGroupPolicyCreateAttributes.JSON_PROPERTY_POLICY_NAME, - OrgGroupPolicyCreateAttributes.JSON_PROPERTY_POLICY_TYPE + OrgGroupPolicyCreateAttributes.JSON_PROPERTY_POLICY_NAME }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -35,15 +29,9 @@ public class OrgGroupPolicyCreateAttributes { public static final String JSON_PROPERTY_CONTENT = "content"; private Map content = new HashMap(); - public static final String JSON_PROPERTY_ENFORCEMENT_TIER = "enforcement_tier"; - private OrgGroupPolicyEnforcementTier enforcementTier = OrgGroupPolicyEnforcementTier.DEFAULT; - public static final String JSON_PROPERTY_POLICY_NAME = "policy_name"; private String policyName; - public static final String JSON_PROPERTY_POLICY_TYPE = "policy_type"; - private OrgGroupPolicyPolicyType policyType = OrgGroupPolicyPolicyType.ORG_CONFIG; - public OrgGroupPolicyCreateAttributes() {} @JsonCreator @@ -79,35 +67,6 @@ public void setContent(Map content) { this.content = content; } - public OrgGroupPolicyCreateAttributes enforcementTier( - OrgGroupPolicyEnforcementTier enforcementTier) { - this.enforcementTier = enforcementTier; - this.unparsed |= !enforcementTier.isValid(); - return this; - } - - /** - * The enforcement tier of the policy. DEFAULT means the policy is set but member - * orgs may mutate it. ENFORCE means the policy is strictly controlled and mutations - * are blocked for affected orgs. DELEGATE means each member org controls its own - * value. - * - * @return enforcementTier - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENFORCEMENT_TIER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OrgGroupPolicyEnforcementTier getEnforcementTier() { - return enforcementTier; - } - - public void setEnforcementTier(OrgGroupPolicyEnforcementTier enforcementTier) { - if (!enforcementTier.isValid()) { - this.unparsed = true; - } - this.enforcementTier = enforcementTier; - } - public OrgGroupPolicyCreateAttributes policyName(String policyName) { this.policyName = policyName; return this; @@ -128,32 +87,6 @@ public void setPolicyName(String policyName) { this.policyName = policyName; } - public OrgGroupPolicyCreateAttributes policyType(OrgGroupPolicyPolicyType policyType) { - this.policyType = policyType; - this.unparsed |= !policyType.isValid(); - return this; - } - - /** - * The type of the policy. Only org_config is supported, indicating a policy backed - * by an organization configuration setting. - * - * @return policyType - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_POLICY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OrgGroupPolicyPolicyType getPolicyType() { - return policyType; - } - - public void setPolicyType(OrgGroupPolicyPolicyType policyType) { - if (!policyType.isValid()) { - this.unparsed = true; - } - this.policyType = policyType; - } - /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -212,16 +145,14 @@ public boolean equals(Object o) { OrgGroupPolicyCreateAttributes orgGroupPolicyCreateAttributes = (OrgGroupPolicyCreateAttributes) o; return Objects.equals(this.content, orgGroupPolicyCreateAttributes.content) - && Objects.equals(this.enforcementTier, orgGroupPolicyCreateAttributes.enforcementTier) && Objects.equals(this.policyName, orgGroupPolicyCreateAttributes.policyName) - && Objects.equals(this.policyType, orgGroupPolicyCreateAttributes.policyType) && Objects.equals( this.additionalProperties, orgGroupPolicyCreateAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(content, enforcementTier, policyName, policyType, additionalProperties); + return Objects.hash(content, policyName, additionalProperties); } @Override @@ -229,9 +160,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrgGroupPolicyCreateAttributes {\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" enforcementTier: ").append(toIndentedString(enforcementTier)).append("\n"); sb.append(" policyName: ").append(toIndentedString(policyName)).append("\n"); - sb.append(" policyType: ").append(toIndentedString(policyType)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateData.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateData.java index efea81a6f93..116ec810863 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateData.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateData.java @@ -60,9 +60,7 @@ public OrgGroupPolicyCreateData attributes(OrgGroupPolicyCreateAttributes attrib } /** - * Attributes for creating an org group policy. If policy_type or - * enforcement_tier are not provided, they default to org_config and - * DEFAULT respectively. + * Attributes for creating an org group policy. * * @return attributes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyEnforcementTier.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyEnforcementTier.java deleted file mode 100644 index 73f2a240ff9..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyEnforcementTier.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.datadog.api.client.ModelEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** - * The enforcement tier of the policy. DEFAULT means the policy is set but member orgs - * may mutate it. ENFORCE means the policy is strictly controlled and mutations are - * blocked for affected orgs. DELEGATE means each member org controls its own value. - */ -@JsonSerialize(using = OrgGroupPolicyEnforcementTier.OrgGroupPolicyEnforcementTierSerializer.class) -public class OrgGroupPolicyEnforcementTier extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("DEFAULT", "ENFORCE", "DELEGATE")); - - public static final OrgGroupPolicyEnforcementTier DEFAULT = - new OrgGroupPolicyEnforcementTier("DEFAULT"); - public static final OrgGroupPolicyEnforcementTier ENFORCE = - new OrgGroupPolicyEnforcementTier("ENFORCE"); - public static final OrgGroupPolicyEnforcementTier DELEGATE = - new OrgGroupPolicyEnforcementTier("DELEGATE"); - - OrgGroupPolicyEnforcementTier(String value) { - super(value, allowedValues); - } - - public static class OrgGroupPolicyEnforcementTierSerializer - extends StdSerializer { - public OrgGroupPolicyEnforcementTierSerializer(Class t) { - super(t); - } - - public OrgGroupPolicyEnforcementTierSerializer() { - this(null); - } - - @Override - public void serialize( - OrgGroupPolicyEnforcementTier value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static OrgGroupPolicyEnforcementTier fromValue(String value) { - return new OrgGroupPolicyEnforcementTier(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateAttributes.java index 499f98402d5..2da703d0c7b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateAttributes.java @@ -18,10 +18,7 @@ import java.util.Objects; import java.util.UUID; -/** - * Attributes for updating a policy override. The org_uuid and org_site - * fields must match the existing override and cannot be changed. - */ +/** Attributes for updating a policy override. */ @JsonPropertyOrder({ OrgGroupPolicyOverrideUpdateAttributes.JSON_PROPERTY_ORG_SITE, OrgGroupPolicyOverrideUpdateAttributes.JSON_PROPERTY_ORG_UUID diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateData.java index 964879f945b..00d80af12c8 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateData.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateData.java @@ -60,8 +60,7 @@ public OrgGroupPolicyOverrideUpdateData attributes( } /** - * Attributes for updating a policy override. The org_uuid and org_site - * fields must match the existing override and cannot be changed. + * Attributes for updating a policy override. * * @return attributes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyUpdateAttributes.java index 428c121c21b..48fd2c3aeda 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyUpdateAttributes.java @@ -17,10 +17,7 @@ import java.util.Objects; /** Attributes for updating an org group policy. */ -@JsonPropertyOrder({ - OrgGroupPolicyUpdateAttributes.JSON_PROPERTY_CONTENT, - OrgGroupPolicyUpdateAttributes.JSON_PROPERTY_ENFORCEMENT_TIER -}) +@JsonPropertyOrder({OrgGroupPolicyUpdateAttributes.JSON_PROPERTY_CONTENT}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class OrgGroupPolicyUpdateAttributes { @@ -28,9 +25,6 @@ public class OrgGroupPolicyUpdateAttributes { public static final String JSON_PROPERTY_CONTENT = "content"; private Map content = null; - public static final String JSON_PROPERTY_ENFORCEMENT_TIER = "enforcement_tier"; - private OrgGroupPolicyEnforcementTier enforcementTier = OrgGroupPolicyEnforcementTier.DEFAULT; - public OrgGroupPolicyUpdateAttributes content(Map content) { this.content = content; return this; @@ -60,35 +54,6 @@ public void setContent(Map content) { this.content = content; } - public OrgGroupPolicyUpdateAttributes enforcementTier( - OrgGroupPolicyEnforcementTier enforcementTier) { - this.enforcementTier = enforcementTier; - this.unparsed |= !enforcementTier.isValid(); - return this; - } - - /** - * The enforcement tier of the policy. DEFAULT means the policy is set but member - * orgs may mutate it. ENFORCE means the policy is strictly controlled and mutations - * are blocked for affected orgs. DELEGATE means each member org controls its own - * value. - * - * @return enforcementTier - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENFORCEMENT_TIER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OrgGroupPolicyEnforcementTier getEnforcementTier() { - return enforcementTier; - } - - public void setEnforcementTier(OrgGroupPolicyEnforcementTier enforcementTier) { - if (!enforcementTier.isValid()) { - this.unparsed = true; - } - this.enforcementTier = enforcementTier; - } - /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -147,14 +112,13 @@ public boolean equals(Object o) { OrgGroupPolicyUpdateAttributes orgGroupPolicyUpdateAttributes = (OrgGroupPolicyUpdateAttributes) o; return Objects.equals(this.content, orgGroupPolicyUpdateAttributes.content) - && Objects.equals(this.enforcementTier, orgGroupPolicyUpdateAttributes.enforcementTier) && Objects.equals( this.additionalProperties, orgGroupPolicyUpdateAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(content, enforcementTier, additionalProperties); + return Objects.hash(content, additionalProperties); } @Override @@ -162,7 +126,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrgGroupPolicyUpdateAttributes {\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" enforcementTier: ").append(toIndentedString(enforcementTier)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OrgRelationshipData.java new file mode 100644 index 00000000000..3283637b946 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrgRelationshipData.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Reference to an organization resource. */ +@JsonPropertyOrder({OrgRelationshipData.JSON_PROPERTY_ID, OrgRelationshipData.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OrgRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OrgResourceType type; + + public OrgRelationshipData() {} + + @JsonCreator + public OrgRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OrgResourceType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OrgRelationshipData id(UUID id) { + this.id = id; + return this; + } + + /** + * The UUID of the organization. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public OrgRelationshipData type(OrgResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for organizations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OrgResourceType getType() { + return type; + } + + public void setType(OrgResourceType 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 OrgRelationshipData + */ + @JsonAnySetter + public OrgRelationshipData 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 OrgRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrgRelationshipData orgRelationshipData = (OrgRelationshipData) o; + return Objects.equals(this.id, orgRelationshipData.id) + && Objects.equals(this.type, orgRelationshipData.type) + && Objects.equals(this.additionalProperties, orgRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrgRelationshipData {\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/OrgGroupPolicyPolicyType.java b/src/main/java/com/datadog/api/client/v2/model/OrgResourceType.java similarity index 52% rename from src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyPolicyType.java rename to src/main/java/com/datadog/api/client/v2/model/OrgResourceType.java index ad8ee90b73d..688fcc32ca3 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyPolicyType.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgResourceType.java @@ -18,42 +18,36 @@ import java.util.HashSet; import java.util.Set; -/** - * The type of the policy. Only org_config is supported, indicating a policy backed by - * an organization configuration setting. - */ -@JsonSerialize(using = OrgGroupPolicyPolicyType.OrgGroupPolicyPolicyTypeSerializer.class) -public class OrgGroupPolicyPolicyType extends ModelEnum { +/** The resource type for organizations. */ +@JsonSerialize(using = OrgResourceType.OrgResourceTypeSerializer.class) +public class OrgResourceType extends ModelEnum { - private static final Set allowedValues = new HashSet(Arrays.asList("org_config")); + private static final Set allowedValues = new HashSet(Arrays.asList("orgs")); - public static final OrgGroupPolicyPolicyType ORG_CONFIG = - new OrgGroupPolicyPolicyType("org_config"); + public static final OrgResourceType ORGS = new OrgResourceType("orgs"); - OrgGroupPolicyPolicyType(String value) { + OrgResourceType(String value) { super(value, allowedValues); } - public static class OrgGroupPolicyPolicyTypeSerializer - extends StdSerializer { - public OrgGroupPolicyPolicyTypeSerializer(Class t) { + public static class OrgResourceTypeSerializer extends StdSerializer { + public OrgResourceTypeSerializer(Class t) { super(t); } - public OrgGroupPolicyPolicyTypeSerializer() { + public OrgResourceTypeSerializer() { this(null); } @Override - public void serialize( - OrgGroupPolicyPolicyType value, JsonGenerator jgen, SerializerProvider provider) + public void serialize(OrgResourceType value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { jgen.writeObject(value.value); } } @JsonCreator - public static OrgGroupPolicyPolicyType fromValue(String value) { - return new OrgGroupPolicyPolicyType(value); + public static OrgResourceType fromValue(String value) { + return new OrgResourceType(value); } } diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenAttributes.java index 328e30dc7f9..1a9b5f964af 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenAttributes.java @@ -22,6 +22,7 @@ /** Attributes of a personal access token. */ @JsonPropertyOrder({ + PersonalAccessTokenAttributes.JSON_PROPERTY_ALIAS, PersonalAccessTokenAttributes.JSON_PROPERTY_CREATED_AT, PersonalAccessTokenAttributes.JSON_PROPERTY_EXPIRES_AT, PersonalAccessTokenAttributes.JSON_PROPERTY_LAST_USED_AT, @@ -34,6 +35,9 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class PersonalAccessTokenAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALIAS = "alias"; + private String alias; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; private OffsetDateTime createdAt; @@ -55,6 +59,18 @@ public class PersonalAccessTokenAttributes { public static final String JSON_PROPERTY_SCOPES = "scopes"; private List scopes = null; + /** + * The alias (short identifier) of the personal access token. + * + * @return alias + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALIAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAlias() { + return alias; + } + /** * Creation date of the personal access token. * @@ -263,7 +279,8 @@ public boolean equals(Object o) { return false; } PersonalAccessTokenAttributes personalAccessTokenAttributes = (PersonalAccessTokenAttributes) o; - return Objects.equals(this.createdAt, personalAccessTokenAttributes.createdAt) + return Objects.equals(this.alias, personalAccessTokenAttributes.alias) + && Objects.equals(this.createdAt, personalAccessTokenAttributes.createdAt) && Objects.equals(this.expiresAt, personalAccessTokenAttributes.expiresAt) && Objects.equals(this.lastUsedAt, personalAccessTokenAttributes.lastUsedAt) && Objects.equals(this.modifiedAt, personalAccessTokenAttributes.modifiedAt) @@ -277,6 +294,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + alias, createdAt, expiresAt, lastUsedAt, @@ -291,6 +309,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PersonalAccessTokenAttributes {\n"); + sb.append(" alias: ").append(toIndentedString(alias)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append(" lastUsedAt: ").append(toIndentedString(lastUsedAt)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/UserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserAttributes.java index e1264d262ca..e3d84466c8b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UserAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/UserAttributes.java @@ -32,7 +32,6 @@ UserAttributes.JSON_PROPERTY_SERVICE_ACCOUNT, UserAttributes.JSON_PROPERTY_STATUS, UserAttributes.JSON_PROPERTY_TITLE, - UserAttributes.JSON_PROPERTY_UUID, UserAttributes.JSON_PROPERTY_VERIFIED }) @jakarta.annotation.Generated( @@ -75,9 +74,6 @@ public class UserAttributes { public static final String JSON_PROPERTY_TITLE = "title"; private JsonNullable title = JsonNullable.undefined(); - public static final String JSON_PROPERTY_UUID = "uuid"; - private String uuid; - public static final String JSON_PROPERTY_VERIFIED = "verified"; private Boolean verified; @@ -349,18 +345,6 @@ public void setTitle(String title) { this.title = JsonNullable.of(title); } - /** - * UUID of the user. - * - * @return uuid - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUuid() { - return uuid; - } - public UserAttributes verified(Boolean verified) { this.verified = verified; return this; @@ -450,7 +434,6 @@ public boolean equals(Object o) { && Objects.equals(this.serviceAccount, userAttributes.serviceAccount) && Objects.equals(this.status, userAttributes.status) && Objects.equals(this.title, userAttributes.title) - && Objects.equals(this.uuid, userAttributes.uuid) && Objects.equals(this.verified, userAttributes.verified) && Objects.equals(this.additionalProperties, userAttributes.additionalProperties); } @@ -470,7 +453,6 @@ public int hashCode() { serviceAccount, status, title, - uuid, verified, additionalProperties); } @@ -491,7 +473,6 @@ public String toString() { sb.append(" serviceAccount: ").append(toIndentedString(serviceAccount)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/test/resources/cassettes/features/v2/Create_an_access_token_for_a_service_account_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_an_access_token_for_a_service_account_returns_Created_response.freeze index 7ccf87f4bd5..b457d0ec92c 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_access_token_for_a_service_account_returns_Created_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_an_access_token_for_a_service_account_returns_Created_response.freeze @@ -1 +1 @@ -2026-04-16T20:03:06.304Z \ No newline at end of file +2026-04-03T21:02:56.793Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_access_token_for_a_service_account_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_an_access_token_for_a_service_account_returns_Created_response.json index d7cbb9016a0..ebd30ca2de3 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_access_token_for_a_service_account_returns_Created_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_access_token_for_a_service_account_returns_Created_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"498cce13-39cf-11f1-9928-be1871753dee\",\"attributes\":{\"uuid\":\"498cce13-39cf-11f1-9928-be1871753dee\",\"name\":null,\"handle\":\"498cce13-39cf-11f1-9928-be1871753dee\",\"created_at\":\"2026-04-16T20:03:08.017467+00:00\",\"modified_at\":\"2026-04-16T20:03:08.017467+00:00\",\"email\":\"test-create_an_access_token_for_a_service_account_returns_created_response-1776369786@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/ed167ebfacd06c99ea70d4c121f5a7f1?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0\",\"attributes\":{\"name\":null,\"handle\":\"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0\",\"created_at\":\"2026-04-03T21:02:56.980609+00:00\",\"modified_at\":\"2026-04-03T21:02:56.980609+00:00\",\"email\":\"test-create_an_access_token_for_a_service_account_returns_created_response-1775250176@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/1a703b50769c96d7b84a5470f474ef74?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,22 +27,22 @@ "timeToLive": { "unlimited": true }, - "id": "f47bb188-a2e6-ba96-a9a6-a881be2e659e" + "id": "567c34c3-ae3c-8785-a73a-27fcc9a742ba" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786\",\"scopes\":[\"dashboards_read\"]},\"type\":\"personal_access_tokens\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176\",\"scopes\":[\"dashboards_read\"]},\"type\":\"personal_access_tokens\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens", + "path": "/api/v2/service_accounts/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0/access_tokens", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"88337232-8552-4495-987c-1cfed567d461\",\"type\":\"personal_access_tokens\",\"attributes\":{\"created_at\":\"2026-04-16T20:03:08.381725456Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786\",\"public_portion\":\"ddpat_490SyfYQqhqnr008BTjQWn\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"498cce13-39cf-11f1-9928-be1871753dee\",\"type\":\"users\"}}}}}", + "body": "{\"data\":{\"id\":\"6f2491f5-8c3f-45a3-962a-5f769b95e806\",\"type\":\"personal_access_tokens\",\"attributes\":{\"alias\":\"3NirNJ5Y2qB4Fmac8B4wnm\",\"created_at\":\"2026-04-03T21:02:57.288351972Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176\",\"public_portion\":\"3NirNJ5Y2qB4Fmac8B4wnm\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0\",\"type\":\"users\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "6d806020-4556-1183-3ebc-a80b6034dce9" + "id": "c6adfa6b-1027-61d3-a8c2-030c2ba28080" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens/88337232-8552-4495-987c-1cfed567d461", + "path": "/api/v2/service_accounts/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0/access_tokens/6f2491f5-8c3f-45a3-962a-5f769b95e806", "keepAlive": false, "secure": true }, @@ -78,13 +78,13 @@ "timeToLive": { "unlimited": true }, - "id": "9f6795a3-3733-f1de-83fa-480c56c66320" + "id": "09473a0a-cca9-78f1-677a-1a4f8ac133da" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/498cce13-39cf-11f1-9928-be1871753dee", + "path": "/api/v2/users/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0", "keepAlive": false, "secure": true }, @@ -99,6 +99,6 @@ "timeToLive": { "unlimited": true }, - "id": "8fda343e-c920-8ee6-219a-f8b36492a756" + "id": "393e616c-bf05-7584-1cd3-0dad62ab2cff" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_access_token_for_a_service_account_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_access_token_for_a_service_account_returns_OK_response.freeze index 767a9f9c250..55c4828532c 100644 --- a/src/test/resources/cassettes/features/v2/Get_an_access_token_for_a_service_account_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_an_access_token_for_a_service_account_returns_OK_response.freeze @@ -1 +1 @@ -2026-04-16T20:03:09.123Z \ No newline at end of file +2026-04-03T21:03:03.500Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_access_token_for_a_service_account_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_an_access_token_for_a_service_account_returns_OK_response.json index 3347aebddcb..8ce61fc245e 100644 --- a/src/test/resources/cassettes/features/v2/Get_an_access_token_for_a_service_account_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_an_access_token_for_a_service_account_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"4a56376d-39cf-11f1-9a29-2eb65349fc01\",\"attributes\":{\"uuid\":\"4a56376d-39cf-11f1-9a29-2eb65349fc01\",\"name\":null,\"handle\":\"4a56376d-39cf-11f1-9a29-2eb65349fc01\",\"created_at\":\"2026-04-16T20:03:09.337439+00:00\",\"modified_at\":\"2026-04-16T20:03:09.337439+00:00\",\"email\":\"test-get_an_access_token_for_a_service_account_returns_ok_response-1776369789@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/7473377b9dced0689feddb50f5d82d29?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"8161ef90-2fa0-11f1-991f-62f4bfc595d0\",\"attributes\":{\"name\":null,\"handle\":\"8161ef90-2fa0-11f1-991f-62f4bfc595d0\",\"created_at\":\"2026-04-03T21:03:03.714879+00:00\",\"modified_at\":\"2026-04-03T21:03:03.714879+00:00\",\"email\":\"test-get_an_access_token_for_a_service_account_returns_ok_response-1775250183@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/bb3c6df0d99066bbe05cf7dff99b5561?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,22 +27,22 @@ "timeToLive": { "unlimited": true }, - "id": "d077c285-8166-09b6-bafd-ac466b66d2ea" + "id": "145227f5-47e3-35aa-327f-58dc2e4b258b" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789\",\"scopes\":[\"dashboards_read\"]},\"type\":\"personal_access_tokens\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183\",\"scopes\":[\"dashboards_read\"]},\"type\":\"personal_access_tokens\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens", + "path": "/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"b84d8c2c-b88c-4f72-82ef-fc09dddd1153\",\"type\":\"personal_access_tokens\",\"attributes\":{\"created_at\":\"2026-04-16T20:03:09.695802251Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789\",\"public_portion\":\"ddpat_5bm1hhcTKQzH22hPiJgkEN\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"4a56376d-39cf-11f1-9a29-2eb65349fc01\",\"type\":\"users\"}}}}}", + "body": "{\"data\":{\"id\":\"f2362958-1e67-414b-985d-d3196afd9315\",\"type\":\"personal_access_tokens\",\"attributes\":{\"alias\":\"7N2tUOwxIjSF8QziOBIpVd\",\"created_at\":\"2026-04-03T21:03:04.002376467Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183\",\"public_portion\":\"7N2tUOwxIjSF8QziOBIpVd\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"8161ef90-2fa0-11f1-991f-62f4bfc595d0\",\"type\":\"users\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "43c62610-8b63-b6e6-6162-25e0c9c01f18" + "id": "fdccf204-9c1e-92e9-0008-e334c10c3ed8" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153", + "path": "/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens/f2362958-1e67-414b-985d-d3196afd9315", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"b84d8c2c-b88c-4f72-82ef-fc09dddd1153\",\"type\":\"personal_access_tokens\",\"attributes\":{\"created_at\":\"2026-04-16T20:03:09.695802Z\",\"expires_at\":null,\"last_used_at\":null,\"name\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789\",\"public_portion\":\"ddpat_5bm1hhcTKQzH22hPiJgkEN\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"4a56376d-39cf-11f1-9a29-2eb65349fc01\",\"type\":\"users\"}}}}}", + "body": "{\"data\":{\"id\":\"f2362958-1e67-414b-985d-d3196afd9315\",\"type\":\"personal_access_tokens\",\"attributes\":{\"alias\":\"7N2tUOwxIjSF8QziOBIpVd\",\"created_at\":\"2026-04-03T21:03:04.002376Z\",\"expires_at\":null,\"last_used_at\":null,\"name\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183\",\"public_portion\":\"7N2tUOwxIjSF8QziOBIpVd\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"8161ef90-2fa0-11f1-991f-62f4bfc595d0\",\"type\":\"users\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -83,13 +83,13 @@ "timeToLive": { "unlimited": true }, - "id": "42134347-5af4-f8df-7193-56b4cfa2f4f0" + "id": "8e65c5a6-4047-d080-cfc9-d5fed107089c" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153", + "path": "/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens/f2362958-1e67-414b-985d-d3196afd9315", "keepAlive": false, "secure": true }, @@ -104,13 +104,13 @@ "timeToLive": { "unlimited": true }, - "id": "207dc4ce-726f-bb5d-f2ec-232ddf8d8fb9" + "id": "c26607f1-bdf6-dc7e-1abe-ba1d99b0d986" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/4a56376d-39cf-11f1-9a29-2eb65349fc01", + "path": "/api/v2/users/8161ef90-2fa0-11f1-991f-62f4bfc595d0", "keepAlive": false, "secure": true }, @@ -125,6 +125,6 @@ "timeToLive": { "unlimited": true }, - "id": "98343038-3a18-ef13-9153-732118bbfdc9" + "id": "18d29cd2-ed05-67c0-ce3f-cd340445e82f" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_access_tokens_for_a_service_account_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_access_tokens_for_a_service_account_returns_OK_response.freeze index db15643c3b7..6234af8a3e4 100644 --- a/src/test/resources/cassettes/features/v2/List_access_tokens_for_a_service_account_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/List_access_tokens_for_a_service_account_returns_OK_response.freeze @@ -1 +1 @@ -2026-04-16T20:03:10.610Z \ No newline at end of file +2026-04-03T21:03:09.026Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_access_tokens_for_a_service_account_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_access_tokens_for_a_service_account_returns_OK_response.json index 11c655fcc28..63738b91632 100644 --- a/src/test/resources/cassettes/features/v2/List_access_tokens_for_a_service_account_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_access_tokens_for_a_service_account_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-List_access_tokens_for_a_service_account_returns_OK_response-1776369790@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-List_access_tokens_for_a_service_account_returns_OK_response-1775250189@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4\",\"attributes\":{\"uuid\":\"4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4\",\"name\":null,\"handle\":\"4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4\",\"created_at\":\"2026-04-16T20:03:10.837056+00:00\",\"modified_at\":\"2026-04-16T20:03:10.837056+00:00\",\"email\":\"test-list_access_tokens_for_a_service_account_returns_ok_response-1776369790@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/0a5772e4c2381e3c1061e55142e2281a?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7\",\"attributes\":{\"name\":null,\"handle\":\"84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7\",\"created_at\":\"2026-04-03T21:03:09.205232+00:00\",\"modified_at\":\"2026-04-03T21:03:09.205232+00:00\",\"email\":\"test-list_access_tokens_for_a_service_account_returns_ok_response-1775250189@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/816e106f74328dd4c20e98c116a9edeb?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "315fbb2a-1c68-4067-2ddf-70846fbd17d2" + "id": "15159beb-c452-f76c-c58b-3dd52e769af5" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/service_accounts/4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens", + "path": "/api/v2/service_accounts/84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7/access_tokens", "keepAlive": false, "secure": true }, @@ -53,13 +53,13 @@ "timeToLive": { "unlimited": true }, - "id": "e8917630-83f6-7504-ebf6-c0d63c473dbc" + "id": "fcd67808-c945-bd4d-6169-075b41c61c92" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4", + "path": "/api/v2/users/84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7", "keepAlive": false, "secure": true }, @@ -74,6 +74,6 @@ "timeToLive": { "unlimited": true }, - "id": "03782f84-f04f-b210-02b4-e3f5ca9577df" + "id": "29e3fcdb-4d74-bd98-edbd-15ce7445207c" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Revoke_an_access_token_for_a_service_account_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Revoke_an_access_token_for_a_service_account_returns_No_Content_response.freeze index 4a8602fd913..fa38ba91a95 100644 --- a/src/test/resources/cassettes/features/v2/Revoke_an_access_token_for_a_service_account_returns_No_Content_response.freeze +++ b/src/test/resources/cassettes/features/v2/Revoke_an_access_token_for_a_service_account_returns_No_Content_response.freeze @@ -1 +1 @@ -2026-04-16T20:03:12.932Z \ No newline at end of file +2026-04-03T21:03:10.520Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Revoke_an_access_token_for_a_service_account_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Revoke_an_access_token_for_a_service_account_returns_No_Content_response.json index 297f1a4fea9..d9de91753fa 100644 --- a/src/test/resources/cassettes/features/v2/Revoke_an_access_token_for_a_service_account_returns_No_Content_response.json +++ b/src/test/resources/cassettes/features/v2/Revoke_an_access_token_for_a_service_account_returns_No_Content_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"4c99fbee-39cf-11f1-beb2-cad70c641dfa\",\"attributes\":{\"uuid\":\"4c99fbee-39cf-11f1-beb2-cad70c641dfa\",\"name\":null,\"handle\":\"4c99fbee-39cf-11f1-beb2-cad70c641dfa\",\"created_at\":\"2026-04-16T20:03:13.136998+00:00\",\"modified_at\":\"2026-04-16T20:03:13.136998+00:00\",\"email\":\"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1776369792@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/7586d09a6a08e32a963f425a34463a4d?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"860878b5-2fa0-11f1-991f-62f4bfc595d0\",\"attributes\":{\"name\":null,\"handle\":\"860878b5-2fa0-11f1-991f-62f4bfc595d0\",\"created_at\":\"2026-04-03T21:03:11.517157+00:00\",\"modified_at\":\"2026-04-03T21:03:11.517157+00:00\",\"email\":\"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1775250190@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/7d18813f3cbc71a5e46b1184fc3ad8fb?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,22 +27,22 @@ "timeToLive": { "unlimited": true }, - "id": "feae69d6-cf82-4560-fc06-fba6fe8c4884" + "id": "8e80ce1e-baea-0855-a516-5204026b7cb0" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792\",\"scopes\":[\"dashboards_read\"]},\"type\":\"personal_access_tokens\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190\",\"scopes\":[\"dashboards_read\"]},\"type\":\"personal_access_tokens\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens", + "path": "/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"a5b5e3c3-2b58-448b-a1b1-5c97f16837a6\",\"type\":\"personal_access_tokens\",\"attributes\":{\"created_at\":\"2026-04-16T20:03:13.505344652Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792\",\"public_portion\":\"ddpat_52grBIAi4zKGY0uxhjLVVW\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"4c99fbee-39cf-11f1-beb2-cad70c641dfa\",\"type\":\"users\"}}}}}", + "body": "{\"data\":{\"id\":\"7346d75b-83f3-48ba-9186-899fc80bce16\",\"type\":\"personal_access_tokens\",\"attributes\":{\"alias\":\"3VWUVmuRsjFIKue2Uq9ii6\",\"created_at\":\"2026-04-03T21:03:11.782016283Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190\",\"public_portion\":\"3VWUVmuRsjFIKue2Uq9ii6\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"860878b5-2fa0-11f1-991f-62f4bfc595d0\",\"type\":\"users\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "8a5a8bec-f645-edef-33c1-e3ea927b06ff" + "id": "0f38e844-7171-92c4-d557-1f9a6b65056c" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6", + "path": "/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens/7346d75b-83f3-48ba-9186-899fc80bce16", "keepAlive": false, "secure": true }, @@ -78,13 +78,13 @@ "timeToLive": { "unlimited": true }, - "id": "9f2fc74e-4b0e-839a-3ec0-9da4a2a8ae4b" + "id": "69600d26-98fc-c50d-de4a-9a91c7a31bbe" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6", + "path": "/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens/7346d75b-83f3-48ba-9186-899fc80bce16", "keepAlive": false, "secure": true }, @@ -99,13 +99,13 @@ "timeToLive": { "unlimited": true }, - "id": "9f2fc74e-4b0e-839a-3ec0-9da4a2a8ae4c" + "id": "69600d26-98fc-c50d-de4a-9a91c7a31bbf" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/4c99fbee-39cf-11f1-beb2-cad70c641dfa", + "path": "/api/v2/users/860878b5-2fa0-11f1-991f-62f4bfc595d0", "keepAlive": false, "secure": true }, @@ -120,6 +120,6 @@ "timeToLive": { "unlimited": true }, - "id": "994e08b8-d361-e7d6-a7a2-8323e62d9c95" + "id": "6877b2e2-ef94-29e4-86b5-baf7800f86bd" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_access_token_for_a_service_account_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_access_token_for_a_service_account_returns_OK_response.freeze index 58278ff6c0f..6a894d59da1 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_access_token_for_a_service_account_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_an_access_token_for_a_service_account_returns_OK_response.freeze @@ -1 +1 @@ -2026-04-16T20:03:14.527Z \ No newline at end of file +2026-04-03T21:03:12.499Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_access_token_for_a_service_account_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_an_access_token_for_a_service_account_returns_OK_response.json index 790a7566ae7..084402251cc 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_access_token_for_a_service_account_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_an_access_token_for_a_service_account_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" + "json": "{\"data\":{\"attributes\":{\"email\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192@datadoghq.com\",\"service_account\":true,\"title\":\"user title\"},\"type\":\"users\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"type\":\"users\",\"id\":\"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4\",\"attributes\":{\"uuid\":\"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4\",\"name\":null,\"handle\":\"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4\",\"created_at\":\"2026-04-16T20:03:14.742691+00:00\",\"modified_at\":\"2026-04-16T20:03:14.742691+00:00\",\"email\":\"test-update_an_access_token_for_a_service_account_returns_ok_response-1776369794@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/05aacae415f13819561258b03c973881?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", + "body": "{\"data\":{\"type\":\"users\",\"id\":\"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0\",\"attributes\":{\"name\":null,\"handle\":\"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0\",\"created_at\":\"2026-04-03T21:03:12.706435+00:00\",\"modified_at\":\"2026-04-03T21:03:12.706435+00:00\",\"email\":\"test-update_an_access_token_for_a_service_account_returns_ok_response-1775250192@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/8ef25c203ebdbe5e11acb74bd99ba7da?s=48&d=retro\",\"title\":\"user title\",\"verified\":true,\"service_account\":true,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n", "headers": { "Content-Type": [ "application/json" @@ -27,22 +27,22 @@ "timeToLive": { "unlimited": true }, - "id": "fcac50ec-362b-af11-9f23-2eea03a03b40" + "id": "284472d5-9973-7d0e-2c04-6ac82d23b165" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794\",\"scopes\":[\"dashboards_read\"]},\"type\":\"personal_access_tokens\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192\",\"scopes\":[\"dashboards_read\"]},\"type\":\"personal_access_tokens\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens", + "path": "/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"eafa3dd9-430d-4075-a183-63171c7f3de5\",\"type\":\"personal_access_tokens\",\"attributes\":{\"created_at\":\"2026-04-16T20:03:15.138533237Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794\",\"public_portion\":\"ddpat_79OZ2nUHcB3McO399ZaVVt\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4\",\"type\":\"users\"}}}}}", + "body": "{\"data\":{\"id\":\"9a7d27cc-4969-4a57-990c-03c23a9f2adc\",\"type\":\"personal_access_tokens\",\"attributes\":{\"alias\":\"4hW0tyOpjf5Dj84mZaXqwe\",\"created_at\":\"2026-04-03T21:03:12.978132411Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxXxxx_xxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192\",\"public_portion\":\"4hW0tyOpjf5Dj84mZaXqwe\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0\",\"type\":\"users\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,22 +57,22 @@ "timeToLive": { "unlimited": true }, - "id": "f623cff4-6c3a-0e83-71be-452b054aad18" + "id": "00c32353-a37b-6c00-e267-5c108c52d533" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794-updated\"},\"id\":\"eafa3dd9-430d-4075-a183-63171c7f3de5\",\"type\":\"personal_access_tokens\"}}" + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192-updated\"},\"id\":\"9a7d27cc-4969-4a57-990c-03c23a9f2adc\",\"type\":\"personal_access_tokens\"}}" }, "headers": {}, "method": "PATCH", - "path": "/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5", + "path": "/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens/9a7d27cc-4969-4a57-990c-03c23a9f2adc", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"eafa3dd9-430d-4075-a183-63171c7f3de5\",\"type\":\"personal_access_tokens\",\"attributes\":{\"created_at\":\"2026-04-16T20:03:15.138533Z\",\"expires_at\":null,\"last_used_at\":null,\"modified_at\":\"2026-04-16T20:03:15.375809Z\",\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794-updated\",\"public_portion\":\"ddpat_79OZ2nUHcB3McO399ZaVVt\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4\",\"type\":\"users\"}}}}}", + "body": "{\"data\":{\"id\":\"9a7d27cc-4969-4a57-990c-03c23a9f2adc\",\"type\":\"personal_access_tokens\",\"attributes\":{\"alias\":\"4hW0tyOpjf5Dj84mZaXqwe\",\"created_at\":\"2026-04-03T21:03:12.978132Z\",\"expires_at\":null,\"last_used_at\":null,\"modified_at\":\"2026-04-03T21:03:13.152078Z\",\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192-updated\",\"public_portion\":\"4hW0tyOpjf5Dj84mZaXqwe\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0\",\"type\":\"users\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "10f62515-3f2f-dceb-9e2f-46e87cf0e500" + "id": "601591e1-22a4-cbbd-2ab8-729d01a9e7bb" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5", + "path": "/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens/9a7d27cc-4969-4a57-990c-03c23a9f2adc", "keepAlive": false, "secure": true }, @@ -108,13 +108,13 @@ "timeToLive": { "unlimited": true }, - "id": "ade5368b-108f-866d-8803-6d4c5735ba3c" + "id": "d69fc8d6-6af5-6d67-b249-12a17d3fc28f" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4", + "path": "/api/v2/users/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0", "keepAlive": false, "secure": true }, @@ -129,6 +129,6 @@ "timeToLive": { "unlimited": true }, - "id": "a3dce74c-505e-2fbb-b31a-a8b86157dc12" + "id": "96de1c9c-aa07-1667-ed8e-5edd9be98b5e" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/key_management.feature b/src/test/resources/com/datadog/api/client/v2/api/key_management.feature index 365c53ed7c2..6c464845562 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/key_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/key_management.feature @@ -221,7 +221,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get a personal access token returns "Not Found" response Given new "GetPersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "pat_uuid" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -229,7 +229,7 @@ Feature: Key Management Scenario: Get a personal access token returns "OK" response Given there is a valid "personal_access_token" in the system And new "GetPersonalAccessToken" request - And request contains "pat_id" parameter from "personal_access_token.data.id" + And request contains "pat_uuid" parameter from "personal_access_token.data.id" When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "personal_access_tokens" @@ -355,21 +355,21 @@ Feature: Key Management Scenario: Revoke a personal access token returns "No Content" response Given there is a valid "personal_access_token" in the system And new "RevokePersonalAccessToken" request - And request contains "pat_id" parameter from "personal_access_token.data.id" + And request contains "pat_uuid" parameter from "personal_access_token.data.id" When the request is sent Then the response status is 204 No Content @generated @skip @team:DataDog/credentials-management Scenario: Revoke a personal access token returns "Not Found" response Given new "RevokePersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "pat_uuid" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Bad Request" response Given new "UpdatePersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "pat_uuid" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -377,7 +377,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Not Found" response Given new "UpdatePersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "pat_uuid" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -386,7 +386,7 @@ Feature: Key Management Scenario: Update a personal access token returns "OK" response Given there is a valid "personal_access_token" in the system And new "UpdatePersonalAccessToken" request - And request contains "pat_id" parameter from "personal_access_token.data.id" + And request contains "pat_uuid" parameter from "personal_access_token.data.id" And body with value {"data": {"type": "personal_access_tokens", "id": "{{ personal_access_token.data.id }}", "attributes": {"name": "{{ unique }}-updated"}}} When the request is sent Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/org_groups.feature b/src/test/resources/com/datadog/api/client/v2/api/org_groups.feature index b8c5fe1b61d..73cce63cd8e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/org_groups.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/org_groups.feature @@ -12,7 +12,7 @@ Feature: Org Groups Scenario: Bulk update org group memberships returns "Bad Request" response Given operation "BulkUpdateOrgGroupMemberships" enabled And new "BulkUpdateOrgGroupMemberships" request - And body with value {"data": {"attributes": {"orgs": [{"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} + And body with value {"data": {"attributes": {"orgs": [{"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} When the request is sent Then the response status is 400 Bad Request @@ -20,7 +20,7 @@ Feature: Org Groups Scenario: Bulk update org group memberships returns "Not Found" response Given operation "BulkUpdateOrgGroupMemberships" enabled And new "BulkUpdateOrgGroupMemberships" request - And body with value {"data": {"attributes": {"orgs": [{"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} + And body with value {"data": {"attributes": {"orgs": [{"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} When the request is sent Then the response status is 404 Not Found @@ -28,7 +28,7 @@ Feature: Org Groups Scenario: Bulk update org group memberships returns "OK" response Given operation "BulkUpdateOrgGroupMemberships" enabled And new "BulkUpdateOrgGroupMemberships" request - And body with value {"data": {"attributes": {"orgs": [{"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} + And body with value {"data": {"attributes": {"orgs": [{"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} When the request is sent Then the response status is 200 OK @@ -36,7 +36,7 @@ Feature: Org Groups Scenario: Create an org group policy override returns "Bad Request" response Given operation "CreateOrgGroupPolicyOverride" enabled And new "CreateOrgGroupPolicyOverride" request - And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 400 Bad Request @@ -44,7 +44,7 @@ Feature: Org Groups Scenario: Create an org group policy override returns "Conflict" response Given operation "CreateOrgGroupPolicyOverride" enabled And new "CreateOrgGroupPolicyOverride" request - And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 409 Conflict @@ -52,7 +52,7 @@ Feature: Org Groups Scenario: Create an org group policy override returns "Created" response Given operation "CreateOrgGroupPolicyOverride" enabled And new "CreateOrgGroupPolicyOverride" request - And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 201 Created @@ -60,7 +60,7 @@ Feature: Org Groups Scenario: Create an org group policy returns "Bad Request" response Given operation "CreateOrgGroupPolicy" enabled And new "CreateOrgGroupPolicy" request - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "policy_name": "monitor_timezone"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} When the request is sent Then the response status is 400 Bad Request @@ -68,7 +68,7 @@ Feature: Org Groups Scenario: Create an org group policy returns "Conflict" response Given operation "CreateOrgGroupPolicy" enabled And new "CreateOrgGroupPolicy" request - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "policy_name": "monitor_timezone"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} When the request is sent Then the response status is 409 Conflict @@ -76,7 +76,7 @@ Feature: Org Groups Scenario: Create an org group policy returns "Created" response Given operation "CreateOrgGroupPolicy" enabled And new "CreateOrgGroupPolicy" request - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "policy_name": "monitor_timezone"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} When the request is sent Then the response status is 201 Created @@ -200,54 +200,6 @@ Feature: Org Groups When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/org-management - Scenario: Get an org group policy override returns "Bad Request" response - Given operation "GetOrgGroupPolicyOverride" enabled - And new "GetOrgGroupPolicyOverride" request - And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/org-management - Scenario: Get an org group policy override returns "Not Found" response - Given operation "GetOrgGroupPolicyOverride" enabled - And new "GetOrgGroupPolicyOverride" request - And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/org-management - Scenario: Get an org group policy override returns "OK" response - Given operation "GetOrgGroupPolicyOverride" enabled - And new "GetOrgGroupPolicyOverride" request - And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/org-management - Scenario: Get an org group policy returns "Bad Request" response - Given operation "GetOrgGroupPolicy" enabled - And new "GetOrgGroupPolicy" request - And request contains "org_group_policy_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/org-management - Scenario: Get an org group policy returns "Not Found" response - Given operation "GetOrgGroupPolicy" enabled - And new "GetOrgGroupPolicy" request - And request contains "org_group_policy_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/org-management - Scenario: Get an org group policy returns "OK" response - Given operation "GetOrgGroupPolicy" enabled - And new "GetOrgGroupPolicy" request - And request contains "org_group_policy_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - @generated @skip @team:DataDog/org-management Scenario: Get an org group returns "Bad Request" response Given operation "GetOrgGroup" enabled @@ -371,7 +323,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicyOverride" enabled And new "UpdateOrgGroupPolicyOverride" request And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 400 Bad Request @@ -380,7 +332,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicyOverride" enabled And new "UpdateOrgGroupPolicyOverride" request And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 404 Not Found @@ -389,7 +341,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicyOverride" enabled And new "UpdateOrgGroupPolicyOverride" request And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 200 OK @@ -398,7 +350,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicy" enabled And new "UpdateOrgGroupPolicy" request And request contains "org_group_policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} When the request is sent Then the response status is 400 Bad Request @@ -407,7 +359,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicy" enabled And new "UpdateOrgGroupPolicy" request And request contains "org_group_policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} When the request is sent Then the response status is 404 Not Found @@ -416,7 +368,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicy" enabled And new "UpdateOrgGroupPolicy" request And request contains "org_group_policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} When the request is sent Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/organizations.feature b/src/test/resources/com/datadog/api/client/v2/api/organizations.feature index 45e56056c24..d50c9a305d5 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/organizations.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/organizations.feature @@ -41,6 +41,12 @@ Feature: Organizations When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/org-management + Scenario: List your managed organizations returns "OK" response + Given new "ListOrgs" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/org-management Scenario: Update a specific Org Config returns "Bad Request" response Given new "UpdateOrgConfig" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/service_accounts.feature b/src/test/resources/com/datadog/api/client/v2/api/service_accounts.feature index fa8c81440e2..25744abc832 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/service_accounts.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/service_accounts.feature @@ -142,7 +142,7 @@ Feature: Service Accounts Scenario: Get an access token for a service account returns "Not Found" response Given new "GetServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "pat_uuid" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -152,7 +152,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "GetServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_id" parameter from "service_account_access_token.data.id" + And request contains "pat_uuid" parameter from "service_account_access_token.data.id" When the request is sent Then the response status is 200 OK And the response "data.attributes.name" has the same value as "service_account_access_token.data.attributes.name" @@ -232,7 +232,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "RevokeServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_id" parameter from "service_account_access_token.data.id" + And request contains "pat_uuid" parameter from "service_account_access_token.data.id" When the request is sent Then the response status is 204 No Content @@ -240,7 +240,7 @@ Feature: Service Accounts Scenario: Revoke an access token for a service account returns "Not Found" response Given new "RevokeServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "pat_uuid" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -248,7 +248,7 @@ Feature: Service Accounts Scenario: Update an access token for a service account returns "Bad Request" response Given new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "pat_uuid" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -257,7 +257,7 @@ Feature: Service Accounts Scenario: Update an access token for a service account returns "Not Found" response Given new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "pat_uuid" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -268,7 +268,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_id" parameter from "service_account_access_token.data.id" + And request contains "pat_uuid" parameter from "service_account_access_token.data.id" And body with value {"data": {"id": "{{ service_account_access_token.data.id }}", "type": "personal_access_tokens", "attributes": {"name": "{{ service_account_access_token.data.attributes.name }}-updated"}}} 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 994abc25242..c154e02a9a2 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 @@ -4125,6 +4125,12 @@ "type": "safe" } }, + "ListOrgs": { + "tag": "Organizations", + "undo": { + "type": "safe" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": { @@ -4222,12 +4228,6 @@ "type": "unsafe" } }, - "GetOrgGroupPolicy": { - "tag": "Org Groups", - "undo": { - "type": "safe" - } - }, "UpdateOrgGroupPolicy": { "tag": "Org Groups", "undo": { @@ -4264,12 +4264,6 @@ "type": "unsafe" } }, - "GetOrgGroupPolicyOverride": { - "tag": "Org Groups", - "undo": { - "type": "safe" - } - }, "UpdateOrgGroupPolicyOverride": { "tag": "Org Groups", "undo": { @@ -4330,7 +4324,7 @@ "operationId": "RevokePersonalAccessToken", "parameters": [ { - "name": "pat_id", + "name": "pat_uuid", "source": "data.id" } ], @@ -5895,7 +5889,7 @@ "source": "data.relationships.owned_by.data.id" }, { - "name": "pat_id", + "name": "pat_uuid", "source": "data.id" } ], @@ -6975,6 +6969,12 @@ "type": "idempotent" } }, + "DeleteUserInvitations": { + "tag": "Users", + "undo": { + "type": "safe" + } + }, "ListUserOrganizations": { "tag": "Users", "undo": { diff --git a/src/test/resources/com/datadog/api/client/v2/api/users.feature b/src/test/resources/com/datadog/api/client/v2/api/users.feature index f64d3b89463..6e4f65eb57d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/users.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/users.feature @@ -25,6 +25,20 @@ Feature: Users And the response "data.attributes.disabled" is false And the response "data.attributes.service_account" is false + @generated @skip @team:DataDog/org-management + Scenario: Delete a pending user's invitations returns "Not found" response + Given new "DeleteUserInvitations" request + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not found + + @generated @skip @team:DataDog/org-management + Scenario: Delete a pending user's invitations returns "OK" response + Given new "DeleteUserInvitations" request + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/org-management Scenario: Disable a user returns "Not found" response Given new "DisableUser" request