diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4bc99f94bc1..9b60ce5912c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -93,6 +93,14 @@ components: required: true schema: type: string + AccessTokenID: + description: The ID of the access token. + in: path + name: token_id + required: true + schema: + example: "00000000-0000-1234-0000-000000000000" + type: string AnnotationEndTimeQueryParameter: description: End of the time window in milliseconds since the Unix epoch. example: 1704153600000 @@ -1278,18 +1286,10 @@ components: required: true schema: type: string - PersonalAccessTokenID: - description: The ID of the personal access token. - in: path - name: pat_id - required: true - schema: - example: "00000000-0000-1234-0000-000000000000" - type: string - PersonalAccessTokensFilterOwnerUUIDParameter: - description: Filter personal access tokens by the owner's UUID. Supports multiple values. + PersonalAccessTokensFilterOwnerIDParameter: + description: Filter access tokens by the owner's ID. Supports multiple values. in: query - name: filter[owner_uuid] + name: filter[owned_by] required: false schema: items: @@ -1297,7 +1297,7 @@ components: type: string type: array PersonalAccessTokensFilterParameter: - description: Filter personal access tokens by the specified string. + description: Filter access tokens by the specified string. in: query name: filter required: false @@ -1305,7 +1305,7 @@ components: type: string PersonalAccessTokensSortParameter: description: |- - Personal access token attribute used to sort results. Sort order is ascending + Access token attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign. in: query @@ -3421,6 +3421,45 @@ components: xray_services: $ref: "#/components/schemas/XRayServicesList" type: object + AccessTokenListItem: + description: An access token entry returned by the personal access tokens list endpoint. May represent either a personal or a service access token. + properties: + attributes: + $ref: "#/components/schemas/PersonalAccessTokenAttributes" + id: + description: ID of the access token. + type: string + relationships: + $ref: "#/components/schemas/AccessTokenListItemRelationships" + type: + $ref: "#/components/schemas/AccessTokensType" + type: object + AccessTokenListItemRelationships: + description: Resources related to the access token entry in the mixed list response. + properties: + owned_by: + $ref: "#/components/schemas/RelationshipToAccessTokenOwner" + type: object + AccessTokenOwnerType: + description: Owner resource type. Either a user or a service account. + enum: + - users + - service_account + example: users + type: string + x-enum-varnames: + - USERS + - SERVICE_ACCOUNT + AccessTokensType: + description: Resource type returned by the access tokens list endpoint. Includes both personal and service access tokens. + enum: + - personal_access_tokens + - service_access_tokens + example: personal_access_tokens + type: string + x-enum-varnames: + - PERSONAL_ACCESS_TOKENS + - SERVICE_ACCESS_TOKENS AccountFilteringConfig: description: The account filtering configuration. properties: @@ -35264,12 +35303,12 @@ components: - requirements type: object FullPersonalAccessToken: - description: Datadog personal access token, including the token key. + description: Datadog access token, including the token key. properties: attributes: $ref: "#/components/schemas/FullPersonalAccessTokenAttributes" id: - description: ID of the personal access token. + description: ID of the access token. type: string relationships: $ref: "#/components/schemas/PersonalAccessTokenRelationships" @@ -35277,36 +35316,88 @@ components: $ref: "#/components/schemas/PersonalAccessTokensType" type: object FullPersonalAccessTokenAttributes: - description: Attributes of a full personal access token, including the token key. + description: Attributes of a full access token, including the token key. properties: created_at: - description: Creation date of the personal access token. + description: Creation date of the access token. example: "2024-01-01T00:00:00+00:00" format: date-time readOnly: true type: string expires_at: - description: Expiration date of the personal access token. + description: Expiration date of the access token. example: "2025-12-31T23:59:59+00:00" format: date-time nullable: true readOnly: true type: string key: - description: The personal access token key. Only returned upon creation. + description: The access token key. Only returned upon creation. readOnly: true type: string name: - description: Name of the personal access token. - example: "My Personal Access Token" + description: Name of the access token. + example: "My Access Token" type: string public_portion: - description: The public portion of the personal access token. + description: The public portion of the access token. example: "ddpat_abc123" readOnly: true type: string scopes: - description: Array of scopes granted to the personal access token. + description: Array of scopes granted to the access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + type: object + FullServiceAccessToken: + description: Datadog access token, including the token key. + properties: + attributes: + $ref: "#/components/schemas/FullServiceAccessTokenAttributes" + id: + description: ID of the access token. + type: string + relationships: + $ref: "#/components/schemas/ServiceAccessTokenRelationships" + type: + $ref: "#/components/schemas/ServiceAccessTokensType" + type: object + FullServiceAccessTokenAttributes: + description: Attributes of a full access token, including the token key. + properties: + created_at: + description: Creation date of the access token. + example: "2024-01-01T00:00:00+00:00" + format: date-time + readOnly: true + type: string + expires_at: + description: Expiration date of the access token. + example: "2025-12-31T23:59:59+00:00" + format: date-time + nullable: true + readOnly: true + type: string + key: + description: The access token key. Only returned upon creation. + readOnly: true + type: string + name: + description: Name of the access token. + example: "My Access Token" + type: string + public_portion: + description: The public portion of the access token. + example: "ddsat_abc123" + readOnly: true + type: string + scopes: + description: Array of scopes granted to the access token. example: - "dashboards_read" - "dashboards_write" @@ -49442,12 +49533,12 @@ components: type: array type: object ListPersonalAccessTokensResponse: - description: Response for a list of personal access tokens. + description: Response for a list of access tokens. Includes both personal and service access tokens. properties: data: - description: Array of personal access tokens. + description: Array of access tokens. Includes both personal and service access tokens. items: - $ref: "#/components/schemas/PersonalAccessToken" + $ref: "#/components/schemas/AccessTokenListItem" type: array meta: $ref: "#/components/schemas/PersonalAccessTokenResponseMeta" @@ -49617,6 +49708,17 @@ components: meta: $ref: "#/components/schemas/SecurityFindingsMeta" type: object + ListServiceAccessTokensResponse: + description: Response for a list of access tokens. + properties: + data: + description: Array of access tokens. + items: + $ref: "#/components/schemas/ServiceAccessToken" + type: array + meta: + $ref: "#/components/schemas/ServiceAccessTokenResponseMeta" + type: object ListTagsResponse: description: List tags response. properties: @@ -64454,12 +64556,12 @@ components: x-enum-varnames: - PERMISSIONS PersonalAccessToken: - description: Datadog personal access token. + description: Datadog access token. properties: attributes: $ref: "#/components/schemas/PersonalAccessTokenAttributes" id: - description: ID of the personal access token. + description: ID of the access token. type: string relationships: $ref: "#/components/schemas/PersonalAccessTokenRelationships" @@ -64467,46 +64569,46 @@ components: $ref: "#/components/schemas/PersonalAccessTokensType" type: object PersonalAccessTokenAttributes: - description: Attributes of a personal access token. + description: Attributes of an access token. properties: created_at: - description: Creation date of the personal access token. + description: Creation date of the access token. example: "2024-01-01T00:00:00+00:00" format: date-time readOnly: true type: string expires_at: - description: Expiration date of the personal access token. + description: Expiration date of the access token. example: "2025-12-31T23:59:59+00:00" format: date-time nullable: true readOnly: true type: string last_used_at: - description: Date the personal access token was last used. + description: Date the access token was last used. example: "2025-06-15T12:30:00+00:00" format: date-time nullable: true readOnly: true type: string modified_at: - description: Date of last modification of the personal access token. + description: Date of last modification of the access token. example: "2024-06-01T00:00:00+00:00" format: date-time nullable: true readOnly: true type: string name: - description: Name of the personal access token. - example: "My Personal Access Token" + description: Name of the access token. + example: "My Access Token" type: string public_portion: - description: The public portion of the personal access token. + description: The public portion of the access token. example: "ddpat_abc123" readOnly: true type: string scopes: - description: Array of scopes granted to the personal access token. + description: Array of scopes granted to the access token. example: - "dashboards_read" - "dashboards_write" @@ -64516,19 +64618,19 @@ components: type: array type: object PersonalAccessTokenCreateAttributes: - description: Attributes used to create a personal access token. + description: Attributes used to create an access token. properties: expires_at: - description: Expiration date of the personal access token. Must be at least 24 hours in the future. + description: Expiration date of the access token. Must be at least 24 hours in the future. example: "2025-12-31T23:59:59+00:00" format: date-time type: string name: - description: Name of the personal access token. + description: Name of the access token. example: "My Personal Access Token" type: string scopes: - description: Array of scopes to grant the personal access token. + description: Array of scopes to grant the access token. example: - "dashboards_read" - "dashboards_write" @@ -64542,7 +64644,7 @@ components: - expires_at type: object PersonalAccessTokenCreateData: - description: Object used to create a personal access token. + description: Object used to create an access token. properties: attributes: $ref: "#/components/schemas/PersonalAccessTokenCreateAttributes" @@ -64553,7 +64655,7 @@ components: - type type: object PersonalAccessTokenCreateRequest: - description: Request used to create a personal access token. + description: Request used to create an access token. properties: data: $ref: "#/components/schemas/PersonalAccessTokenCreateData" @@ -64561,25 +64663,25 @@ components: - data type: object PersonalAccessTokenCreateResponse: - description: Response for creating a personal access token. Includes the token key. + description: Response for creating an access token. Includes the token key. properties: data: $ref: "#/components/schemas/FullPersonalAccessToken" type: object PersonalAccessTokenRelationships: - description: Resources related to the personal access token. + description: Resources related to the access token. properties: owned_by: $ref: "#/components/schemas/RelationshipToUser" type: object PersonalAccessTokenResponse: - description: Response for retrieving a personal access token. + description: Response for retrieving an access token. properties: data: $ref: "#/components/schemas/PersonalAccessToken" type: object PersonalAccessTokenResponseMeta: - description: Additional information related to the personal access token response. + description: Additional information related to the access token response. properties: page: $ref: "#/components/schemas/PersonalAccessTokenResponseMetaPage" @@ -64588,19 +64690,19 @@ components: description: Pagination information. properties: total_filtered_count: - description: Total filtered personal access token count. + description: Total filtered access token count. format: int64 type: integer type: object PersonalAccessTokenUpdateAttributes: - description: Attributes used to update a personal access token. + description: Attributes used to update an access token. properties: name: - description: Name of the personal access token. + description: Name of the access token. example: "Updated Personal Access Token" type: string scopes: - description: Array of scopes to grant the personal access token. + description: Array of scopes to grant the access token. example: - "dashboards_read" - "dashboards_write" @@ -64610,12 +64712,12 @@ components: type: array type: object PersonalAccessTokenUpdateData: - description: Object used to update a personal access token. + description: Object used to update an access token. properties: attributes: $ref: "#/components/schemas/PersonalAccessTokenUpdateAttributes" id: - description: ID of the personal access token. + description: ID of the access token. example: "00112233-4455-6677-8899-aabbccddeeff" type: string type: @@ -64626,7 +64728,7 @@ components: - type type: object PersonalAccessTokenUpdateRequest: - description: Request used to update a personal access token. + description: Request used to update an access token. properties: data: $ref: "#/components/schemas/PersonalAccessTokenUpdateData" @@ -64643,6 +64745,8 @@ components: - -created_at - expires_at - -expires_at + - last_used_at + - -last_used_at type: string x-enum-varnames: - NAME_ASCENDING @@ -64651,6 +64755,8 @@ components: - CREATED_AT_DESCENDING - EXPIRES_AT_ASCENDING - EXPIRES_AT_DESCENDING + - LAST_USED_AT_ASCENDING + - LAST_USED_AT_DESCENDING PersonalAccessTokensType: default: personal_access_tokens description: Personal access tokens resource type. @@ -68021,6 +68127,27 @@ components: description: Relationship type. type: string type: object + RelationshipToAccessTokenOwner: + description: Relationship to the access token's owner. + properties: + data: + $ref: "#/components/schemas/RelationshipToAccessTokenOwnerData" + required: + - data + type: object + RelationshipToAccessTokenOwnerData: + description: Relationship to the access token's owner. + properties: + id: + description: A unique identifier that represents the owner. + example: "00000000-0000-0000-2345-000000000000" + type: string + type: + $ref: "#/components/schemas/AccessTokenOwnerType" + required: + - id + - type + type: object RelationshipToIncident: description: Relationship to incident. properties: @@ -68379,6 +68506,27 @@ components: - id - type type: object + RelationshipToServiceAccount: + description: Relationship to service account. + properties: + data: + $ref: "#/components/schemas/RelationshipToServiceAccountData" + required: + - data + type: object + RelationshipToServiceAccountData: + description: Relationship to service account object. + properties: + id: + description: A unique identifier that represents the service account. + example: "00000000-0000-0000-2345-000000000000" + type: string + type: + $ref: "#/components/schemas/ServiceAccountType" + required: + - id + - type + type: object RelationshipToTeam: description: Relationship to team. properties: @@ -79462,6 +79610,109 @@ components: - REPLACEMENT_STRING - PARTIAL_REPLACEMENT_FROM_BEGINNING - PARTIAL_REPLACEMENT_FROM_END + ServiceAccessToken: + description: Datadog access token. + properties: + attributes: + $ref: "#/components/schemas/ServiceAccessTokenAttributes" + id: + description: ID of the access token. + type: string + relationships: + $ref: "#/components/schemas/ServiceAccessTokenRelationships" + type: + $ref: "#/components/schemas/ServiceAccessTokensType" + type: object + ServiceAccessTokenAttributes: + description: Attributes of an access token. + properties: + created_at: + description: Creation date of the access token. + example: "2024-01-01T00:00:00+00:00" + format: date-time + readOnly: true + type: string + expires_at: + description: Expiration date of the access token. + example: "2025-12-31T23:59:59+00:00" + format: date-time + nullable: true + readOnly: true + type: string + last_used_at: + description: Date the access token was last used. + example: "2025-06-15T12:30:00+00:00" + format: date-time + nullable: true + readOnly: true + type: string + modified_at: + description: Date of last modification of the access token. + example: "2024-06-01T00:00:00+00:00" + format: date-time + nullable: true + readOnly: true + type: string + name: + description: Name of the access token. + example: "My Access Token" + type: string + public_portion: + description: The public portion of the access token. + example: "ddsat_abc123" + readOnly: true + type: string + scopes: + description: Array of scopes granted to the access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + type: object + ServiceAccessTokenCreateResponse: + description: Response for creating an access token. Includes the token key. + properties: + data: + $ref: "#/components/schemas/FullServiceAccessToken" + type: object + ServiceAccessTokenRelationships: + description: Resources related to the access token. + properties: + owned_by: + $ref: "#/components/schemas/RelationshipToServiceAccount" + type: object + ServiceAccessTokenResponse: + description: Response for retrieving an access token. + properties: + data: + $ref: "#/components/schemas/ServiceAccessToken" + type: object + ServiceAccessTokenResponseMeta: + description: Additional information related to the access token response. + properties: + page: + $ref: "#/components/schemas/ServiceAccessTokenResponseMetaPage" + type: object + ServiceAccessTokenResponseMetaPage: + description: Pagination information. + properties: + total_filtered_count: + description: Total filtered access token count. + format: int64 + type: integer + type: object + ServiceAccessTokensType: + default: service_access_tokens + description: Service access tokens resource type. + enum: + - service_access_tokens + example: service_access_tokens + type: string + x-enum-varnames: + - SERVICE_ACCESS_TOKENS ServiceAccountAccessTokenCreateAttributes: description: Attributes used to create a service account access token. properties: @@ -79493,7 +79744,7 @@ components: attributes: $ref: "#/components/schemas/ServiceAccountAccessTokenCreateAttributes" type: - $ref: "#/components/schemas/PersonalAccessTokensType" + $ref: "#/components/schemas/ServiceAccessTokensType" required: - attributes - type @@ -79506,6 +79757,47 @@ components: required: - data type: object + ServiceAccountAccessTokenUpdateAttributes: + description: Attributes used to update a service account access token. + properties: + name: + description: Name of the access token. + example: "Updated Service Access Token" + type: string + scopes: + description: Array of scopes to grant the access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + type: object + ServiceAccountAccessTokenUpdateData: + description: Object used to update a service account access token. + properties: + attributes: + $ref: "#/components/schemas/ServiceAccountAccessTokenUpdateAttributes" + id: + description: ID of the access token. + example: "00112233-4455-6677-8899-aabbccddeeff" + type: string + type: + $ref: "#/components/schemas/ServiceAccessTokensType" + required: + - attributes + - id + - type + type: object + ServiceAccountAccessTokenUpdateRequest: + description: Request used to update a service account access token. + properties: + data: + $ref: "#/components/schemas/ServiceAccountAccessTokenUpdateData" + required: + - data + type: object ServiceAccountCreateAttributes: description: Attributes of the created user. properties: @@ -79548,6 +79840,14 @@ components: required: - data type: object + ServiceAccountType: + description: Service account resource type. + enum: + - service_account + example: service_account + type: string + x-enum-varnames: + - SERVICE_ACCOUNT ServiceDefinitionCreateResponse: description: Create service definitions response. properties: @@ -140254,14 +140554,14 @@ paths: - user_access_read /api/v2/personal_access_tokens: get: - description: List all personal access tokens for the organization. + description: List all access tokens for the organization. operationId: ListPersonalAccessTokens parameters: - $ref: "#/components/parameters/PageSize" - $ref: "#/components/parameters/PageNumber" - $ref: "#/components/parameters/PersonalAccessTokensSortParameter" - $ref: "#/components/parameters/PersonalAccessTokensFilterParameter" - - $ref: "#/components/parameters/PersonalAccessTokensFilterOwnerUUIDParameter" + - $ref: "#/components/parameters/PersonalAccessTokensFilterOwnerIDParameter" responses: "200": content: @@ -140274,6 +140574,7 @@ paths: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" name: My Personal Access Token + public_portion: ddpat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000002 @@ -140298,7 +140599,7 @@ paths: description: Forbidden "429": $ref: "#/components/responses/TooManyRequestsResponse" - summary: Get all personal access tokens + summary: Get all access tokens tags: - Key Management "x-permission": @@ -140369,12 +140670,12 @@ paths: operator: OR permissions: - user_app_keys - /api/v2/personal_access_tokens/{pat_id}: + /api/v2/personal_access_tokens/{token_id}: delete: description: Revoke a specific personal access token. operationId: RevokePersonalAccessToken parameters: - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" responses: "204": description: No Content @@ -140401,10 +140702,10 @@ paths: - user_app_keys - org_app_keys_write get: - description: Get a specific personal access token by its UUID. + description: Get a specific personal access token by its ID. operationId: GetPersonalAccessToken parameters: - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" responses: "200": content: @@ -140417,6 +140718,7 @@ paths: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" name: My Personal Access Token + public_portion: ddpat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000003 @@ -140450,7 +140752,7 @@ paths: description: Update a specific personal access token. operationId: UpdatePersonalAccessToken parameters: - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" requestBody: content: application/json: @@ -140480,6 +140782,7 @@ paths: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" name: My Personal Access Token + public_portion: ddpat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000004 @@ -156110,16 +156413,17 @@ paths: - attributes: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" - name: My Personal Access Token + name: My Service Access Token + public_portion: ddsat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000005 - type: personal_access_tokens + type: service_access_tokens meta: page: total_filtered_count: 1 schema: - $ref: "#/components/schemas/ListPersonalAccessTokensResponse" + $ref: "#/components/schemas/ListServiceAccessTokensResponse" description: OK "400": content: @@ -156165,7 +156469,7 @@ paths: scopes: - dashboards_read - dashboards_write - type: personal_access_tokens + type: service_access_tokens schema: $ref: "#/components/schemas/ServiceAccountAccessTokenCreateRequest" required: true @@ -156181,14 +156485,14 @@ paths: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" key: "" - name: My Personal Access Token - public_portion: ddpat_abc123 + name: My Service Access Token + public_portion: ddsat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000006 - type: personal_access_tokens + type: service_access_tokens schema: - $ref: "#/components/schemas/PersonalAccessTokenCreateResponse" + $ref: "#/components/schemas/ServiceAccessTokenCreateResponse" description: Created "400": content: @@ -156218,13 +156522,13 @@ 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/{token_id}: delete: description: Revoke a specific access token for a service account. operationId: RevokeServiceAccountAccessToken parameters: - $ref: "#/components/parameters/ServiceAccountID" - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" responses: "204": description: No Content @@ -156250,11 +156554,11 @@ paths: permissions: - service_account_write get: - description: Get a specific access token for a service account by its UUID. + description: Get a specific access token for a service account by its ID. operationId: GetServiceAccountAccessToken parameters: - $ref: "#/components/parameters/ServiceAccountID" - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" responses: "200": content: @@ -156266,13 +156570,14 @@ paths: attributes: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" - name: My Personal Access Token + name: My Service Access Token + public_portion: ddsat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000007 - type: personal_access_tokens + type: service_access_tokens schema: - $ref: "#/components/schemas/PersonalAccessTokenResponse" + $ref: "#/components/schemas/ServiceAccessTokenResponse" description: OK "403": content: @@ -156300,7 +156605,7 @@ paths: operationId: UpdateServiceAccountAccessToken parameters: - $ref: "#/components/parameters/ServiceAccountID" - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" requestBody: content: application/json: @@ -156309,14 +156614,14 @@ paths: value: data: attributes: - name: Updated Personal Access Token + name: Updated Service Access Token scopes: - dashboards_read - dashboards_write id: 00112233-4455-6677-8899-aabbccddeeff - type: personal_access_tokens + type: service_access_tokens schema: - $ref: "#/components/schemas/PersonalAccessTokenUpdateRequest" + $ref: "#/components/schemas/ServiceAccountAccessTokenUpdateRequest" required: true responses: "200": @@ -156329,13 +156634,14 @@ paths: attributes: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" - name: My Personal Access Token + name: My Service Access Token + public_portion: ddsat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000008 - type: personal_access_tokens + type: service_access_tokens schema: - $ref: "#/components/schemas/PersonalAccessTokenResponse" + $ref: "#/components/schemas/ServiceAccessTokenResponse" description: OK "400": content: diff --git a/examples/v2/key-management/ListPersonalAccessTokens.java b/examples/v2/key-management/ListPersonalAccessTokens.java index c783941a07a..60a96f54db3 100644 --- a/examples/v2/key-management/ListPersonalAccessTokens.java +++ b/examples/v2/key-management/ListPersonalAccessTokens.java @@ -1,4 +1,4 @@ -// Get all personal access tokens returns "OK" response +// Get all access tokens returns "OK" response import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; diff --git a/examples/v2/key-management/ListPersonalAccessTokens_4153414404.java b/examples/v2/key-management/ListPersonalAccessTokens_4153414404.java new file mode 100644 index 00000000000..c783941a07a --- /dev/null +++ b/examples/v2/key-management/ListPersonalAccessTokens_4153414404.java @@ -0,0 +1,24 @@ +// Get all personal access tokens returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.KeyManagementApi; +import com.datadog.api.client.v2.model.ListPersonalAccessTokensResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + KeyManagementApi apiInstance = new KeyManagementApi(defaultClient); + + try { + ListPersonalAccessTokensResponse result = apiInstance.listPersonalAccessTokens(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling KeyManagementApi#listPersonalAccessTokens"); + 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/service-accounts/CreateServiceAccountAccessToken.java b/examples/v2/service-accounts/CreateServiceAccountAccessToken.java index 94fa145b951..a43e832c7be 100644 --- a/examples/v2/service-accounts/CreateServiceAccountAccessToken.java +++ b/examples/v2/service-accounts/CreateServiceAccountAccessToken.java @@ -3,8 +3,8 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.ServiceAccountsApi; -import com.datadog.api.client.v2.model.PersonalAccessTokenCreateResponse; -import com.datadog.api.client.v2.model.PersonalAccessTokensType; +import com.datadog.api.client.v2.model.ServiceAccessTokenCreateResponse; +import com.datadog.api.client.v2.model.ServiceAccessTokensType; import com.datadog.api.client.v2.model.ServiceAccountAccessTokenCreateAttributes; import com.datadog.api.client.v2.model.ServiceAccountAccessTokenCreateData; import com.datadog.api.client.v2.model.ServiceAccountAccessTokenCreateRequest; @@ -22,14 +22,14 @@ public static void main(String[] args) { new ServiceAccountAccessTokenCreateRequest() .data( new ServiceAccountAccessTokenCreateData() - .type(PersonalAccessTokensType.PERSONAL_ACCESS_TOKENS) + .type(ServiceAccessTokensType.SERVICE_ACCESS_TOKENS) .attributes( new ServiceAccountAccessTokenCreateAttributes() .name("Example-Service-Account") .scopes(Collections.singletonList("dashboards_read")))); try { - PersonalAccessTokenCreateResponse result = + ServiceAccessTokenCreateResponse result = apiInstance.createServiceAccountAccessToken(SERVICE_ACCOUNT_USER_DATA_ID, body); System.out.println(result); } catch (ApiException e) { diff --git a/examples/v2/service-accounts/GetServiceAccountAccessToken.java b/examples/v2/service-accounts/GetServiceAccountAccessToken.java index 95e1d05b15f..ec45934b3ce 100644 --- a/examples/v2/service-accounts/GetServiceAccountAccessToken.java +++ b/examples/v2/service-accounts/GetServiceAccountAccessToken.java @@ -3,7 +3,7 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.ServiceAccountsApi; -import com.datadog.api.client.v2.model.PersonalAccessTokenResponse; +import com.datadog.api.client.v2.model.ServiceAccessTokenResponse; public class Example { public static void main(String[] args) { @@ -18,7 +18,7 @@ public static void main(String[] args) { System.getenv("SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID"); try { - PersonalAccessTokenResponse result = + ServiceAccessTokenResponse result = apiInstance.getServiceAccountAccessToken( SERVICE_ACCOUNT_USER_DATA_ID, SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID); System.out.println(result); diff --git a/examples/v2/service-accounts/ListServiceAccountAccessTokens.java b/examples/v2/service-accounts/ListServiceAccountAccessTokens.java index 5e10e0f99b0..9c16426808a 100644 --- a/examples/v2/service-accounts/ListServiceAccountAccessTokens.java +++ b/examples/v2/service-accounts/ListServiceAccountAccessTokens.java @@ -3,7 +3,7 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.ServiceAccountsApi; -import com.datadog.api.client.v2.model.ListPersonalAccessTokensResponse; +import com.datadog.api.client.v2.model.ListServiceAccessTokensResponse; public class Example { public static void main(String[] args) { @@ -14,7 +14,7 @@ public static void main(String[] args) { String SERVICE_ACCOUNT_USER_DATA_ID = System.getenv("SERVICE_ACCOUNT_USER_DATA_ID"); try { - ListPersonalAccessTokensResponse result = + ListServiceAccessTokensResponse result = apiInstance.listServiceAccountAccessTokens(SERVICE_ACCOUNT_USER_DATA_ID); System.out.println(result); } catch (ApiException e) { diff --git a/examples/v2/service-accounts/UpdateServiceAccountAccessToken.java b/examples/v2/service-accounts/UpdateServiceAccountAccessToken.java index df1642835f8..dfd00ac55dc 100644 --- a/examples/v2/service-accounts/UpdateServiceAccountAccessToken.java +++ b/examples/v2/service-accounts/UpdateServiceAccountAccessToken.java @@ -3,11 +3,11 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.ServiceAccountsApi; -import com.datadog.api.client.v2.model.PersonalAccessTokenResponse; -import com.datadog.api.client.v2.model.PersonalAccessTokenUpdateAttributes; -import com.datadog.api.client.v2.model.PersonalAccessTokenUpdateData; -import com.datadog.api.client.v2.model.PersonalAccessTokenUpdateRequest; -import com.datadog.api.client.v2.model.PersonalAccessTokensType; +import com.datadog.api.client.v2.model.ServiceAccessTokenResponse; +import com.datadog.api.client.v2.model.ServiceAccessTokensType; +import com.datadog.api.client.v2.model.ServiceAccountAccessTokenUpdateAttributes; +import com.datadog.api.client.v2.model.ServiceAccountAccessTokenUpdateData; +import com.datadog.api.client.v2.model.ServiceAccountAccessTokenUpdateRequest; public class Example { public static void main(String[] args) { @@ -23,18 +23,18 @@ public static void main(String[] args) { String SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID = System.getenv("SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID"); - PersonalAccessTokenUpdateRequest body = - new PersonalAccessTokenUpdateRequest() + ServiceAccountAccessTokenUpdateRequest body = + new ServiceAccountAccessTokenUpdateRequest() .data( - new PersonalAccessTokenUpdateData() + new ServiceAccountAccessTokenUpdateData() .id(SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID) - .type(PersonalAccessTokensType.PERSONAL_ACCESS_TOKENS) + .type(ServiceAccessTokensType.SERVICE_ACCESS_TOKENS) .attributes( - new PersonalAccessTokenUpdateAttributes() - .name("My Personal Access Token-updated"))); + new ServiceAccountAccessTokenUpdateAttributes() + .name("My Access Token-updated"))); try { - PersonalAccessTokenResponse result = + ServiceAccessTokenResponse result = apiInstance.updateServiceAccountAccessToken( SERVICE_ACCOUNT_USER_DATA_ID, SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, body); System.out.println(result); 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 7a76aa75497..f4145ef3720 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 @@ -1404,12 +1404,12 @@ public ApiResponse getCurrentUserApplicationKeyWithHttpI * *

See {@link #getPersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the 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 tokenId) throws ApiException { + return getPersonalAccessTokenWithHttpInfo(tokenId).getData(); } /** @@ -1417,11 +1417,12 @@ public PersonalAccessTokenResponse getPersonalAccessToken(String patId) throws A * *

See {@link #getPersonalAccessTokenWithHttpInfoAsync}. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the access token. (required) * @return CompletableFuture<PersonalAccessTokenResponse> */ - public CompletableFuture getPersonalAccessTokenAsync(String patId) { - return getPersonalAccessTokenWithHttpInfoAsync(patId) + public CompletableFuture getPersonalAccessTokenAsync( + String tokenId) { + return getPersonalAccessTokenWithHttpInfoAsync(tokenId) .thenApply( response -> { return response.getData(); @@ -1429,9 +1430,9 @@ public CompletableFuture getPersonalAccessTokenAsyn } /** - * Get a specific personal access token by its UUID. + * Get a specific personal access token by its ID. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the access token. (required) * @return ApiResponse<PersonalAccessTokenResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -1444,19 +1445,19 @@ public CompletableFuture getPersonalAccessTokenAsyn * 429 Too many requests - * */ - public ApiResponse getPersonalAccessTokenWithHttpInfo(String patId) + public ApiResponse getPersonalAccessTokenWithHttpInfo(String tokenId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { throw new ApiException( - 400, "Missing the required parameter 'patId' when calling getPersonalAccessToken"); + 400, "Missing the required parameter 'tokenId' 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/{token_id}" + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1485,26 +1486,26 @@ public ApiResponse getPersonalAccessTokenWithHttpIn * *

See {@link #getPersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the access token. (required) * @return CompletableFuture<ApiResponse<PersonalAccessTokenResponse>> */ public CompletableFuture> - getPersonalAccessTokenWithHttpInfoAsync(String patId) { + getPersonalAccessTokenWithHttpInfoAsync(String tokenId) { Object localVarPostBody = null; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'patId' when calling getPersonalAccessToken")); + 400, "Missing the required parameter 'tokenId' 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/{token_id}" + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -2453,7 +2454,7 @@ public static class ListPersonalAccessTokensOptionalParameters { private Long pageNumber; private PersonalAccessTokensSort sort; private String filter; - private List filterOwnerUuid; + private List filterOwnedBy; /** * Set pageSize. @@ -2481,9 +2482,9 @@ public ListPersonalAccessTokensOptionalParameters pageNumber(Long pageNumber) { /** * Set sort. * - * @param sort Personal access token attribute used to sort results. Sort order is ascending by - * default. In order to specify a descending sort, prefix the attribute with a minus sign. - * (optional, default to "name") + * @param sort Access token attribute used to sort results. Sort order is ascending by default. + * In order to specify a descending sort, prefix the attribute with a minus sign. (optional, + * default to "name") * @return ListPersonalAccessTokensOptionalParameters */ public ListPersonalAccessTokensOptionalParameters sort(PersonalAccessTokensSort sort) { @@ -2494,7 +2495,7 @@ public ListPersonalAccessTokensOptionalParameters sort(PersonalAccessTokensSort /** * Set filter. * - * @param filter Filter personal access tokens by the specified string. (optional) + * @param filter Filter access tokens by the specified string. (optional) * @return ListPersonalAccessTokensOptionalParameters */ public ListPersonalAccessTokensOptionalParameters filter(String filter) { @@ -2503,21 +2504,20 @@ public ListPersonalAccessTokensOptionalParameters filter(String filter) { } /** - * Set filterOwnerUuid. + * Set filterOwnedBy. * - * @param filterOwnerUuid Filter personal access tokens by the owner's UUID. Supports multiple - * values. (optional) + * @param filterOwnedBy Filter access tokens by the owner's ID. Supports multiple values. + * (optional) * @return ListPersonalAccessTokensOptionalParameters */ - public ListPersonalAccessTokensOptionalParameters filterOwnerUuid( - List filterOwnerUuid) { - this.filterOwnerUuid = filterOwnerUuid; + public ListPersonalAccessTokensOptionalParameters filterOwnedBy(List filterOwnedBy) { + this.filterOwnedBy = filterOwnedBy; return this; } } /** - * Get all personal access tokens. + * Get all access tokens. * *

See {@link #listPersonalAccessTokensWithHttpInfo}. * @@ -2530,7 +2530,7 @@ public ListPersonalAccessTokensResponse listPersonalAccessTokens() throws ApiExc } /** - * Get all personal access tokens. + * Get all access tokens. * *

See {@link #listPersonalAccessTokensWithHttpInfoAsync}. * @@ -2546,7 +2546,7 @@ public CompletableFuture listPersonalAccessTok } /** - * Get all personal access tokens. + * Get all access tokens. * *

See {@link #listPersonalAccessTokensWithHttpInfo}. * @@ -2560,7 +2560,7 @@ public ListPersonalAccessTokensResponse listPersonalAccessTokens( } /** - * Get all personal access tokens. + * Get all access tokens. * *

See {@link #listPersonalAccessTokensWithHttpInfoAsync}. * @@ -2577,7 +2577,7 @@ public CompletableFuture listPersonalAccessTok } /** - * List all personal access tokens for the organization. + * List all access tokens for the organization. * * @param parameters Optional parameters for the request. * @return ApiResponse<ListPersonalAccessTokensResponse> @@ -2599,7 +2599,7 @@ public ApiResponse listPersonalAccessTokensWit Long pageNumber = parameters.pageNumber; PersonalAccessTokensSort sort = parameters.sort; String filter = parameters.filter; - List filterOwnerUuid = parameters.filterOwnerUuid; + List filterOwnedBy = parameters.filterOwnedBy; // create path and map variables String localVarPath = "/api/v2/personal_access_tokens"; @@ -2611,7 +2611,7 @@ public ApiResponse listPersonalAccessTokensWit localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); localVarQueryParams.addAll( - apiClient.parameterToPairs("multi", "filter[owner_uuid]", filterOwnerUuid)); + apiClient.parameterToPairs("multi", "filter[owned_by]", filterOwnedBy)); Invocation.Builder builder = apiClient.createBuilder( @@ -2634,7 +2634,7 @@ public ApiResponse listPersonalAccessTokensWit } /** - * Get all personal access tokens. + * Get all access tokens. * *

See {@link #listPersonalAccessTokensWithHttpInfo}. * @@ -2649,7 +2649,7 @@ public ApiResponse listPersonalAccessTokensWit Long pageNumber = parameters.pageNumber; PersonalAccessTokensSort sort = parameters.sort; String filter = parameters.filter; - List filterOwnerUuid = parameters.filterOwnerUuid; + List filterOwnedBy = parameters.filterOwnedBy; // create path and map variables String localVarPath = "/api/v2/personal_access_tokens"; @@ -2661,7 +2661,7 @@ public ApiResponse listPersonalAccessTokensWit localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); localVarQueryParams.addAll( - apiClient.parameterToPairs("multi", "filter[owner_uuid]", filterOwnerUuid)); + apiClient.parameterToPairs("multi", "filter[owned_by]", filterOwnedBy)); Invocation.Builder builder; try { @@ -2696,11 +2696,11 @@ public ApiResponse listPersonalAccessTokensWit * *

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

See {@link #revokePersonalAccessTokenWithHttpInfoAsync}. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the access token. (required) * @return CompletableFuture */ - public CompletableFuture revokePersonalAccessTokenAsync(String patId) { - return revokePersonalAccessTokenWithHttpInfoAsync(patId) + public CompletableFuture revokePersonalAccessTokenAsync(String tokenId) { + return revokePersonalAccessTokenWithHttpInfoAsync(tokenId) .thenApply( response -> { return response.getData(); @@ -2722,7 +2722,7 @@ public CompletableFuture revokePersonalAccessTokenAsync(String patId) { /** * Revoke a specific personal access token. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the access token. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -2735,18 +2735,19 @@ public CompletableFuture revokePersonalAccessTokenAsync(String patId) { * 429 Too many requests - * */ - public ApiResponse revokePersonalAccessTokenWithHttpInfo(String patId) throws ApiException { + public ApiResponse revokePersonalAccessTokenWithHttpInfo(String tokenId) + throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { throw new ApiException( - 400, "Missing the required parameter 'patId' when calling revokePersonalAccessToken"); + 400, "Missing the required parameter 'tokenId' 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/{token_id}" + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -2775,26 +2776,26 @@ public ApiResponse revokePersonalAccessTokenWithHttpInfo(String patId) thr * *

See {@link #revokePersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the access token. (required) * @return CompletableFuture<ApiResponse<Void>> */ public CompletableFuture> revokePersonalAccessTokenWithHttpInfoAsync( - String patId) { + String tokenId) { Object localVarPostBody = null; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling revokePersonalAccessToken")); + "Missing the required parameter 'tokenId' 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/{token_id}" + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -3310,14 +3311,14 @@ public ApiResponse updateCurrentUserApplicationKeyWithHt * *

See {@link #updatePersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the 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 tokenId, PersonalAccessTokenUpdateRequest body) throws ApiException { + return updatePersonalAccessTokenWithHttpInfo(tokenId, body).getData(); } /** @@ -3325,13 +3326,13 @@ public PersonalAccessTokenResponse updatePersonalAccessToken( * *

See {@link #updatePersonalAccessTokenWithHttpInfoAsync}. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the access token. (required) * @param body (required) * @return CompletableFuture<PersonalAccessTokenResponse> */ public CompletableFuture updatePersonalAccessTokenAsync( - String patId, PersonalAccessTokenUpdateRequest body) { - return updatePersonalAccessTokenWithHttpInfoAsync(patId, body) + String tokenId, PersonalAccessTokenUpdateRequest body) { + return updatePersonalAccessTokenWithHttpInfoAsync(tokenId, body) .thenApply( response -> { return response.getData(); @@ -3341,7 +3342,7 @@ public CompletableFuture updatePersonalAccessTokenA /** * Update a specific personal access token. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the access token. (required) * @param body (required) * @return ApiResponse<PersonalAccessTokenResponse> * @throws ApiException if fails to make API call @@ -3357,13 +3358,13 @@ public CompletableFuture updatePersonalAccessTokenA * */ public ApiResponse updatePersonalAccessTokenWithHttpInfo( - String patId, PersonalAccessTokenUpdateRequest body) throws ApiException { + String tokenId, PersonalAccessTokenUpdateRequest body) throws ApiException { Object localVarPostBody = body; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { throw new ApiException( - 400, "Missing the required parameter 'patId' when calling updatePersonalAccessToken"); + 400, "Missing the required parameter 'tokenId' when calling updatePersonalAccessToken"); } // verify the required parameter 'body' is set @@ -3373,8 +3374,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/{token_id}" + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -3403,23 +3404,23 @@ public ApiResponse updatePersonalAccessTokenWithHtt * *

See {@link #updatePersonalAccessTokenWithHttpInfo}. * - * @param patId The ID of the personal access token. (required) + * @param tokenId The ID of the access token. (required) * @param body (required) * @return CompletableFuture<ApiResponse<PersonalAccessTokenResponse>> */ public CompletableFuture> updatePersonalAccessTokenWithHttpInfoAsync( - String patId, PersonalAccessTokenUpdateRequest body) { + String tokenId, PersonalAccessTokenUpdateRequest body) { Object localVarPostBody = body; - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling updatePersonalAccessToken")); + "Missing the required parameter 'tokenId' when calling updatePersonalAccessToken")); return result; } @@ -3434,8 +3435,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/{token_id}" + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); 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..b934f160a45 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 @@ -9,13 +9,13 @@ import com.datadog.api.client.v2.model.ApplicationKeyUpdateRequest; import com.datadog.api.client.v2.model.ApplicationKeysSort; import com.datadog.api.client.v2.model.ListApplicationKeysResponse; -import com.datadog.api.client.v2.model.ListPersonalAccessTokensResponse; +import com.datadog.api.client.v2.model.ListServiceAccessTokensResponse; import com.datadog.api.client.v2.model.PartialApplicationKeyResponse; -import com.datadog.api.client.v2.model.PersonalAccessTokenCreateResponse; -import com.datadog.api.client.v2.model.PersonalAccessTokenResponse; -import com.datadog.api.client.v2.model.PersonalAccessTokenUpdateRequest; import com.datadog.api.client.v2.model.PersonalAccessTokensSort; +import com.datadog.api.client.v2.model.ServiceAccessTokenCreateResponse; +import com.datadog.api.client.v2.model.ServiceAccessTokenResponse; import com.datadog.api.client.v2.model.ServiceAccountAccessTokenCreateRequest; +import com.datadog.api.client.v2.model.ServiceAccountAccessTokenUpdateRequest; import com.datadog.api.client.v2.model.ServiceAccountCreateRequest; import com.datadog.api.client.v2.model.UserResponse; import jakarta.ws.rs.client.Invocation; @@ -196,10 +196,10 @@ public CompletableFuture> createServiceAccountWithHttp * * @param serviceAccountId The ID of the service account. (required) * @param body (required) - * @return PersonalAccessTokenCreateResponse + * @return ServiceAccessTokenCreateResponse * @throws ApiException if fails to make API call */ - public PersonalAccessTokenCreateResponse createServiceAccountAccessToken( + public ServiceAccessTokenCreateResponse createServiceAccountAccessToken( String serviceAccountId, ServiceAccountAccessTokenCreateRequest body) throws ApiException { return createServiceAccountAccessTokenWithHttpInfo(serviceAccountId, body).getData(); } @@ -211,9 +211,9 @@ public PersonalAccessTokenCreateResponse createServiceAccountAccessToken( * * @param serviceAccountId The ID of the service account. (required) * @param body (required) - * @return CompletableFuture<PersonalAccessTokenCreateResponse> + * @return CompletableFuture<ServiceAccessTokenCreateResponse> */ - public CompletableFuture createServiceAccountAccessTokenAsync( + public CompletableFuture createServiceAccountAccessTokenAsync( String serviceAccountId, ServiceAccountAccessTokenCreateRequest body) { return createServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, body) .thenApply( @@ -227,7 +227,7 @@ public CompletableFuture createServiceAccount * * @param serviceAccountId The ID of the service account. (required) * @param body (required) - * @return ApiResponse<PersonalAccessTokenCreateResponse> + * @return ApiResponse<ServiceAccessTokenCreateResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -240,7 +240,7 @@ public CompletableFuture createServiceAccount * *
429 Too many requests -
*/ - public ApiResponse createServiceAccountAccessTokenWithHttpInfo( + public ApiResponse createServiceAccountAccessTokenWithHttpInfo( String serviceAccountId, ServiceAccountAccessTokenCreateRequest body) throws ApiException { Object localVarPostBody = body; @@ -284,7 +284,7 @@ public ApiResponse createServiceAccountAccess localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -294,16 +294,16 @@ public ApiResponse createServiceAccountAccess * * @param serviceAccountId The ID of the service account. (required) * @param body (required) - * @return CompletableFuture<ApiResponse<PersonalAccessTokenCreateResponse>> + * @return CompletableFuture<ApiResponse<ServiceAccessTokenCreateResponse>> */ - public CompletableFuture> + public CompletableFuture> createServiceAccountAccessTokenWithHttpInfoAsync( String serviceAccountId, ServiceAccountAccessTokenCreateRequest body) { Object localVarPostBody = body; // verify the required parameter 'serviceAccountId' is set if (serviceAccountId == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( @@ -315,7 +315,7 @@ public ApiResponse createServiceAccountAccess // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( @@ -345,7 +345,7 @@ public ApiResponse createServiceAccountAccess new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -358,7 +358,7 @@ public ApiResponse createServiceAccountAccess localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -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) - * @return PersonalAccessTokenResponse + * @param tokenId The ID of the access token. (required) + * @return ServiceAccessTokenResponse * @throws ApiException if fails to make API call */ - public PersonalAccessTokenResponse getServiceAccountAccessToken( - String serviceAccountId, String patId) throws ApiException { - return getServiceAccountAccessTokenWithHttpInfo(serviceAccountId, patId).getData(); + public ServiceAccessTokenResponse getServiceAccountAccessToken( + String serviceAccountId, String tokenId) throws ApiException { + return getServiceAccountAccessTokenWithHttpInfo(serviceAccountId, tokenId).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) - * @return CompletableFuture<PersonalAccessTokenResponse> + * @param tokenId The ID of the access token. (required) + * @return CompletableFuture<ServiceAccessTokenResponse> */ - public CompletableFuture getServiceAccountAccessTokenAsync( - String serviceAccountId, String patId) { - return getServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, patId) + public CompletableFuture getServiceAccountAccessTokenAsync( + String serviceAccountId, String tokenId) { + return getServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, tokenId) .thenApply( response -> { return response.getData(); @@ -732,11 +732,11 @@ public CompletableFuture getServiceAccountAccessTok } /** - * Get a specific access token for a service account by its UUID. + * Get a specific access token for a service account by its ID. * * @param serviceAccountId The ID of the service account. (required) - * @param patId The ID of the personal access token. (required) - * @return ApiResponse<PersonalAccessTokenResponse> + * @param tokenId The ID of the access token. (required) + * @return ApiResponse<ServiceAccessTokenResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -748,8 +748,8 @@ public CompletableFuture getServiceAccountAccessTok * *
429 Too many requests -
*/ - public ApiResponse getServiceAccountAccessTokenWithHttpInfo( - String serviceAccountId, String patId) throws ApiException { + public ApiResponse getServiceAccountAccessTokenWithHttpInfo( + String serviceAccountId, String tokenId) 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 'tokenId' is set + if (tokenId == null) { throw new ApiException( - 400, "Missing the required parameter 'patId' when calling getServiceAccountAccessToken"); + 400, + "Missing the required parameter 'tokenId' 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/{token_id}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -792,7 +793,7 @@ public ApiResponse getServiceAccountAccessTokenWith localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -801,17 +802,16 @@ 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) - * @return CompletableFuture<ApiResponse<PersonalAccessTokenResponse>> + * @param tokenId The ID of the access token. (required) + * @return CompletableFuture<ApiResponse<ServiceAccessTokenResponse>> */ - public CompletableFuture> - getServiceAccountAccessTokenWithHttpInfoAsync(String serviceAccountId, String patId) { + public CompletableFuture> + getServiceAccountAccessTokenWithHttpInfoAsync(String serviceAccountId, String tokenId) { Object localVarPostBody = null; // verify the required parameter 'serviceAccountId' is set if (serviceAccountId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, @@ -820,23 +820,23 @@ public ApiResponse getServiceAccountAccessTokenWith return result; } - // verify the required parameter 'patId' is set - if (patId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'tokenId' is set + if (tokenId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling getServiceAccountAccessToken")); + "Missing the required parameter 'tokenId' 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/{token_id}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -852,8 +852,7 @@ public ApiResponse getServiceAccountAccessTokenWith new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -865,7 +864,7 @@ public ApiResponse getServiceAccountAccessTokenWith localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -1073,9 +1072,9 @@ public ListServiceAccountAccessTokensOptionalParameters pageNumber(Long pageNumb /** * Set sort. * - * @param sort Personal access token attribute used to sort results. Sort order is ascending by - * default. In order to specify a descending sort, prefix the attribute with a minus sign. - * (optional, default to "name") + * @param sort Access token attribute used to sort results. Sort order is ascending by default. + * In order to specify a descending sort, prefix the attribute with a minus sign. (optional, + * default to "name") * @return ListServiceAccountAccessTokensOptionalParameters */ public ListServiceAccountAccessTokensOptionalParameters sort(PersonalAccessTokensSort sort) { @@ -1086,7 +1085,7 @@ public ListServiceAccountAccessTokensOptionalParameters sort(PersonalAccessToken /** * Set filter. * - * @param filter Filter personal access tokens by the specified string. (optional) + * @param filter Filter access tokens by the specified string. (optional) * @return ListServiceAccountAccessTokensOptionalParameters */ public ListServiceAccountAccessTokensOptionalParameters filter(String filter) { @@ -1101,10 +1100,10 @@ public ListServiceAccountAccessTokensOptionalParameters filter(String filter) { *

See {@link #listServiceAccountAccessTokensWithHttpInfo}. * * @param serviceAccountId The ID of the service account. (required) - * @return ListPersonalAccessTokensResponse + * @return ListServiceAccessTokensResponse * @throws ApiException if fails to make API call */ - public ListPersonalAccessTokensResponse listServiceAccountAccessTokens(String serviceAccountId) + public ListServiceAccessTokensResponse listServiceAccountAccessTokens(String serviceAccountId) throws ApiException { return listServiceAccountAccessTokensWithHttpInfo( serviceAccountId, new ListServiceAccountAccessTokensOptionalParameters()) @@ -1117,9 +1116,9 @@ serviceAccountId, new ListServiceAccountAccessTokensOptionalParameters()) *

See {@link #listServiceAccountAccessTokensWithHttpInfoAsync}. * * @param serviceAccountId The ID of the service account. (required) - * @return CompletableFuture<ListPersonalAccessTokensResponse> + * @return CompletableFuture<ListServiceAccessTokensResponse> */ - public CompletableFuture listServiceAccountAccessTokensAsync( + public CompletableFuture listServiceAccountAccessTokensAsync( String serviceAccountId) { return listServiceAccountAccessTokensWithHttpInfoAsync( serviceAccountId, new ListServiceAccountAccessTokensOptionalParameters()) @@ -1136,10 +1135,10 @@ serviceAccountId, new ListServiceAccountAccessTokensOptionalParameters()) * * @param serviceAccountId The ID of the service account. (required) * @param parameters Optional parameters for the request. - * @return ListPersonalAccessTokensResponse + * @return ListServiceAccessTokensResponse * @throws ApiException if fails to make API call */ - public ListPersonalAccessTokensResponse listServiceAccountAccessTokens( + public ListServiceAccessTokensResponse listServiceAccountAccessTokens( String serviceAccountId, ListServiceAccountAccessTokensOptionalParameters parameters) throws ApiException { return listServiceAccountAccessTokensWithHttpInfo(serviceAccountId, parameters).getData(); @@ -1152,9 +1151,9 @@ public ListPersonalAccessTokensResponse listServiceAccountAccessTokens( * * @param serviceAccountId The ID of the service account. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListPersonalAccessTokensResponse> + * @return CompletableFuture<ListServiceAccessTokensResponse> */ - public CompletableFuture listServiceAccountAccessTokensAsync( + public CompletableFuture listServiceAccountAccessTokensAsync( String serviceAccountId, ListServiceAccountAccessTokensOptionalParameters parameters) { return listServiceAccountAccessTokensWithHttpInfoAsync(serviceAccountId, parameters) .thenApply( @@ -1168,7 +1167,7 @@ public CompletableFuture listServiceAccountAcc * * @param serviceAccountId The ID of the service account. (required) * @param parameters Optional parameters for the request. - * @return ApiResponse<ListPersonalAccessTokensResponse> + * @return ApiResponse<ListServiceAccessTokensResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -1181,7 +1180,7 @@ public CompletableFuture listServiceAccountAcc * *
429 Too many requests -
*/ - public ApiResponse listServiceAccountAccessTokensWithHttpInfo( + public ApiResponse listServiceAccountAccessTokensWithHttpInfo( String serviceAccountId, ListServiceAccountAccessTokensOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; @@ -1229,7 +1228,7 @@ public ApiResponse listServiceAccountAccessTok localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -1239,16 +1238,16 @@ public ApiResponse listServiceAccountAccessTok * * @param serviceAccountId The ID of the service account. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ListPersonalAccessTokensResponse>> + * @return CompletableFuture<ApiResponse<ListServiceAccessTokensResponse>> */ - public CompletableFuture> + public CompletableFuture> listServiceAccountAccessTokensWithHttpInfoAsync( String serviceAccountId, ListServiceAccountAccessTokensOptionalParameters parameters) { Object localVarPostBody = null; // verify the required parameter 'serviceAccountId' is set if (serviceAccountId == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( @@ -1288,7 +1287,7 @@ public ApiResponse listServiceAccountAccessTok new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -1301,7 +1300,7 @@ public ApiResponse listServiceAccountAccessTok localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** Manage optional parameters to listServiceAccountApplicationKeys. */ @@ -1614,12 +1613,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 tokenId The ID of the access token. (required) * @throws ApiException if fails to make API call */ - public void revokeServiceAccountAccessToken(String serviceAccountId, String patId) + public void revokeServiceAccountAccessToken(String serviceAccountId, String tokenId) throws ApiException { - revokeServiceAccountAccessTokenWithHttpInfo(serviceAccountId, patId); + revokeServiceAccountAccessTokenWithHttpInfo(serviceAccountId, tokenId); } /** @@ -1628,12 +1627,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 tokenId The ID of the access token. (required) * @return CompletableFuture */ public CompletableFuture revokeServiceAccountAccessTokenAsync( - String serviceAccountId, String patId) { - return revokeServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, patId) + String serviceAccountId, String tokenId) { + return revokeServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, tokenId) .thenApply( response -> { return response.getData(); @@ -1644,7 +1643,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 tokenId The ID of the access token. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -1658,7 +1657,7 @@ public CompletableFuture revokeServiceAccountAccessTokenAsync( * */ public ApiResponse revokeServiceAccountAccessTokenWithHttpInfo( - String serviceAccountId, String patId) throws ApiException { + String serviceAccountId, String tokenId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'serviceAccountId' is set @@ -1669,19 +1668,19 @@ public ApiResponse revokeServiceAccountAccessTokenWithHttpInfo( + " revokeServiceAccountAccessToken"); } - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { throw new ApiException( 400, - "Missing the required parameter 'patId' when calling revokeServiceAccountAccessToken"); + "Missing the required parameter 'tokenId' 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/{token_id}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1711,11 +1710,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 tokenId The ID of the access token. (required) * @return CompletableFuture<ApiResponse<Void>> */ public CompletableFuture> revokeServiceAccountAccessTokenWithHttpInfoAsync( - String serviceAccountId, String patId) { + String serviceAccountId, String tokenId) { Object localVarPostBody = null; // verify the required parameter 'serviceAccountId' is set @@ -1729,23 +1728,23 @@ public CompletableFuture> revokeServiceAccountAccessTokenWithH return result; } - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling" + "Missing the required parameter 'tokenId' 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/{token_id}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1782,15 +1781,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 tokenId The ID of the access token. (required) * @param body (required) - * @return PersonalAccessTokenResponse + * @return ServiceAccessTokenResponse * @throws ApiException if fails to make API call */ - public PersonalAccessTokenResponse updateServiceAccountAccessToken( - String serviceAccountId, String patId, PersonalAccessTokenUpdateRequest body) + public ServiceAccessTokenResponse updateServiceAccountAccessToken( + String serviceAccountId, String tokenId, ServiceAccountAccessTokenUpdateRequest body) throws ApiException { - return updateServiceAccountAccessTokenWithHttpInfo(serviceAccountId, patId, body).getData(); + return updateServiceAccountAccessTokenWithHttpInfo(serviceAccountId, tokenId, body).getData(); } /** @@ -1799,13 +1798,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 tokenId The ID of the access token. (required) * @param body (required) - * @return CompletableFuture<PersonalAccessTokenResponse> + * @return CompletableFuture<ServiceAccessTokenResponse> */ - public CompletableFuture updateServiceAccountAccessTokenAsync( - String serviceAccountId, String patId, PersonalAccessTokenUpdateRequest body) { - return updateServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, patId, body) + public CompletableFuture updateServiceAccountAccessTokenAsync( + String serviceAccountId, String tokenId, ServiceAccountAccessTokenUpdateRequest body) { + return updateServiceAccountAccessTokenWithHttpInfoAsync(serviceAccountId, tokenId, body) .thenApply( response -> { return response.getData(); @@ -1816,9 +1815,9 @@ 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 tokenId The ID of the access token. (required) * @param body (required) - * @return ApiResponse<PersonalAccessTokenResponse> + * @return ApiResponse<ServiceAccessTokenResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -1831,8 +1830,8 @@ public CompletableFuture updateServiceAccountAccess * *
429 Too many requests -
*/ - public ApiResponse updateServiceAccountAccessTokenWithHttpInfo( - String serviceAccountId, String patId, PersonalAccessTokenUpdateRequest body) + public ApiResponse updateServiceAccountAccessTokenWithHttpInfo( + String serviceAccountId, String tokenId, ServiceAccountAccessTokenUpdateRequest body) throws ApiException { Object localVarPostBody = body; @@ -1844,11 +1843,11 @@ public ApiResponse updateServiceAccountAccessTokenW + " updateServiceAccountAccessToken"); } - // verify the required parameter 'patId' is set - if (patId == null) { + // verify the required parameter 'tokenId' is set + if (tokenId == null) { throw new ApiException( 400, - "Missing the required parameter 'patId' when calling updateServiceAccountAccessToken"); + "Missing the required parameter 'tokenId' when calling updateServiceAccountAccessToken"); } // verify the required parameter 'body' is set @@ -1859,11 +1858,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/{token_id}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1884,7 +1883,7 @@ public ApiResponse updateServiceAccountAccessTokenW localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -1893,19 +1892,18 @@ 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 tokenId The ID of the access token. (required) * @param body (required) - * @return CompletableFuture<ApiResponse<PersonalAccessTokenResponse>> + * @return CompletableFuture<ApiResponse<ServiceAccessTokenResponse>> */ - public CompletableFuture> + public CompletableFuture> updateServiceAccountAccessTokenWithHttpInfoAsync( - String serviceAccountId, String patId, PersonalAccessTokenUpdateRequest body) { + String serviceAccountId, String tokenId, ServiceAccountAccessTokenUpdateRequest body) { Object localVarPostBody = body; // verify the required parameter 'serviceAccountId' is set if (serviceAccountId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, @@ -1914,22 +1912,20 @@ public ApiResponse updateServiceAccountAccessTokenW return result; } - // verify the required parameter 'patId' is set - if (patId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'tokenId' is set + if (tokenId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'patId' when calling" + "Missing the required parameter 'tokenId' when calling" + " updateServiceAccountAccessToken")); return result; } // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, @@ -1939,11 +1935,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/{token_id}" .replaceAll( "\\{" + "service_account_id" + "\\}", apiClient.escapeString(serviceAccountId.toString())) - .replaceAll("\\{" + "pat_id" + "\\}", apiClient.escapeString(patId.toString())); + .replaceAll("\\{" + "token_id" + "\\}", apiClient.escapeString(tokenId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1959,8 +1955,7 @@ public ApiResponse updateServiceAccountAccessTokenW new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -1972,7 +1967,7 @@ public ApiResponse updateServiceAccountAccessTokenW localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** diff --git a/src/main/java/com/datadog/api/client/v2/model/AccessTokenListItem.java b/src/main/java/com/datadog/api/client/v2/model/AccessTokenListItem.java new file mode 100644 index 00000000000..1f32762b7a0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AccessTokenListItem.java @@ -0,0 +1,228 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * An access token entry returned by the personal access tokens list endpoint. May represent either + * a personal or a service access token. + */ +@JsonPropertyOrder({ + AccessTokenListItem.JSON_PROPERTY_ATTRIBUTES, + AccessTokenListItem.JSON_PROPERTY_ID, + AccessTokenListItem.JSON_PROPERTY_RELATIONSHIPS, + AccessTokenListItem.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AccessTokenListItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PersonalAccessTokenAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private AccessTokenListItemRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AccessTokensType type; + + public AccessTokenListItem attributes(PersonalAccessTokenAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an access token. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PersonalAccessTokenAttributes getAttributes() { + return attributes; + } + + public void setAttributes(PersonalAccessTokenAttributes attributes) { + this.attributes = attributes; + } + + public AccessTokenListItem id(String id) { + this.id = id; + return this; + } + + /** + * ID of the access token. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AccessTokenListItem relationships(AccessTokenListItemRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Resources related to the access token entry in the mixed list response. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AccessTokenListItemRelationships getRelationships() { + return relationships; + } + + public void setRelationships(AccessTokenListItemRelationships relationships) { + this.relationships = relationships; + } + + public AccessTokenListItem type(AccessTokensType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Resource type returned by the access tokens list endpoint. Includes both personal and service + * access tokens. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AccessTokensType getType() { + return type; + } + + public void setType(AccessTokensType 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 AccessTokenListItem + */ + @JsonAnySetter + public AccessTokenListItem 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 AccessTokenListItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessTokenListItem accessTokenListItem = (AccessTokenListItem) o; + return Objects.equals(this.attributes, accessTokenListItem.attributes) + && Objects.equals(this.id, accessTokenListItem.id) + && Objects.equals(this.relationships, accessTokenListItem.relationships) + && Objects.equals(this.type, accessTokenListItem.type) + && Objects.equals(this.additionalProperties, accessTokenListItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessTokenListItem {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\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/AccessTokenListItemRelationships.java b/src/main/java/com/datadog/api/client/v2/model/AccessTokenListItemRelationships.java new file mode 100644 index 00000000000..4c0b9dfddf2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AccessTokenListItemRelationships.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Resources related to the access token entry in the mixed list response. */ +@JsonPropertyOrder({AccessTokenListItemRelationships.JSON_PROPERTY_OWNED_BY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AccessTokenListItemRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OWNED_BY = "owned_by"; + private RelationshipToAccessTokenOwner ownedBy; + + public AccessTokenListItemRelationships ownedBy(RelationshipToAccessTokenOwner ownedBy) { + this.ownedBy = ownedBy; + this.unparsed |= ownedBy.unparsed; + return this; + } + + /** + * Relationship to the access token's owner. + * + * @return ownedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OWNED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToAccessTokenOwner getOwnedBy() { + return ownedBy; + } + + public void setOwnedBy(RelationshipToAccessTokenOwner ownedBy) { + this.ownedBy = ownedBy; + } + + /** + * 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 AccessTokenListItemRelationships + */ + @JsonAnySetter + public AccessTokenListItemRelationships 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 AccessTokenListItemRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessTokenListItemRelationships accessTokenListItemRelationships = + (AccessTokenListItemRelationships) o; + return Objects.equals(this.ownedBy, accessTokenListItemRelationships.ownedBy) + && Objects.equals( + this.additionalProperties, accessTokenListItemRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ownedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessTokenListItemRelationships {\n"); + sb.append(" ownedBy: ").append(toIndentedString(ownedBy)).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/AccessTokenOwnerType.java b/src/main/java/com/datadog/api/client/v2/model/AccessTokenOwnerType.java new file mode 100644 index 00000000000..53d1dc80bcc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AccessTokenOwnerType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Owner resource type. Either a user or a service account. */ +@JsonSerialize(using = AccessTokenOwnerType.AccessTokenOwnerTypeSerializer.class) +public class AccessTokenOwnerType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("users", "service_account")); + + public static final AccessTokenOwnerType USERS = new AccessTokenOwnerType("users"); + public static final AccessTokenOwnerType SERVICE_ACCOUNT = + new AccessTokenOwnerType("service_account"); + + AccessTokenOwnerType(String value) { + super(value, allowedValues); + } + + public static class AccessTokenOwnerTypeSerializer extends StdSerializer { + public AccessTokenOwnerTypeSerializer(Class t) { + super(t); + } + + public AccessTokenOwnerTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AccessTokenOwnerType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AccessTokenOwnerType fromValue(String value) { + return new AccessTokenOwnerType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AccessTokensType.java b/src/main/java/com/datadog/api/client/v2/model/AccessTokensType.java new file mode 100644 index 00000000000..156524074e9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AccessTokensType.java @@ -0,0 +1,60 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Resource type returned by the access tokens list endpoint. Includes both personal and service + * access tokens. + */ +@JsonSerialize(using = AccessTokensType.AccessTokensTypeSerializer.class) +public class AccessTokensType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("personal_access_tokens", "service_access_tokens")); + + public static final AccessTokensType PERSONAL_ACCESS_TOKENS = + new AccessTokensType("personal_access_tokens"); + public static final AccessTokensType SERVICE_ACCESS_TOKENS = + new AccessTokensType("service_access_tokens"); + + AccessTokensType(String value) { + super(value, allowedValues); + } + + public static class AccessTokensTypeSerializer extends StdSerializer { + public AccessTokensTypeSerializer(Class t) { + super(t); + } + + public AccessTokensTypeSerializer() { + this(null); + } + + @Override + public void serialize(AccessTokensType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AccessTokensType fromValue(String value) { + return new AccessTokensType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FullPersonalAccessToken.java b/src/main/java/com/datadog/api/client/v2/model/FullPersonalAccessToken.java index 1ffbbed9632..d4416340ed0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FullPersonalAccessToken.java +++ b/src/main/java/com/datadog/api/client/v2/model/FullPersonalAccessToken.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Datadog personal access token, including the token key. */ +/** Datadog access token, including the token key. */ @JsonPropertyOrder({ FullPersonalAccessToken.JSON_PROPERTY_ATTRIBUTES, FullPersonalAccessToken.JSON_PROPERTY_ID, @@ -46,7 +46,7 @@ public FullPersonalAccessToken attributes(FullPersonalAccessTokenAttributes attr } /** - * Attributes of a full personal access token, including the token key. + * Attributes of a full access token, including the token key. * * @return attributes */ @@ -67,7 +67,7 @@ public FullPersonalAccessToken id(String id) { } /** - * ID of the personal access token. + * ID of the access token. * * @return id */ @@ -89,7 +89,7 @@ public FullPersonalAccessToken relationships(PersonalAccessTokenRelationships re } /** - * Resources related to the personal access token. + * Resources related to the access token. * * @return relationships */ 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..fd1a08e96ca 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 @@ -20,7 +20,7 @@ import java.util.Objects; import org.openapitools.jackson.nullable.JsonNullable; -/** Attributes of a full personal access token, including the token key. */ +/** Attributes of a full access token, including the token key. */ @JsonPropertyOrder({ FullPersonalAccessTokenAttributes.JSON_PROPERTY_CREATED_AT, FullPersonalAccessTokenAttributes.JSON_PROPERTY_EXPIRES_AT, @@ -52,7 +52,7 @@ public class FullPersonalAccessTokenAttributes { private List scopes = null; /** - * Creation date of the personal access token. + * Creation date of the access token. * * @return createdAt */ @@ -64,7 +64,7 @@ public OffsetDateTime getCreatedAt() { } /** - * Expiration date of the personal access token. + * Expiration date of the access token. * * @return expiresAt */ @@ -90,7 +90,7 @@ private void setExpiresAt_JsonNullable(JsonNullable expiresAt) { } /** - * The personal access token key. Only returned upon creation. + * The access token key. Only returned upon creation. * * @return key */ @@ -107,7 +107,7 @@ public FullPersonalAccessTokenAttributes name(String name) { } /** - * Name of the personal access token. + * Name of the access token. * * @return name */ @@ -123,7 +123,7 @@ public void setName(String name) { } /** - * The public portion of the personal access token. + * The public portion of the access token. * * @return publicPortion */ @@ -148,7 +148,7 @@ public FullPersonalAccessTokenAttributes addScopesItem(String scopesItem) { } /** - * Array of scopes granted to the personal access token. + * Array of scopes granted to the access token. * * @return scopes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/FullServiceAccessToken.java b/src/main/java/com/datadog/api/client/v2/model/FullServiceAccessToken.java new file mode 100644 index 00000000000..6614a78d68e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FullServiceAccessToken.java @@ -0,0 +1,224 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Datadog access token, including the token key. */ +@JsonPropertyOrder({ + FullServiceAccessToken.JSON_PROPERTY_ATTRIBUTES, + FullServiceAccessToken.JSON_PROPERTY_ID, + FullServiceAccessToken.JSON_PROPERTY_RELATIONSHIPS, + FullServiceAccessToken.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FullServiceAccessToken { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private FullServiceAccessTokenAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ServiceAccessTokenRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceAccessTokensType type = ServiceAccessTokensType.SERVICE_ACCESS_TOKENS; + + public FullServiceAccessToken attributes(FullServiceAccessTokenAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a full access token, including the token key. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FullServiceAccessTokenAttributes getAttributes() { + return attributes; + } + + public void setAttributes(FullServiceAccessTokenAttributes attributes) { + this.attributes = attributes; + } + + public FullServiceAccessToken id(String id) { + this.id = id; + return this; + } + + /** + * ID of the access token. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public FullServiceAccessToken relationships(ServiceAccessTokenRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Resources related to the access token. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ServiceAccessTokenRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ServiceAccessTokenRelationships relationships) { + this.relationships = relationships; + } + + public FullServiceAccessToken type(ServiceAccessTokensType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Service access tokens resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ServiceAccessTokensType getType() { + return type; + } + + public void setType(ServiceAccessTokensType 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 FullServiceAccessToken + */ + @JsonAnySetter + public FullServiceAccessToken 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 FullServiceAccessToken object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FullServiceAccessToken fullServiceAccessToken = (FullServiceAccessToken) o; + return Objects.equals(this.attributes, fullServiceAccessToken.attributes) + && Objects.equals(this.id, fullServiceAccessToken.id) + && Objects.equals(this.relationships, fullServiceAccessToken.relationships) + && Objects.equals(this.type, fullServiceAccessToken.type) + && Objects.equals(this.additionalProperties, fullServiceAccessToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FullServiceAccessToken {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\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/FullServiceAccessTokenAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FullServiceAccessTokenAttributes.java new file mode 100644 index 00000000000..bb65458cf8b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FullServiceAccessTokenAttributes.java @@ -0,0 +1,265 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes of a full access token, including the token key. */ +@JsonPropertyOrder({ + FullServiceAccessTokenAttributes.JSON_PROPERTY_CREATED_AT, + FullServiceAccessTokenAttributes.JSON_PROPERTY_EXPIRES_AT, + FullServiceAccessTokenAttributes.JSON_PROPERTY_KEY, + FullServiceAccessTokenAttributes.JSON_PROPERTY_NAME, + FullServiceAccessTokenAttributes.JSON_PROPERTY_PUBLIC_PORTION, + FullServiceAccessTokenAttributes.JSON_PROPERTY_SCOPES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FullServiceAccessTokenAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private JsonNullable expiresAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PUBLIC_PORTION = "public_portion"; + private String publicPortion; + + public static final String JSON_PROPERTY_SCOPES = "scopes"; + private List scopes = null; + + /** + * Creation date of the access token. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Expiration date of the access token. + * + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getExpiresAt() { + + if (expiresAt == null) { + expiresAt = JsonNullable.undefined(); + } + return expiresAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getExpiresAt_JsonNullable() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + private void setExpiresAt_JsonNullable(JsonNullable expiresAt) { + this.expiresAt = expiresAt; + } + + /** + * The access token key. Only returned upon creation. + * + * @return key + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + public FullServiceAccessTokenAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the access token. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * The public portion of the access token. + * + * @return publicPortion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_PORTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublicPortion() { + return publicPortion; + } + + public FullServiceAccessTokenAttributes scopes(List scopes) { + this.scopes = scopes; + return this; + } + + public FullServiceAccessTokenAttributes addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); + } + this.scopes.add(scopesItem); + return this; + } + + /** + * Array of scopes granted to the access token. + * + * @return scopes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getScopes() { + return scopes; + } + + public void setScopes(List scopes) { + this.scopes = scopes; + } + + /** + * 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 FullServiceAccessTokenAttributes + */ + @JsonAnySetter + public FullServiceAccessTokenAttributes 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 FullServiceAccessTokenAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FullServiceAccessTokenAttributes fullServiceAccessTokenAttributes = + (FullServiceAccessTokenAttributes) o; + return Objects.equals(this.createdAt, fullServiceAccessTokenAttributes.createdAt) + && Objects.equals(this.expiresAt, fullServiceAccessTokenAttributes.expiresAt) + && Objects.equals(this.key, fullServiceAccessTokenAttributes.key) + && Objects.equals(this.name, fullServiceAccessTokenAttributes.name) + && Objects.equals(this.publicPortion, fullServiceAccessTokenAttributes.publicPortion) + && Objects.equals(this.scopes, fullServiceAccessTokenAttributes.scopes) + && Objects.equals( + this.additionalProperties, fullServiceAccessTokenAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, expiresAt, key, name, publicPortion, scopes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FullServiceAccessTokenAttributes {\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"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" publicPortion: ").append(toIndentedString(publicPortion)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).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/ListPersonalAccessTokensResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListPersonalAccessTokensResponse.java index 596cdb002d6..6d410d276a3 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ListPersonalAccessTokensResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/ListPersonalAccessTokensResponse.java @@ -18,7 +18,7 @@ import java.util.Map; import java.util.Objects; -/** Response for a list of personal access tokens. */ +/** Response for a list of access tokens. Includes both personal and service access tokens. */ @JsonPropertyOrder({ ListPersonalAccessTokensResponse.JSON_PROPERTY_DATA, ListPersonalAccessTokensResponse.JSON_PROPERTY_META @@ -28,20 +28,20 @@ public class ListPersonalAccessTokensResponse { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private List data = null; + private List data = null; public static final String JSON_PROPERTY_META = "meta"; private PersonalAccessTokenResponseMeta meta; - public ListPersonalAccessTokensResponse data(List data) { + public ListPersonalAccessTokensResponse data(List data) { this.data = data; - for (PersonalAccessToken item : data) { + for (AccessTokenListItem item : data) { this.unparsed |= item.unparsed; } return this; } - public ListPersonalAccessTokensResponse addDataItem(PersonalAccessToken dataItem) { + public ListPersonalAccessTokensResponse addDataItem(AccessTokenListItem dataItem) { if (this.data == null) { this.data = new ArrayList<>(); } @@ -51,18 +51,18 @@ public ListPersonalAccessTokensResponse addDataItem(PersonalAccessToken dataItem } /** - * Array of personal access tokens. + * Array of access tokens. Includes both personal and service access tokens. * * @return data */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getData() { + public List getData() { return data; } - public void setData(List data) { + public void setData(List data) { this.data = data; } @@ -73,7 +73,7 @@ public ListPersonalAccessTokensResponse meta(PersonalAccessTokenResponseMeta met } /** - * Additional information related to the personal access token response. + * Additional information related to the access token response. * * @return meta */ diff --git a/src/main/java/com/datadog/api/client/v2/model/ListServiceAccessTokensResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListServiceAccessTokensResponse.java new file mode 100644 index 00000000000..c07f2f91771 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListServiceAccessTokensResponse.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response for a list of access tokens. */ +@JsonPropertyOrder({ + ListServiceAccessTokensResponse.JSON_PROPERTY_DATA, + ListServiceAccessTokensResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListServiceAccessTokensResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_META = "meta"; + private ServiceAccessTokenResponseMeta meta; + + public ListServiceAccessTokensResponse data(List data) { + this.data = data; + for (ServiceAccessToken item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListServiceAccessTokensResponse addDataItem(ServiceAccessToken dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of access tokens. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListServiceAccessTokensResponse meta(ServiceAccessTokenResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Additional information related to the access token response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ServiceAccessTokenResponseMeta getMeta() { + return meta; + } + + public void setMeta(ServiceAccessTokenResponseMeta meta) { + this.meta = meta; + } + + /** + * 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 ListServiceAccessTokensResponse + */ + @JsonAnySetter + public ListServiceAccessTokensResponse 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 ListServiceAccessTokensResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListServiceAccessTokensResponse listServiceAccessTokensResponse = + (ListServiceAccessTokensResponse) o; + return Objects.equals(this.data, listServiceAccessTokensResponse.data) + && Objects.equals(this.meta, listServiceAccessTokensResponse.meta) + && Objects.equals( + this.additionalProperties, listServiceAccessTokensResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListServiceAccessTokensResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/PersonalAccessToken.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessToken.java index 8858d226eb9..22efa440bd4 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessToken.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessToken.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Datadog personal access token. */ +/** Datadog access token. */ @JsonPropertyOrder({ PersonalAccessToken.JSON_PROPERTY_ATTRIBUTES, PersonalAccessToken.JSON_PROPERTY_ID, @@ -46,7 +46,7 @@ public PersonalAccessToken attributes(PersonalAccessTokenAttributes attributes) } /** - * Attributes of a personal access token. + * Attributes of an access token. * * @return attributes */ @@ -67,7 +67,7 @@ public PersonalAccessToken id(String id) { } /** - * ID of the personal access token. + * ID of the access token. * * @return id */ @@ -89,7 +89,7 @@ public PersonalAccessToken relationships(PersonalAccessTokenRelationships relati } /** - * Resources related to the personal access token. + * Resources related to the access token. * * @return relationships */ 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..db3086d72b8 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 @@ -20,7 +20,7 @@ import java.util.Objects; import org.openapitools.jackson.nullable.JsonNullable; -/** Attributes of a personal access token. */ +/** Attributes of an access token. */ @JsonPropertyOrder({ PersonalAccessTokenAttributes.JSON_PROPERTY_CREATED_AT, PersonalAccessTokenAttributes.JSON_PROPERTY_EXPIRES_AT, @@ -56,7 +56,7 @@ public class PersonalAccessTokenAttributes { private List scopes = null; /** - * Creation date of the personal access token. + * Creation date of the access token. * * @return createdAt */ @@ -68,7 +68,7 @@ public OffsetDateTime getCreatedAt() { } /** - * Expiration date of the personal access token. + * Expiration date of the access token. * * @return expiresAt */ @@ -94,7 +94,7 @@ private void setExpiresAt_JsonNullable(JsonNullable expiresAt) { } /** - * Date the personal access token was last used. + * Date the access token was last used. * * @return lastUsedAt */ @@ -120,7 +120,7 @@ private void setLastUsedAt_JsonNullable(JsonNullable lastUsedAt) } /** - * Date of last modification of the personal access token. + * Date of last modification of the access token. * * @return modifiedAt */ @@ -151,7 +151,7 @@ public PersonalAccessTokenAttributes name(String name) { } /** - * Name of the personal access token. + * Name of the access token. * * @return name */ @@ -167,7 +167,7 @@ public void setName(String name) { } /** - * The public portion of the personal access token. + * The public portion of the access token. * * @return publicPortion */ @@ -192,7 +192,7 @@ public PersonalAccessTokenAttributes addScopesItem(String scopesItem) { } /** - * Array of scopes granted to the personal access token. + * Array of scopes granted to the access token. * * @return scopes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateAttributes.java index f9e59f0e00b..89985924b39 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateAttributes.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.Objects; -/** Attributes used to create a personal access token. */ +/** Attributes used to create an access token. */ @JsonPropertyOrder({ PersonalAccessTokenCreateAttributes.JSON_PROPERTY_EXPIRES_AT, PersonalAccessTokenCreateAttributes.JSON_PROPERTY_NAME, @@ -57,7 +57,7 @@ public PersonalAccessTokenCreateAttributes expiresAt(OffsetDateTime expiresAt) { } /** - * Expiration date of the personal access token. Must be at least 24 hours in the future. + * Expiration date of the access token. Must be at least 24 hours in the future. * * @return expiresAt */ @@ -77,7 +77,7 @@ public PersonalAccessTokenCreateAttributes name(String name) { } /** - * Name of the personal access token. + * Name of the access token. * * @return name */ @@ -102,7 +102,7 @@ public PersonalAccessTokenCreateAttributes addScopesItem(String scopesItem) { } /** - * Array of scopes to grant the personal access token. + * Array of scopes to grant the access token. * * @return scopes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateData.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateData.java index 49d8ed53661..24083100ddb 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateData.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateData.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Object used to create a personal access token. */ +/** Object used to create an access token. */ @JsonPropertyOrder({ PersonalAccessTokenCreateData.JSON_PROPERTY_ATTRIBUTES, PersonalAccessTokenCreateData.JSON_PROPERTY_TYPE @@ -52,7 +52,7 @@ public PersonalAccessTokenCreateData attributes(PersonalAccessTokenCreateAttribu } /** - * Attributes used to create a personal access token. + * Attributes used to create an access token. * * @return attributes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateRequest.java index de5b07fa8ad..bbfaa2ac8ff 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateRequest.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Request used to create a personal access token. */ +/** Request used to create an access token. */ @JsonPropertyOrder({PersonalAccessTokenCreateRequest.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -43,7 +43,7 @@ public PersonalAccessTokenCreateRequest data(PersonalAccessTokenCreateData data) } /** - * Object used to create a personal access token. + * Object used to create an access token. * * @return data */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateResponse.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateResponse.java index 7f94c81eba6..4b660e95c43 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenCreateResponse.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Response for creating a personal access token. Includes the token key. */ +/** Response for creating an access token. Includes the token key. */ @JsonPropertyOrder({PersonalAccessTokenCreateResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -32,7 +32,7 @@ public PersonalAccessTokenCreateResponse data(FullPersonalAccessToken data) { } /** - * Datadog personal access token, including the token key. + * Datadog access token, including the token key. * * @return data */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenRelationships.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenRelationships.java index ffe981bb959..56027360b2c 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenRelationships.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenRelationships.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Resources related to the personal access token. */ +/** Resources related to the access token. */ @JsonPropertyOrder({PersonalAccessTokenRelationships.JSON_PROPERTY_OWNED_BY}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponse.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponse.java index 0ca298c8bf4..57eab587a5f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponse.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Response for retrieving a personal access token. */ +/** Response for retrieving an access token. */ @JsonPropertyOrder({PersonalAccessTokenResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -32,7 +32,7 @@ public PersonalAccessTokenResponse data(PersonalAccessToken data) { } /** - * Datadog personal access token. + * Datadog access token. * * @return data */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponseMeta.java index 55811f20413..f64ee0df8db 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponseMeta.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponseMeta.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Additional information related to the personal access token response. */ +/** Additional information related to the access token response. */ @JsonPropertyOrder({PersonalAccessTokenResponseMeta.JSON_PROPERTY_PAGE}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponseMetaPage.java index 439102327a7..78f87ffdae0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponseMetaPage.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenResponseMetaPage.java @@ -31,7 +31,7 @@ public PersonalAccessTokenResponseMetaPage totalFilteredCount(Long totalFiltered } /** - * Total filtered personal access token count. + * Total filtered access token count. * * @return totalFilteredCount */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateAttributes.java index 546912dfd6d..9f95659f83f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateAttributes.java @@ -18,7 +18,7 @@ import java.util.Map; import java.util.Objects; -/** Attributes used to update a personal access token. */ +/** Attributes used to update an access token. */ @JsonPropertyOrder({ PersonalAccessTokenUpdateAttributes.JSON_PROPERTY_NAME, PersonalAccessTokenUpdateAttributes.JSON_PROPERTY_SCOPES @@ -39,7 +39,7 @@ public PersonalAccessTokenUpdateAttributes name(String name) { } /** - * Name of the personal access token. + * Name of the access token. * * @return name */ @@ -68,7 +68,7 @@ public PersonalAccessTokenUpdateAttributes addScopesItem(String scopesItem) { } /** - * Array of scopes to grant the personal access token. + * Array of scopes to grant the access token. * * @return scopes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateData.java index f2cae513c6b..ece791575b2 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateData.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateData.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Object used to update a personal access token. */ +/** Object used to update an access token. */ @JsonPropertyOrder({ PersonalAccessTokenUpdateData.JSON_PROPERTY_ATTRIBUTES, PersonalAccessTokenUpdateData.JSON_PROPERTY_ID, @@ -58,7 +58,7 @@ public PersonalAccessTokenUpdateData attributes(PersonalAccessTokenUpdateAttribu } /** - * Attributes used to update a personal access token. + * Attributes used to update an access token. * * @return attributes */ @@ -78,7 +78,7 @@ public PersonalAccessTokenUpdateData id(String id) { } /** - * ID of the personal access token. + * ID of the access token. * * @return id */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateRequest.java index 7b62de76f9c..3030604d83a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokenUpdateRequest.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.Objects; -/** Request used to update a personal access token. */ +/** Request used to update an access token. */ @JsonPropertyOrder({PersonalAccessTokenUpdateRequest.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -43,7 +43,7 @@ public PersonalAccessTokenUpdateRequest data(PersonalAccessTokenUpdateData data) } /** - * Object used to update a personal access token. + * Object used to update an access token. * * @return data */ diff --git a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokensSort.java b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokensSort.java index 91fdc974771..939308b7523 100644 --- a/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokensSort.java +++ b/src/main/java/com/datadog/api/client/v2/model/PersonalAccessTokensSort.java @@ -24,7 +24,15 @@ public class PersonalAccessTokensSort extends ModelEnum { private static final Set allowedValues = new HashSet( - Arrays.asList("name", "-name", "created_at", "-created_at", "expires_at", "-expires_at")); + Arrays.asList( + "name", + "-name", + "created_at", + "-created_at", + "expires_at", + "-expires_at", + "last_used_at", + "-last_used_at")); public static final PersonalAccessTokensSort NAME_ASCENDING = new PersonalAccessTokensSort("name"); @@ -38,6 +46,10 @@ public class PersonalAccessTokensSort extends ModelEnum { new PersonalAccessTokensSort("expires_at"); public static final PersonalAccessTokensSort EXPIRES_AT_DESCENDING = new PersonalAccessTokensSort("-expires_at"); + public static final PersonalAccessTokensSort LAST_USED_AT_ASCENDING = + new PersonalAccessTokensSort("last_used_at"); + public static final PersonalAccessTokensSort LAST_USED_AT_DESCENDING = + new PersonalAccessTokensSort("-last_used_at"); PersonalAccessTokensSort(String value) { super(value, allowedValues); diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToAccessTokenOwner.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToAccessTokenOwner.java new file mode 100644 index 00000000000..978dc45c23d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToAccessTokenOwner.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to the access token's owner. */ +@JsonPropertyOrder({RelationshipToAccessTokenOwner.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToAccessTokenOwner { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RelationshipToAccessTokenOwnerData data; + + public RelationshipToAccessTokenOwner() {} + + @JsonCreator + public RelationshipToAccessTokenOwner( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + RelationshipToAccessTokenOwnerData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RelationshipToAccessTokenOwner data(RelationshipToAccessTokenOwnerData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship to the access token's owner. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RelationshipToAccessTokenOwnerData getData() { + return data; + } + + public void setData(RelationshipToAccessTokenOwnerData 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 RelationshipToAccessTokenOwner + */ + @JsonAnySetter + public RelationshipToAccessTokenOwner 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 RelationshipToAccessTokenOwner object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToAccessTokenOwner relationshipToAccessTokenOwner = + (RelationshipToAccessTokenOwner) o; + return Objects.equals(this.data, relationshipToAccessTokenOwner.data) + && Objects.equals( + this.additionalProperties, relationshipToAccessTokenOwner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToAccessTokenOwner {\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/RelationshipToAccessTokenOwnerData.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToAccessTokenOwnerData.java new file mode 100644 index 00000000000..d6a30f8689a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToAccessTokenOwnerData.java @@ -0,0 +1,180 @@ +/* + * 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 access token's owner. */ +@JsonPropertyOrder({ + RelationshipToAccessTokenOwnerData.JSON_PROPERTY_ID, + RelationshipToAccessTokenOwnerData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToAccessTokenOwnerData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AccessTokenOwnerType type; + + public RelationshipToAccessTokenOwnerData() {} + + @JsonCreator + public RelationshipToAccessTokenOwnerData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AccessTokenOwnerType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RelationshipToAccessTokenOwnerData id(String id) { + this.id = id; + return this; + } + + /** + * A unique identifier that represents the owner. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RelationshipToAccessTokenOwnerData type(AccessTokenOwnerType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Owner resource type. Either a user or a service account. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AccessTokenOwnerType getType() { + return type; + } + + public void setType(AccessTokenOwnerType 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 RelationshipToAccessTokenOwnerData + */ + @JsonAnySetter + public RelationshipToAccessTokenOwnerData 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 RelationshipToAccessTokenOwnerData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToAccessTokenOwnerData relationshipToAccessTokenOwnerData = + (RelationshipToAccessTokenOwnerData) o; + return Objects.equals(this.id, relationshipToAccessTokenOwnerData.id) + && Objects.equals(this.type, relationshipToAccessTokenOwnerData.type) + && Objects.equals( + this.additionalProperties, relationshipToAccessTokenOwnerData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToAccessTokenOwnerData {\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/RelationshipToServiceAccount.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToServiceAccount.java new file mode 100644 index 00000000000..b62ef589caa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToServiceAccount.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to service account. */ +@JsonPropertyOrder({RelationshipToServiceAccount.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToServiceAccount { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RelationshipToServiceAccountData data; + + public RelationshipToServiceAccount() {} + + @JsonCreator + public RelationshipToServiceAccount( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + RelationshipToServiceAccountData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RelationshipToServiceAccount data(RelationshipToServiceAccountData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship to service account object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RelationshipToServiceAccountData getData() { + return data; + } + + public void setData(RelationshipToServiceAccountData 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 RelationshipToServiceAccount + */ + @JsonAnySetter + public RelationshipToServiceAccount 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 RelationshipToServiceAccount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToServiceAccount relationshipToServiceAccount = (RelationshipToServiceAccount) o; + return Objects.equals(this.data, relationshipToServiceAccount.data) + && Objects.equals( + this.additionalProperties, relationshipToServiceAccount.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToServiceAccount {\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/RelationshipToServiceAccountData.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToServiceAccountData.java new file mode 100644 index 00000000000..cfdf14d1bff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToServiceAccountData.java @@ -0,0 +1,180 @@ +/* + * 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 service account object. */ +@JsonPropertyOrder({ + RelationshipToServiceAccountData.JSON_PROPERTY_ID, + RelationshipToServiceAccountData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToServiceAccountData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceAccountType type; + + public RelationshipToServiceAccountData() {} + + @JsonCreator + public RelationshipToServiceAccountData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceAccountType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RelationshipToServiceAccountData id(String id) { + this.id = id; + return this; + } + + /** + * A unique identifier that represents the service account. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RelationshipToServiceAccountData type(ServiceAccountType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Service account resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceAccountType getType() { + return type; + } + + public void setType(ServiceAccountType 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 RelationshipToServiceAccountData + */ + @JsonAnySetter + public RelationshipToServiceAccountData 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 RelationshipToServiceAccountData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToServiceAccountData relationshipToServiceAccountData = + (RelationshipToServiceAccountData) o; + return Objects.equals(this.id, relationshipToServiceAccountData.id) + && Objects.equals(this.type, relationshipToServiceAccountData.type) + && Objects.equals( + this.additionalProperties, relationshipToServiceAccountData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToServiceAccountData {\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/ServiceAccessToken.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessToken.java new file mode 100644 index 00000000000..42fade8379f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessToken.java @@ -0,0 +1,224 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Datadog access token. */ +@JsonPropertyOrder({ + ServiceAccessToken.JSON_PROPERTY_ATTRIBUTES, + ServiceAccessToken.JSON_PROPERTY_ID, + ServiceAccessToken.JSON_PROPERTY_RELATIONSHIPS, + ServiceAccessToken.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccessToken { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceAccessTokenAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ServiceAccessTokenRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceAccessTokensType type = ServiceAccessTokensType.SERVICE_ACCESS_TOKENS; + + public ServiceAccessToken attributes(ServiceAccessTokenAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an access token. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ServiceAccessTokenAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceAccessTokenAttributes attributes) { + this.attributes = attributes; + } + + public ServiceAccessToken id(String id) { + this.id = id; + return this; + } + + /** + * ID of the access token. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ServiceAccessToken relationships(ServiceAccessTokenRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Resources related to the access token. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ServiceAccessTokenRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ServiceAccessTokenRelationships relationships) { + this.relationships = relationships; + } + + public ServiceAccessToken type(ServiceAccessTokensType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Service access tokens resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ServiceAccessTokensType getType() { + return type; + } + + public void setType(ServiceAccessTokensType 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 ServiceAccessToken + */ + @JsonAnySetter + public ServiceAccessToken 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 ServiceAccessToken object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccessToken serviceAccessToken = (ServiceAccessToken) o; + return Objects.equals(this.attributes, serviceAccessToken.attributes) + && Objects.equals(this.id, serviceAccessToken.id) + && Objects.equals(this.relationships, serviceAccessToken.relationships) + && Objects.equals(this.type, serviceAccessToken.type) + && Objects.equals(this.additionalProperties, serviceAccessToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccessToken {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\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/ServiceAccessTokenAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenAttributes.java new file mode 100644 index 00000000000..131b22587ae --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenAttributes.java @@ -0,0 +1,317 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes of an access token. */ +@JsonPropertyOrder({ + ServiceAccessTokenAttributes.JSON_PROPERTY_CREATED_AT, + ServiceAccessTokenAttributes.JSON_PROPERTY_EXPIRES_AT, + ServiceAccessTokenAttributes.JSON_PROPERTY_LAST_USED_AT, + ServiceAccessTokenAttributes.JSON_PROPERTY_MODIFIED_AT, + ServiceAccessTokenAttributes.JSON_PROPERTY_NAME, + ServiceAccessTokenAttributes.JSON_PROPERTY_PUBLIC_PORTION, + ServiceAccessTokenAttributes.JSON_PROPERTY_SCOPES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccessTokenAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private JsonNullable expiresAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LAST_USED_AT = "last_used_at"; + private JsonNullable lastUsedAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private JsonNullable modifiedAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PUBLIC_PORTION = "public_portion"; + private String publicPortion; + + public static final String JSON_PROPERTY_SCOPES = "scopes"; + private List scopes = null; + + /** + * Creation date of the access token. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Expiration date of the access token. + * + * @return expiresAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getExpiresAt() { + + if (expiresAt == null) { + expiresAt = JsonNullable.undefined(); + } + return expiresAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getExpiresAt_JsonNullable() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + private void setExpiresAt_JsonNullable(JsonNullable expiresAt) { + this.expiresAt = expiresAt; + } + + /** + * Date the access token was last used. + * + * @return lastUsedAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getLastUsedAt() { + + if (lastUsedAt == null) { + lastUsedAt = JsonNullable.undefined(); + } + return lastUsedAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LAST_USED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLastUsedAt_JsonNullable() { + return lastUsedAt; + } + + @JsonProperty(JSON_PROPERTY_LAST_USED_AT) + private void setLastUsedAt_JsonNullable(JsonNullable lastUsedAt) { + this.lastUsedAt = lastUsedAt; + } + + /** + * Date of last modification of the access token. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getModifiedAt() { + + if (modifiedAt == null) { + modifiedAt = JsonNullable.undefined(); + } + return modifiedAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getModifiedAt_JsonNullable() { + return modifiedAt; + } + + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + private void setModifiedAt_JsonNullable(JsonNullable modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public ServiceAccessTokenAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the access token. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * The public portion of the access token. + * + * @return publicPortion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_PORTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublicPortion() { + return publicPortion; + } + + public ServiceAccessTokenAttributes scopes(List scopes) { + this.scopes = scopes; + return this; + } + + public ServiceAccessTokenAttributes addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); + } + this.scopes.add(scopesItem); + return this; + } + + /** + * Array of scopes granted to the access token. + * + * @return scopes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getScopes() { + return scopes; + } + + public void setScopes(List scopes) { + this.scopes = scopes; + } + + /** + * 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 ServiceAccessTokenAttributes + */ + @JsonAnySetter + public ServiceAccessTokenAttributes 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 ServiceAccessTokenAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccessTokenAttributes serviceAccessTokenAttributes = (ServiceAccessTokenAttributes) o; + return Objects.equals(this.createdAt, serviceAccessTokenAttributes.createdAt) + && Objects.equals(this.expiresAt, serviceAccessTokenAttributes.expiresAt) + && Objects.equals(this.lastUsedAt, serviceAccessTokenAttributes.lastUsedAt) + && Objects.equals(this.modifiedAt, serviceAccessTokenAttributes.modifiedAt) + && Objects.equals(this.name, serviceAccessTokenAttributes.name) + && Objects.equals(this.publicPortion, serviceAccessTokenAttributes.publicPortion) + && Objects.equals(this.scopes, serviceAccessTokenAttributes.scopes) + && Objects.equals( + this.additionalProperties, serviceAccessTokenAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + expiresAt, + lastUsedAt, + modifiedAt, + name, + publicPortion, + scopes, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccessTokenAttributes {\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"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" publicPortion: ").append(toIndentedString(publicPortion)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).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/ServiceAccessTokenCreateResponse.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenCreateResponse.java new file mode 100644 index 00000000000..33f70b6e712 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenCreateResponse.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response for creating an access token. Includes the token key. */ +@JsonPropertyOrder({ServiceAccessTokenCreateResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccessTokenCreateResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private FullServiceAccessToken data; + + public ServiceAccessTokenCreateResponse data(FullServiceAccessToken data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Datadog access token, including the token key. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FullServiceAccessToken getData() { + return data; + } + + public void setData(FullServiceAccessToken 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 ServiceAccessTokenCreateResponse + */ + @JsonAnySetter + public ServiceAccessTokenCreateResponse 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 ServiceAccessTokenCreateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccessTokenCreateResponse serviceAccessTokenCreateResponse = + (ServiceAccessTokenCreateResponse) o; + return Objects.equals(this.data, serviceAccessTokenCreateResponse.data) + && Objects.equals( + this.additionalProperties, serviceAccessTokenCreateResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccessTokenCreateResponse {\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/ServiceAccessTokenRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenRelationships.java new file mode 100644 index 00000000000..69d883e4a68 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenRelationships.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Resources related to the access token. */ +@JsonPropertyOrder({ServiceAccessTokenRelationships.JSON_PROPERTY_OWNED_BY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccessTokenRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OWNED_BY = "owned_by"; + private RelationshipToServiceAccount ownedBy; + + public ServiceAccessTokenRelationships ownedBy(RelationshipToServiceAccount ownedBy) { + this.ownedBy = ownedBy; + this.unparsed |= ownedBy.unparsed; + return this; + } + + /** + * Relationship to service account. + * + * @return ownedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OWNED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToServiceAccount getOwnedBy() { + return ownedBy; + } + + public void setOwnedBy(RelationshipToServiceAccount ownedBy) { + this.ownedBy = ownedBy; + } + + /** + * 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 ServiceAccessTokenRelationships + */ + @JsonAnySetter + public ServiceAccessTokenRelationships 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 ServiceAccessTokenRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccessTokenRelationships serviceAccessTokenRelationships = + (ServiceAccessTokenRelationships) o; + return Objects.equals(this.ownedBy, serviceAccessTokenRelationships.ownedBy) + && Objects.equals( + this.additionalProperties, serviceAccessTokenRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ownedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccessTokenRelationships {\n"); + sb.append(" ownedBy: ").append(toIndentedString(ownedBy)).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/ServiceAccessTokenResponse.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenResponse.java new file mode 100644 index 00000000000..12a9f1a7dfc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenResponse.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response for retrieving an access token. */ +@JsonPropertyOrder({ServiceAccessTokenResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccessTokenResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ServiceAccessToken data; + + public ServiceAccessTokenResponse data(ServiceAccessToken data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Datadog access token. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ServiceAccessToken getData() { + return data; + } + + public void setData(ServiceAccessToken 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 ServiceAccessTokenResponse + */ + @JsonAnySetter + public ServiceAccessTokenResponse 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 ServiceAccessTokenResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccessTokenResponse serviceAccessTokenResponse = (ServiceAccessTokenResponse) o; + return Objects.equals(this.data, serviceAccessTokenResponse.data) + && Objects.equals( + this.additionalProperties, serviceAccessTokenResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccessTokenResponse {\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/ServiceAccessTokenResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenResponseMeta.java new file mode 100644 index 00000000000..14bd9904ca6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenResponseMeta.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Additional information related to the access token response. */ +@JsonPropertyOrder({ServiceAccessTokenResponseMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccessTokenResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private ServiceAccessTokenResponseMetaPage page; + + public ServiceAccessTokenResponseMeta page(ServiceAccessTokenResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination information. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ServiceAccessTokenResponseMetaPage getPage() { + return page; + } + + public void setPage(ServiceAccessTokenResponseMetaPage page) { + this.page = page; + } + + /** + * 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 ServiceAccessTokenResponseMeta + */ + @JsonAnySetter + public ServiceAccessTokenResponseMeta 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 ServiceAccessTokenResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccessTokenResponseMeta serviceAccessTokenResponseMeta = + (ServiceAccessTokenResponseMeta) o; + return Objects.equals(this.page, serviceAccessTokenResponseMeta.page) + && Objects.equals( + this.additionalProperties, serviceAccessTokenResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccessTokenResponseMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/ServiceAccessTokenResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenResponseMetaPage.java new file mode 100644 index 00000000000..b6869fcfb9a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokenResponseMetaPage.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Pagination information. */ +@JsonPropertyOrder({ServiceAccessTokenResponseMetaPage.JSON_PROPERTY_TOTAL_FILTERED_COUNT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccessTokenResponseMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TOTAL_FILTERED_COUNT = "total_filtered_count"; + private Long totalFilteredCount; + + public ServiceAccessTokenResponseMetaPage totalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + return this; + } + + /** + * Total filtered access token count. + * + * @return totalFilteredCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_FILTERED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalFilteredCount() { + return totalFilteredCount; + } + + public void setTotalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + } + + /** + * 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 ServiceAccessTokenResponseMetaPage + */ + @JsonAnySetter + public ServiceAccessTokenResponseMetaPage 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 ServiceAccessTokenResponseMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccessTokenResponseMetaPage serviceAccessTokenResponseMetaPage = + (ServiceAccessTokenResponseMetaPage) o; + return Objects.equals( + this.totalFilteredCount, serviceAccessTokenResponseMetaPage.totalFilteredCount) + && Objects.equals( + this.additionalProperties, serviceAccessTokenResponseMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(totalFilteredCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccessTokenResponseMetaPage {\n"); + sb.append(" totalFilteredCount: ").append(toIndentedString(totalFilteredCount)).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/ServiceAccessTokensType.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokensType.java new file mode 100644 index 00000000000..86f1dc18950 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccessTokensType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Service access tokens resource type. */ +@JsonSerialize(using = ServiceAccessTokensType.ServiceAccessTokensTypeSerializer.class) +public class ServiceAccessTokensType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("service_access_tokens")); + + public static final ServiceAccessTokensType SERVICE_ACCESS_TOKENS = + new ServiceAccessTokensType("service_access_tokens"); + + ServiceAccessTokensType(String value) { + super(value, allowedValues); + } + + public static class ServiceAccessTokensTypeSerializer + extends StdSerializer { + public ServiceAccessTokensTypeSerializer(Class t) { + super(t); + } + + public ServiceAccessTokensTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ServiceAccessTokensType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ServiceAccessTokensType fromValue(String value) { + return new ServiceAccessTokensType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenCreateData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenCreateData.java index e84b4e94c96..44e5d3d1567 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenCreateData.java +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenCreateData.java @@ -30,7 +30,7 @@ public class ServiceAccountAccessTokenCreateData { private ServiceAccountAccessTokenCreateAttributes attributes; public static final String JSON_PROPERTY_TYPE = "type"; - private PersonalAccessTokensType type = PersonalAccessTokensType.PERSONAL_ACCESS_TOKENS; + private ServiceAccessTokensType type = ServiceAccessTokensType.SERVICE_ACCESS_TOKENS; public ServiceAccountAccessTokenCreateData() {} @@ -38,7 +38,7 @@ public ServiceAccountAccessTokenCreateData() {} public ServiceAccountAccessTokenCreateData( @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) ServiceAccountAccessTokenCreateAttributes attributes, - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) PersonalAccessTokensType type) { + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceAccessTokensType type) { this.attributes = attributes; this.unparsed |= attributes.unparsed; this.type = type; @@ -67,24 +67,24 @@ public void setAttributes(ServiceAccountAccessTokenCreateAttributes attributes) this.attributes = attributes; } - public ServiceAccountAccessTokenCreateData type(PersonalAccessTokensType type) { + public ServiceAccountAccessTokenCreateData type(ServiceAccessTokensType type) { this.type = type; this.unparsed |= !type.isValid(); return this; } /** - * Personal access tokens resource type. + * Service access tokens resource type. * * @return type */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public PersonalAccessTokensType getType() { + public ServiceAccessTokensType getType() { return type; } - public void setType(PersonalAccessTokensType type) { + public void setType(ServiceAccessTokensType type) { if (!type.isValid()) { this.unparsed = true; } diff --git a/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenUpdateAttributes.java new file mode 100644 index 00000000000..5c4ffe89e30 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenUpdateAttributes.java @@ -0,0 +1,177 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes used to update a service account access token. */ +@JsonPropertyOrder({ + ServiceAccountAccessTokenUpdateAttributes.JSON_PROPERTY_NAME, + ServiceAccountAccessTokenUpdateAttributes.JSON_PROPERTY_SCOPES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccountAccessTokenUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SCOPES = "scopes"; + private List scopes = null; + + public ServiceAccountAccessTokenUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the access token. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ServiceAccountAccessTokenUpdateAttributes scopes(List scopes) { + this.scopes = scopes; + return this; + } + + public ServiceAccountAccessTokenUpdateAttributes addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); + } + this.scopes.add(scopesItem); + return this; + } + + /** + * Array of scopes to grant the access token. + * + * @return scopes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getScopes() { + return scopes; + } + + public void setScopes(List scopes) { + this.scopes = scopes; + } + + /** + * 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 ServiceAccountAccessTokenUpdateAttributes + */ + @JsonAnySetter + public ServiceAccountAccessTokenUpdateAttributes 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 ServiceAccountAccessTokenUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccountAccessTokenUpdateAttributes serviceAccountAccessTokenUpdateAttributes = + (ServiceAccountAccessTokenUpdateAttributes) o; + return Objects.equals(this.name, serviceAccountAccessTokenUpdateAttributes.name) + && Objects.equals(this.scopes, serviceAccountAccessTokenUpdateAttributes.scopes) + && Objects.equals( + this.additionalProperties, + serviceAccountAccessTokenUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, scopes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccountAccessTokenUpdateAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).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/ServiceAccountAccessTokenUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenUpdateData.java new file mode 100644 index 00000000000..46012a8ed8c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenUpdateData.java @@ -0,0 +1,212 @@ +/* + * 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; + +/** Object used to update a service account access token. */ +@JsonPropertyOrder({ + ServiceAccountAccessTokenUpdateData.JSON_PROPERTY_ATTRIBUTES, + ServiceAccountAccessTokenUpdateData.JSON_PROPERTY_ID, + ServiceAccountAccessTokenUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccountAccessTokenUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceAccountAccessTokenUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceAccessTokensType type = ServiceAccessTokensType.SERVICE_ACCESS_TOKENS; + + public ServiceAccountAccessTokenUpdateData() {} + + @JsonCreator + public ServiceAccountAccessTokenUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ServiceAccountAccessTokenUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ServiceAccessTokensType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ServiceAccountAccessTokenUpdateData attributes( + ServiceAccountAccessTokenUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes used to update a service account access token. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceAccountAccessTokenUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ServiceAccountAccessTokenUpdateAttributes attributes) { + this.attributes = attributes; + } + + public ServiceAccountAccessTokenUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * ID of the access token. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ServiceAccountAccessTokenUpdateData type(ServiceAccessTokensType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Service access tokens resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceAccessTokensType getType() { + return type; + } + + public void setType(ServiceAccessTokensType 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 ServiceAccountAccessTokenUpdateData + */ + @JsonAnySetter + public ServiceAccountAccessTokenUpdateData 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 ServiceAccountAccessTokenUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccountAccessTokenUpdateData serviceAccountAccessTokenUpdateData = + (ServiceAccountAccessTokenUpdateData) o; + return Objects.equals(this.attributes, serviceAccountAccessTokenUpdateData.attributes) + && Objects.equals(this.id, serviceAccountAccessTokenUpdateData.id) + && Objects.equals(this.type, serviceAccountAccessTokenUpdateData.type) + && Objects.equals( + this.additionalProperties, serviceAccountAccessTokenUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccountAccessTokenUpdateData {\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/ServiceAccountAccessTokenUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenUpdateRequest.java new file mode 100644 index 00000000000..77b16173a2b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountAccessTokenUpdateRequest.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request used to update a service account access token. */ +@JsonPropertyOrder({ServiceAccountAccessTokenUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ServiceAccountAccessTokenUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ServiceAccountAccessTokenUpdateData data; + + public ServiceAccountAccessTokenUpdateRequest() {} + + @JsonCreator + public ServiceAccountAccessTokenUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ServiceAccountAccessTokenUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ServiceAccountAccessTokenUpdateRequest data(ServiceAccountAccessTokenUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Object used to update a service account access token. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ServiceAccountAccessTokenUpdateData getData() { + return data; + } + + public void setData(ServiceAccountAccessTokenUpdateData 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 ServiceAccountAccessTokenUpdateRequest + */ + @JsonAnySetter + public ServiceAccountAccessTokenUpdateRequest 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 ServiceAccountAccessTokenUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceAccountAccessTokenUpdateRequest serviceAccountAccessTokenUpdateRequest = + (ServiceAccountAccessTokenUpdateRequest) o; + return Objects.equals(this.data, serviceAccountAccessTokenUpdateRequest.data) + && Objects.equals( + this.additionalProperties, serviceAccountAccessTokenUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAccountAccessTokenUpdateRequest {\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/ServiceAccountType.java b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountType.java new file mode 100644 index 00000000000..a847aaebf75 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ServiceAccountType.java @@ -0,0 +1,55 @@ +/* + * 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; + +/** Service account resource type. */ +@JsonSerialize(using = ServiceAccountType.ServiceAccountTypeSerializer.class) +public class ServiceAccountType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("service_account")); + + public static final ServiceAccountType SERVICE_ACCOUNT = + new ServiceAccountType("service_account"); + + ServiceAccountType(String value) { + super(value, allowedValues); + } + + public static class ServiceAccountTypeSerializer extends StdSerializer { + public ServiceAccountTypeSerializer(Class t) { + super(t); + } + + public ServiceAccountTypeSerializer() { + this(null); + } + + @Override + public void serialize(ServiceAccountType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ServiceAccountType fromValue(String value) { + return new ServiceAccountType(value); + } +} 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..3b342ca6ea2 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-05-28T14:36:43.282Z \ 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..87340872ac1 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-1779979003@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\":\"a6a9f992-5aa2-11f1-8c27-ea4c41923911\",\"attributes\":{\"uuid\":\"a6a9f992-5aa2-11f1-8c27-ea4c41923911\",\"name\":null,\"handle\":\"a6a9f992-5aa2-11f1-8c27-ea4c41923911\",\"created_at\":\"2026-05-28T14:36:45.255584+00:00\",\"modified_at\":\"2026-05-28T14:36:45.255584+00:00\",\"email\":\"test-create_an_access_token_for_a_service_account_returns_created_response-1779979003@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/a1a6182d465264feebf3b6d627a99b67?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": "4d903806-fae0-9932-f22b-0684c86e2c62" }, { "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-1779979003\",\"scopes\":[\"dashboards_read\"]},\"type\":\"service_access_tokens\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens", + "path": "/api/v2/service_accounts/a6a9f992-5aa2-11f1-8c27-ea4c41923911/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\":\"7767e407-9c67-4ede-902e-c4b1f3782352\",\"type\":\"service_access_tokens\",\"attributes\":{\"created_at\":\"2026-05-28T14:36:45.736320584Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxXxxxxxxxXxxx\",\"name\":\"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1779979003\",\"public_portion\":\"ddsat_3dJZ2IClhMOwsx0xC01NBK\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"a6a9f992-5aa2-11f1-8c27-ea4c41923911\",\"type\":\"service_account\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "6d806020-4556-1183-3ebc-a80b6034dce9" + "id": "fb8e40e6-162c-dfaa-9c4a-ca8012c919af" }, { "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/a6a9f992-5aa2-11f1-8c27-ea4c41923911/access_tokens/7767e407-9c67-4ede-902e-c4b1f3782352", "keepAlive": false, "secure": true }, @@ -78,13 +78,13 @@ "timeToLive": { "unlimited": true }, - "id": "9f6795a3-3733-f1de-83fa-480c56c66320" + "id": "c2c8fc76-20b5-8a47-20c8-6a2e83a6a802" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/498cce13-39cf-11f1-9928-be1871753dee", + "path": "/api/v2/users/a6a9f992-5aa2-11f1-8c27-ea4c41923911", "keepAlive": false, "secure": true }, @@ -99,6 +99,6 @@ "timeToLive": { "unlimited": true }, - "id": "8fda343e-c920-8ee6-219a-f8b36492a756" + "id": "1251b224-1781-2138-8beb-7aa950f0e8ea" } ] \ 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..ac6f9577113 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-05-28T14:36:46.627Z \ 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..8d4548545a9 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-1779979006@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\":\"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c\",\"attributes\":{\"uuid\":\"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c\",\"name\":null,\"handle\":\"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c\",\"created_at\":\"2026-05-28T14:36:46.886919+00:00\",\"modified_at\":\"2026-05-28T14:36:46.886919+00:00\",\"email\":\"test-get_an_access_token_for_a_service_account_returns_ok_response-1779979006@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/eaa658a03758d4761147dd7431d1c8f5?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": "a760b17d-3eb3-ce0a-0389-2605f0cc0869" }, { "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-1779979006\",\"scopes\":[\"dashboards_read\"]},\"type\":\"service_access_tokens\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens", + "path": "/api/v2/service_accounts/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c/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\":\"0abefcae-90ed-4670-94ab-7cea6ca9fb6f\",\"type\":\"service_access_tokens\",\"attributes\":{\"created_at\":\"2026-05-28T14:36:47.296135174Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxXxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1779979006\",\"public_portion\":\"ddsat_0KHCgRdjSyb8EMXtz1E5Cp\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c\",\"type\":\"service_account\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "43c62610-8b63-b6e6-6162-25e0c9c01f18" + "id": "3e66fe09-b4b3-d36f-efef-6f272d73ef5c" }, { "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/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/0abefcae-90ed-4670-94ab-7cea6ca9fb6f", "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\":\"0abefcae-90ed-4670-94ab-7cea6ca9fb6f\",\"type\":\"service_access_tokens\",\"attributes\":{\"created_at\":\"2026-05-28T14:36:47.296135Z\",\"expires_at\":null,\"last_used_at\":null,\"name\":\"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1779979006\",\"public_portion\":\"ddsat_0KHCgRdjSyb8EMXtz1E5Cp\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c\",\"type\":\"service_account\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -83,13 +83,13 @@ "timeToLive": { "unlimited": true }, - "id": "42134347-5af4-f8df-7193-56b4cfa2f4f0" + "id": "f28f3aa0-ff54-2b81-acfc-ab07168a1f70" }, { "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/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/0abefcae-90ed-4670-94ab-7cea6ca9fb6f", "keepAlive": false, "secure": true }, @@ -104,13 +104,13 @@ "timeToLive": { "unlimited": true }, - "id": "207dc4ce-726f-bb5d-f2ec-232ddf8d8fb9" + "id": "ec38a791-79b1-c4fb-8652-0364d0c9da58" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/4a56376d-39cf-11f1-9a29-2eb65349fc01", + "path": "/api/v2/users/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c", "keepAlive": false, "secure": true }, @@ -125,6 +125,6 @@ "timeToLive": { "unlimited": true }, - "id": "98343038-3a18-ef13-9153-732118bbfdc9" + "id": "e7809b39-7b73-85ac-38de-a920c5027778" } ] \ 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..f03d2b6c83e 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-05-28T14:36:48.422Z \ 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..8d4f68f6ce7 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-1779979008@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\":\"a8b64d35-5aa2-11f1-80a5-eec0508b7e6c\",\"attributes\":{\"uuid\":\"a8b64d35-5aa2-11f1-80a5-eec0508b7e6c\",\"name\":null,\"handle\":\"a8b64d35-5aa2-11f1-80a5-eec0508b7e6c\",\"created_at\":\"2026-05-28T14:36:48.691799+00:00\",\"modified_at\":\"2026-05-28T14:36:48.691799+00:00\",\"email\":\"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1779979008@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/80f71434c485335573c82ccfeff519ef?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": "a68bbd8c-0bf4-f12c-bfd3-c18993217c74" }, { "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-1779979008\",\"scopes\":[\"dashboards_read\"]},\"type\":\"service_access_tokens\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens", + "path": "/api/v2/service_accounts/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c/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\":\"7829a158-515b-4c28-b649-eca6529a02b7\",\"type\":\"service_access_tokens\",\"attributes\":{\"created_at\":\"2026-05-28T14:36:49.115287243Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1779979008\",\"public_portion\":\"ddsat_3ek6Sznp1LswenIQzJ44yl\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"a8b64d35-5aa2-11f1-80a5-eec0508b7e6c\",\"type\":\"service_account\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "8a5a8bec-f645-edef-33c1-e3ea927b06ff" + "id": "0595b3c3-a4b8-c7a9-a52c-c6cbf53d4879" }, { "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/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/7829a158-515b-4c28-b649-eca6529a02b7", "keepAlive": false, "secure": true }, @@ -78,13 +78,13 @@ "timeToLive": { "unlimited": true }, - "id": "9f2fc74e-4b0e-839a-3ec0-9da4a2a8ae4b" + "id": "0c0c2117-520f-9543-7c65-08aee7d69e89" }, { "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/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/7829a158-515b-4c28-b649-eca6529a02b7", "keepAlive": false, "secure": true }, @@ -99,13 +99,13 @@ "timeToLive": { "unlimited": true }, - "id": "9f2fc74e-4b0e-839a-3ec0-9da4a2a8ae4c" + "id": "0c0c2117-520f-9543-7c65-08aee7d69e8a" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/4c99fbee-39cf-11f1-beb2-cad70c641dfa", + "path": "/api/v2/users/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c", "keepAlive": false, "secure": true }, @@ -120,6 +120,6 @@ "timeToLive": { "unlimited": true }, - "id": "994e08b8-d361-e7d6-a7a2-8323e62d9c95" + "id": "d2fbed94-b73b-fa82-b0cb-1bdc9709256a" } ] \ 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..283bf60d094 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-05-28T14:36:50.607Z \ 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..01f8bda10d3 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-1779979010@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\":\"aa1d5972-5aa2-11f1-94cc-52d8072c8863\",\"attributes\":{\"uuid\":\"aa1d5972-5aa2-11f1-94cc-52d8072c8863\",\"name\":null,\"handle\":\"aa1d5972-5aa2-11f1-94cc-52d8072c8863\",\"created_at\":\"2026-05-28T14:36:51.044856+00:00\",\"modified_at\":\"2026-05-28T14:36:51.044856+00:00\",\"email\":\"test-update_an_access_token_for_a_service_account_returns_ok_response-1779979010@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/5a4f64a0801adb0c3e3a456f8540dde0?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": "93ac95ad-4577-3099-28e2-f11efaefcc3c" }, { "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-1779979010\",\"scopes\":[\"dashboards_read\"]},\"type\":\"service_access_tokens\"}}" }, "headers": {}, "method": "POST", - "path": "/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens", + "path": "/api/v2/service_accounts/aa1d5972-5aa2-11f1-94cc-52d8072c8863/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\":\"87e35e26-368c-479b-85bd-1036f303736e\",\"type\":\"service_access_tokens\",\"attributes\":{\"created_at\":\"2026-05-28T14:36:51.482285572Z\",\"expires_at\":null,\"key\":\"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1779979010\",\"public_portion\":\"ddsat_48Ps23zLj44c8YDq0ApfDS\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"aa1d5972-5aa2-11f1-94cc-52d8072c8863\",\"type\":\"service_account\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,22 +57,22 @@ "timeToLive": { "unlimited": true }, - "id": "f623cff4-6c3a-0e83-71be-452b054aad18" + "id": "697cacda-a0b1-94a9-31c5-975a21a11d46" }, { "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-1779979010-updated\"},\"id\":\"87e35e26-368c-479b-85bd-1036f303736e\",\"type\":\"service_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/aa1d5972-5aa2-11f1-94cc-52d8072c8863/access_tokens/87e35e26-368c-479b-85bd-1036f303736e", "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\":\"87e35e26-368c-479b-85bd-1036f303736e\",\"type\":\"service_access_tokens\",\"attributes\":{\"created_at\":\"2026-05-28T14:36:51.482285Z\",\"expires_at\":null,\"last_used_at\":null,\"modified_at\":\"2026-05-28T14:36:51.792511Z\",\"name\":\"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1779979010-updated\",\"public_portion\":\"ddsat_48Ps23zLj44c8YDq0ApfDS\",\"scopes\":[\"dashboards_read\"]},\"relationships\":{\"owned_by\":{\"data\":{\"id\":\"aa1d5972-5aa2-11f1-94cc-52d8072c8863\",\"type\":\"service_account\"}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "10f62515-3f2f-dceb-9e2f-46e87cf0e500" + "id": "48a3e330-fd08-5ce7-a567-caa09d916869" }, { "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/aa1d5972-5aa2-11f1-94cc-52d8072c8863/access_tokens/87e35e26-368c-479b-85bd-1036f303736e", "keepAlive": false, "secure": true }, @@ -108,13 +108,13 @@ "timeToLive": { "unlimited": true }, - "id": "ade5368b-108f-866d-8803-6d4c5735ba3c" + "id": "6fb2befe-d7b7-49f5-c69c-66ce905980d8" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/users/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4", + "path": "/api/v2/users/aa1d5972-5aa2-11f1-94cc-52d8072c8863", "keepAlive": false, "secure": true }, @@ -129,6 +129,6 @@ "timeToLive": { "unlimited": true }, - "id": "a3dce74c-505e-2fbb-b31a-a8b86157dc12" + "id": "52a2b1df-1403-b11a-5d9d-743f3bc7dac0" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 7139a86ede5..24058ecf5e1 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -1344,7 +1344,7 @@ }, { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"scopes\": [\"dashboards_read\"]\n },\n \"type\": \"personal_access_tokens\"\n }\n}" + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"scopes\": [\"dashboards_read\"]\n },\n \"type\": \"service_access_tokens\"\n }\n}" } ], "step": "there is a valid \"service_account_access_token\" for \"service_account_user\"", 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 b27f150393b..4043183b7d3 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 @@ -245,7 +245,7 @@ Feature: Key Management Scenario: Get a personal access token returns "Not Found" response Given a valid "appKeyAuth" key in the system And new "GetPersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -254,7 +254,7 @@ Feature: Key Management Given a valid "appKeyAuth" key in the system And 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 "token_id" 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" @@ -278,6 +278,20 @@ Feature: Key Management And the response "data[0].type" is equal to "api_keys" And the response "data[0].attributes" has field "date_last_used" + @generated @skip @team:DataDog/credentials-management + Scenario: Get all access tokens returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "ListPersonalAccessTokens" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/credentials-management + Scenario: Get all access tokens returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "ListPersonalAccessTokens" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "Bad Request" response Given a valid "appKeyAuth" key in the system @@ -325,13 +339,6 @@ Feature: Key Management And the response "data[0].type" is equal to "application_keys" And the response "data[0].attributes" has field "last_used_at" - @generated @skip @team:DataDog/credentials-management - Scenario: Get all personal access tokens returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "ListPersonalAccessTokens" request - When the request is sent - Then the response status is 400 Bad Request - @team:DataDog/credentials-management Scenario: Get all personal access tokens returns "OK" response Given a valid "appKeyAuth" key in the system @@ -396,7 +403,7 @@ Feature: Key Management Given a valid "appKeyAuth" key in the system And 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 "token_id" parameter from "personal_access_token.data.id" When the request is sent Then the response status is 204 No Content @@ -404,7 +411,7 @@ Feature: Key Management Scenario: Revoke a personal access token returns "Not Found" response Given a valid "appKeyAuth" key in the system And new "RevokePersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -412,7 +419,7 @@ Feature: Key Management Scenario: Update a personal access token returns "Bad Request" response Given a valid "appKeyAuth" key in the system And new "UpdatePersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" 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 @@ -421,7 +428,7 @@ Feature: Key Management Scenario: Update a personal access token returns "Not Found" response Given a valid "appKeyAuth" key in the system And new "UpdatePersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" 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 @@ -431,7 +438,7 @@ Feature: Key Management Given a valid "appKeyAuth" key in the system And 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 "token_id" 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/service_accounts.feature b/src/test/resources/com/datadog/api/client/v2/api/service_accounts.feature index fa8c81440e2..9b64bed996a 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 @@ -33,7 +33,7 @@ Feature: Service Accounts Scenario: Create an access token for a service account returns "Bad Request" response Given new "CreateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "Service Account Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "personal_access_tokens"}} + And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "Service Account Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "service_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -42,10 +42,10 @@ Feature: Service Accounts Given there is a valid "service_account_user" in the system And new "CreateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And body with value {"data": {"type": "personal_access_tokens", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read"]}}} + And body with value {"data": {"type": "service_access_tokens", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read"]}}} When the request is sent Then the response status is 201 Created - And the response "data.type" is equal to "personal_access_tokens" + And the response "data.type" is equal to "service_access_tokens" And the response "data.attributes.name" is equal to "{{ unique }}" And the response "data.relationships.owned_by.data.id" has the same value as "service_account_user.data.id" @@ -53,7 +53,7 @@ Feature: Service Accounts Scenario: Create an access token for a service account returns "Not Found" response Given new "CreateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "Service Account Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "personal_access_tokens"}} + And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "Service Account Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "service_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -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 "token_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -152,11 +152,11 @@ 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 "token_id" 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" - And the response "data.type" is equal to "personal_access_tokens" + And the response "data.type" is equal to "service_access_tokens" And the response "data.id" is equal to "{{ service_account_access_token.data.id }}" @generated @skip @team:DataDog/credentials-management @team:DataDog/org-management @@ -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 "token_id" 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 "token_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -248,8 +248,8 @@ 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 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"}} + And request contains "token_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "Updated Service Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "service_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -257,8 +257,8 @@ 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 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"}} + And request contains "token_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "Updated Service Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "service_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -268,10 +268,10 @@ 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 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"}}} + And request contains "token_id" parameter from "service_account_access_token.data.id" + And body with value {"data": {"id": "{{ service_account_access_token.data.id }}", "type": "service_access_tokens", "attributes": {"name": "{{ service_account_access_token.data.attributes.name }}-updated"}}} When the request is sent Then the response status is 200 OK And the response "data.attributes.name" is equal to "{{ service_account_access_token.data.attributes.name }}-updated" - And the response "data.type" is equal to "personal_access_tokens" + And the response "data.type" is equal to "service_access_tokens" And the response "data.id" is equal to "{{ service_account_access_token.data.id }}" 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 b6003df8683..6307f5135f3 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 @@ -5196,7 +5196,7 @@ "operationId": "RevokePersonalAccessToken", "parameters": [ { - "name": "pat_id", + "name": "token_id", "source": "data.id" } ], @@ -6975,7 +6975,7 @@ "source": "data.relationships.owned_by.data.id" }, { - "name": "pat_id", + "name": "token_id", "source": "data.id" } ],