diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4bc99f94bc1d..9b60ce5912c5 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/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen index 7ccf87f4bd58..3b342ca6ea2b 100644 --- a/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen +++ b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen @@ -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/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml index b7dbeb9a60d3..f2ae13f9727e 100644 --- a/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml +++ b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 16 Apr 2026 20:03:06 GMT +- recorded_at: Thu, 28 May 2026 14:36:43 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786@datadoghq.com","service_account":true,"title":"user + string: '{"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: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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"}}}}} ' @@ -25,36 +25,36 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 16 Apr 2026 20:03:06 GMT +- recorded_at: Thu, 28 May 2026 14:36:43 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + string: '{"data":{"attributes":{"name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1779979003","scopes":["dashboards_read"]},"type":"service_access_tokens"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/a6a9f992-5aa2-11f1-8c27-ea4c41923911/access_tokens response: body: encoding: UTF-8 - string: '{"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"}}}}}' + string: '{"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 status: code: 201 message: Created -- recorded_at: Thu, 16 Apr 2026 20:03:06 GMT +- recorded_at: Thu, 28 May 2026 14:36:43 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens/88337232-8552-4495-987c-1cfed567d461 + uri: https://api.datadoghq.com/api/v2/service_accounts/a6a9f992-5aa2-11f1-8c27-ea4c41923911/access_tokens/7767e407-9c67-4ede-902e-c4b1f3782352 response: body: encoding: UTF-8 @@ -63,14 +63,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 16 Apr 2026 20:03:06 GMT +- recorded_at: Thu, 28 May 2026 14:36:43 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/498cce13-39cf-11f1-9928-be1871753dee + uri: https://api.datadoghq.com/api/v2/users/a6a9f992-5aa2-11f1-8c27-ea4c41923911 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen index 767a9f9c2502..ac6f9577113b 100644 --- a/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen +++ b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen @@ -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/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml index df8615ef834c..3bcc048f6a2c 100644 --- a/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml +++ b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT +- recorded_at: Thu, 28 May 2026 14:36:46 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789@datadoghq.com","service_account":true,"title":"user + string: '{"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: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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"}}}}} ' @@ -25,54 +25,54 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT +- recorded_at: Thu, 28 May 2026 14:36:46 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + string: '{"data":{"attributes":{"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1779979006","scopes":["dashboards_read"]},"type":"service_access_tokens"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c/access_tokens response: body: encoding: UTF-8 - string: '{"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"}}}}}' + string: '{"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 status: code: 201 message: Created -- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT +- recorded_at: Thu, 28 May 2026 14:36:46 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153 + uri: https://api.datadoghq.com/api/v2/service_accounts/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/0abefcae-90ed-4670-94ab-7cea6ca9fb6f response: body: encoding: UTF-8 - string: '{"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"}}}}}' + string: '{"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 status: code: 200 message: OK -- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT +- recorded_at: Thu, 28 May 2026 14:36:46 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153 + uri: https://api.datadoghq.com/api/v2/service_accounts/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/0abefcae-90ed-4670-94ab-7cea6ca9fb6f response: body: encoding: UTF-8 @@ -81,14 +81,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 16 Apr 2026 20:03:09 GMT +- recorded_at: Thu, 28 May 2026 14:36:46 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/4a56376d-39cf-11f1-9a29-2eb65349fc01 + uri: https://api.datadoghq.com/api/v2/users/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen index 4a8602fd9133..f03d2b6c83e2 100644 --- a/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen +++ b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen @@ -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/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml index f0f819471571..380b14bb7479 100644 --- a/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml +++ b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT +- recorded_at: Thu, 28 May 2026 14:36:48 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792@datadoghq.com","service_account":true,"title":"user + string: '{"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: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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"}}}}} ' @@ -25,36 +25,36 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT +- recorded_at: Thu, 28 May 2026 14:36:48 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + string: '{"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: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c/access_tokens response: body: encoding: UTF-8 - string: '{"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"}}}}}' + string: '{"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 status: code: 201 message: Created -- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT +- recorded_at: Thu, 28 May 2026 14:36:48 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6 + uri: https://api.datadoghq.com/api/v2/service_accounts/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/7829a158-515b-4c28-b649-eca6529a02b7 response: body: encoding: UTF-8 @@ -63,14 +63,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT +- recorded_at: Thu, 28 May 2026 14:36:48 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6 + uri: https://api.datadoghq.com/api/v2/service_accounts/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/7829a158-515b-4c28-b649-eca6529a02b7 response: body: encoding: UTF-8 @@ -79,14 +79,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 16 Apr 2026 20:03:12 GMT +- recorded_at: Thu, 28 May 2026 14:36:48 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/4c99fbee-39cf-11f1-beb2-cad70c641dfa + uri: https://api.datadoghq.com/api/v2/users/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen index 58278ff6c0fe..283bf60d0947 100644 --- a/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen +++ b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen @@ -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/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml index 55be92bbc34a..12862f8e1387 100644 --- a/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml +++ b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT +- recorded_at: Thu, 28 May 2026 14:36:50 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794@datadoghq.com","service_account":true,"title":"user + string: '{"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: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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"}}}}} ' @@ -25,58 +25,58 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT +- recorded_at: Thu, 28 May 2026 14:36:50 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + string: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1779979010","scopes":["dashboards_read"]},"type":"service_access_tokens"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/aa1d5972-5aa2-11f1-94cc-52d8072c8863/access_tokens response: body: encoding: UTF-8 - string: '{"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"}}}}}' + string: '{"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 status: code: 201 message: Created -- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT +- recorded_at: Thu, 28 May 2026 14:36:50 GMT request: body: encoding: UTF-8 - string: '{"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"}}' + string: '{"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: Accept: - application/json Content-Type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5 + uri: https://api.datadoghq.com/api/v2/service_accounts/aa1d5972-5aa2-11f1-94cc-52d8072c8863/access_tokens/87e35e26-368c-479b-85bd-1036f303736e response: body: encoding: UTF-8 - string: '{"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"}}}}}' + string: '{"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 status: code: 200 message: OK -- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT +- recorded_at: Thu, 28 May 2026 14:36:50 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5 + uri: https://api.datadoghq.com/api/v2/service_accounts/aa1d5972-5aa2-11f1-94cc-52d8072c8863/access_tokens/87e35e26-368c-479b-85bd-1036f303736e response: body: encoding: UTF-8 @@ -85,14 +85,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 16 Apr 2026 20:03:14 GMT +- recorded_at: Thu, 28 May 2026 14:36:50 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4 + uri: https://api.datadoghq.com/api/v2/users/aa1d5972-5aa2-11f1-94cc-52d8072c8863 response: body: encoding: UTF-8 diff --git a/examples/v2/key-management/ListPersonalAccessTokens.rb b/examples/v2/key-management/ListPersonalAccessTokens.rb index 72a58ce6b9a5..f52118fbb05c 100644 --- a/examples/v2/key-management/ListPersonalAccessTokens.rb +++ b/examples/v2/key-management/ListPersonalAccessTokens.rb @@ -1,4 +1,4 @@ -# Get all personal access tokens returns "OK" response +# Get all access tokens returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::KeyManagementAPI.new diff --git a/examples/v2/key-management/ListPersonalAccessTokens_4153414404.rb b/examples/v2/key-management/ListPersonalAccessTokens_4153414404.rb new file mode 100644 index 000000000000..72a58ce6b9a5 --- /dev/null +++ b/examples/v2/key-management/ListPersonalAccessTokens_4153414404.rb @@ -0,0 +1,5 @@ +# Get all personal access tokens returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::KeyManagementAPI.new +p api_instance.list_personal_access_tokens() diff --git a/examples/v2/service-accounts/CreateServiceAccountAccessToken.rb b/examples/v2/service-accounts/CreateServiceAccountAccessToken.rb index 51f5ee744521..c3442398256b 100644 --- a/examples/v2/service-accounts/CreateServiceAccountAccessToken.rb +++ b/examples/v2/service-accounts/CreateServiceAccountAccessToken.rb @@ -8,7 +8,7 @@ body = DatadogAPIClient::V2::ServiceAccountAccessTokenCreateRequest.new({ data: DatadogAPIClient::V2::ServiceAccountAccessTokenCreateData.new({ - type: DatadogAPIClient::V2::PersonalAccessTokensType::PERSONAL_ACCESS_TOKENS, + type: DatadogAPIClient::V2::ServiceAccessTokensType::SERVICE_ACCESS_TOKENS, attributes: DatadogAPIClient::V2::ServiceAccountAccessTokenCreateAttributes.new({ name: "Example-Service-Account", scopes: [ diff --git a/examples/v2/service-accounts/UpdateServiceAccountAccessToken.rb b/examples/v2/service-accounts/UpdateServiceAccountAccessToken.rb index 91d24fd61a58..73bbad6a0063 100644 --- a/examples/v2/service-accounts/UpdateServiceAccountAccessToken.rb +++ b/examples/v2/service-accounts/UpdateServiceAccountAccessToken.rb @@ -10,12 +10,12 @@ SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ATTRIBUTES_NAME = ENV["SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ATTRIBUTES_NAME"] SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID = ENV["SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID"] -body = DatadogAPIClient::V2::PersonalAccessTokenUpdateRequest.new({ - data: DatadogAPIClient::V2::PersonalAccessTokenUpdateData.new({ +body = DatadogAPIClient::V2::ServiceAccountAccessTokenUpdateRequest.new({ + data: DatadogAPIClient::V2::ServiceAccountAccessTokenUpdateData.new({ id: SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, - type: DatadogAPIClient::V2::PersonalAccessTokensType::PERSONAL_ACCESS_TOKENS, - attributes: DatadogAPIClient::V2::PersonalAccessTokenUpdateAttributes.new({ - name: "My Personal Access Token-updated", + type: DatadogAPIClient::V2::ServiceAccessTokensType::SERVICE_ACCESS_TOKENS, + attributes: DatadogAPIClient::V2::ServiceAccountAccessTokenUpdateAttributes.new({ + name: "My Access Token-updated", }), }), }) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index fb9b295c7eca..10a87830d075 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1342,19 +1342,19 @@ "page_number" => "Integer", "sort" => "PersonalAccessTokensSort", "filter" => "String", - "filter_owner_uuid" => "Array", + "filter_owned_by" => "Array", }, "v2.CreatePersonalAccessToken" => { "body" => "PersonalAccessTokenCreateRequest", }, "v2.RevokePersonalAccessToken" => { - "pat_id" => "String", + "token_id" => "String", }, "v2.GetPersonalAccessToken" => { - "pat_id" => "String", + "token_id" => "String", }, "v2.UpdatePersonalAccessToken" => { - "pat_id" => "String", + "token_id" => "String", "body" => "PersonalAccessTokenUpdateRequest", }, "v2.ListAPIs" => { @@ -4709,16 +4709,16 @@ }, "v2.RevokeServiceAccountAccessToken" => { "service_account_id" => "String", - "pat_id" => "String", + "token_id" => "String", }, "v2.GetServiceAccountAccessToken" => { "service_account_id" => "String", - "pat_id" => "String", + "token_id" => "String", }, "v2.UpdateServiceAccountAccessToken" => { "service_account_id" => "String", - "pat_id" => "String", - "body" => "PersonalAccessTokenUpdateRequest", + "token_id" => "String", + "body" => "ServiceAccountAccessTokenUpdateRequest", }, "v2.ListServiceAccountApplicationKeys" => { "service_account_id" => "String", diff --git a/features/v2/given.json b/features/v2/given.json index 7139a86ede5c..24058ecf5e1d 100644 --- a/features/v2/given.json +++ b/features/v2/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/features/v2/key_management.feature b/features/v2/key_management.feature index b27f150393b8..4043183b7d31 100644 --- a/features/v2/key_management.feature +++ b/features/v2/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/features/v2/service_accounts.feature b/features/v2/service_accounts.feature index fa8c81440e26..9b64bed996a1 100644 --- a/features/v2/service_accounts.feature +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index b6003df86834..6307f5135f36 100644 --- a/features/v2/undo.json +++ b/features/v2/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" } ], diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 6ed9f06191bc..ba7071dbca39 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1122,6 +1122,10 @@ def overrides "v1.wildcard_widget_request" => "WildcardWidgetRequest", "v1.wildcard_widget_specification" => "WildcardWidgetSpecification", "v1.wildcard_widget_specification_type" => "WildcardWidgetSpecificationType", + "v2.access_token_list_item" => "AccessTokenListItem", + "v2.access_token_list_item_relationships" => "AccessTokenListItemRelationships", + "v2.access_token_owner_type" => "AccessTokenOwnerType", + "v2.access_tokens_type" => "AccessTokensType", "v2.account_filtering_config" => "AccountFilteringConfig", "v2.action_connection_attributes" => "ActionConnectionAttributes", "v2.action_connection_attributes_update" => "ActionConnectionAttributesUpdate", @@ -3154,6 +3158,8 @@ def overrides "v2.full_custom_framework_data_attributes" => "FullCustomFrameworkDataAttributes", "v2.full_personal_access_token" => "FullPersonalAccessToken", "v2.full_personal_access_token_attributes" => "FullPersonalAccessTokenAttributes", + "v2.full_service_access_token" => "FullServiceAccessToken", + "v2.full_service_access_token_attributes" => "FullServiceAccessTokenAttributes", "v2.gcp_credentials" => "GCPCredentials", "v2.gcp_credentials_update" => "GCPCredentialsUpdate", "v2.gcp_integration" => "GCPIntegration", @@ -3816,6 +3822,7 @@ def overrides "v2.list_scorecard_scores_response" => "ListScorecardScoresResponse", "v2.list_scorecards_response" => "ListScorecardsResponse", "v2.list_security_findings_response" => "ListSecurityFindingsResponse", + "v2.list_service_access_tokens_response" => "ListServiceAccessTokensResponse", "v2.list_tags_response" => "ListTagsResponse", "v2.list_tags_response_data" => "ListTagsResponseData", "v2.list_tags_response_data_attributes" => "ListTagsResponseDataAttributes", @@ -5235,6 +5242,8 @@ def overrides "v2.relation_response_meta" => "RelationResponseMeta", "v2.relation_response_type" => "RelationResponseType", "v2.relationship_item" => "RelationshipItem", + "v2.relationship_to_access_token_owner" => "RelationshipToAccessTokenOwner", + "v2.relationship_to_access_token_owner_data" => "RelationshipToAccessTokenOwnerData", "v2.relationship_to_incident" => "RelationshipToIncident", "v2.relationship_to_incident_attachment" => "RelationshipToIncidentAttachment", "v2.relationship_to_incident_attachment_data" => "RelationshipToIncidentAttachmentData", @@ -5270,6 +5279,8 @@ def overrides "v2.relationship_to_rule_data_object" => "RelationshipToRuleDataObject", "v2.relationship_to_saml_assertion_attribute" => "RelationshipToSAMLAssertionAttribute", "v2.relationship_to_saml_assertion_attribute_data" => "RelationshipToSAMLAssertionAttributeData", + "v2.relationship_to_service_account" => "RelationshipToServiceAccount", + "v2.relationship_to_service_account_data" => "RelationshipToServiceAccountData", "v2.relationship_to_team" => "RelationshipToTeam", "v2.relationship_to_team_data" => "RelationshipToTeamData", "v2.relationship_to_team_link_data" => "RelationshipToTeamLinkData", @@ -6010,12 +6021,24 @@ def overrides "v2.sensitive_data_scanner_suppressions" => "SensitiveDataScannerSuppressions", "v2.sensitive_data_scanner_text_replacement" => "SensitiveDataScannerTextReplacement", "v2.sensitive_data_scanner_text_replacement_type" => "SensitiveDataScannerTextReplacementType", + "v2.service_access_token" => "ServiceAccessToken", + "v2.service_access_token_attributes" => "ServiceAccessTokenAttributes", + "v2.service_access_token_create_response" => "ServiceAccessTokenCreateResponse", + "v2.service_access_token_relationships" => "ServiceAccessTokenRelationships", + "v2.service_access_token_response" => "ServiceAccessTokenResponse", + "v2.service_access_token_response_meta" => "ServiceAccessTokenResponseMeta", + "v2.service_access_token_response_meta_page" => "ServiceAccessTokenResponseMetaPage", + "v2.service_access_tokens_type" => "ServiceAccessTokensType", "v2.service_account_access_token_create_attributes" => "ServiceAccountAccessTokenCreateAttributes", "v2.service_account_access_token_create_data" => "ServiceAccountAccessTokenCreateData", "v2.service_account_access_token_create_request" => "ServiceAccountAccessTokenCreateRequest", + "v2.service_account_access_token_update_attributes" => "ServiceAccountAccessTokenUpdateAttributes", + "v2.service_account_access_token_update_data" => "ServiceAccountAccessTokenUpdateData", + "v2.service_account_access_token_update_request" => "ServiceAccountAccessTokenUpdateRequest", "v2.service_account_create_attributes" => "ServiceAccountCreateAttributes", "v2.service_account_create_data" => "ServiceAccountCreateData", "v2.service_account_create_request" => "ServiceAccountCreateRequest", + "v2.service_account_type" => "ServiceAccountType", "v2.service_definition_create_response" => "ServiceDefinitionCreateResponse", "v2.service_definition_data" => "ServiceDefinitionData", "v2.service_definition_data_attributes" => "ServiceDefinitionDataAttributes", diff --git a/lib/datadog_api_client/v2/api/key_management_api.rb b/lib/datadog_api_client/v2/api/key_management_api.rb index 8f2b1f9def34..baf9ca3368d5 100644 --- a/lib/datadog_api_client/v2/api/key_management_api.rb +++ b/lib/datadog_api_client/v2/api/key_management_api.rb @@ -622,29 +622,29 @@ def get_current_user_application_key_with_http_info(app_key_id, opts = {}) # Get a personal access token. # # @see #get_personal_access_token_with_http_info - def get_personal_access_token(pat_id, opts = {}) - data, _status_code, _headers = get_personal_access_token_with_http_info(pat_id, opts) + def get_personal_access_token(token_id, opts = {}) + data, _status_code, _headers = get_personal_access_token_with_http_info(token_id, opts) data end # Get a personal access token. # - # Get a specific personal access token by its UUID. + # Get a specific personal access token by its ID. # - # @param pat_id [String] The ID of the personal access token. + # @param token_id [String] The ID of the access token. # @param opts [Hash] the optional parameters # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers - def get_personal_access_token_with_http_info(pat_id, opts = {}) + def get_personal_access_token_with_http_info(token_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeyManagementAPI.get_personal_access_token ...' end - # verify the required parameter 'pat_id' is set - if @api_client.config.client_side_validation && pat_id.nil? - fail ArgumentError, "Missing the required parameter 'pat_id' when calling KeyManagementAPI.get_personal_access_token" + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling KeyManagementAPI.get_personal_access_token" end # resource path - local_var_path = '/api/v2/personal_access_tokens/{pat_id}'.sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/personal_access_tokens/{token_id}'.sub('{token_id}', CGI.escape(token_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -926,7 +926,7 @@ def list_current_user_application_keys_with_http_info(opts = {}) return data, status_code, headers end - # Get all personal access tokens. + # Get all access tokens. # # @see #list_personal_access_tokens_with_http_info def list_personal_access_tokens(opts = {}) @@ -934,23 +934,23 @@ def list_personal_access_tokens(opts = {}) data end - # Get all personal access tokens. + # Get all access tokens. # - # List all personal access tokens for the organization. + # List all access tokens for the organization. # # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. # @option opts [Integer] :page_number Specific page number to return. - # @option opts [PersonalAccessTokensSort] :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. - # @option opts [String] :filter Filter personal access tokens by the specified string. - # @option opts [Array] :filter_owner_uuid Filter personal access tokens by the owner's UUID. Supports multiple values. + # @option opts [PersonalAccessTokensSort] :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. + # @option opts [String] :filter Filter access tokens by the specified string. + # @option opts [Array] :filter_owned_by Filter access tokens by the owner's ID. Supports multiple values. # @return [Array<(ListPersonalAccessTokensResponse, Integer, Hash)>] ListPersonalAccessTokensResponse data, response status code and response headers def list_personal_access_tokens_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeyManagementAPI.list_personal_access_tokens ...' end - allowable_values = ['name', '-name', 'created_at', '-created_at', 'expires_at', '-expires_at'] + allowable_values = ['name', '-name', 'created_at', '-created_at', 'expires_at', '-expires_at', 'last_used_at', '-last_used_at'] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end @@ -963,7 +963,7 @@ def list_personal_access_tokens_with_http_info(opts = {}) query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? - query_params[:'filter[owner_uuid]'] = @api_client.build_collection_param(opts[:'filter_owner_uuid'], :multi) if !opts[:'filter_owner_uuid'].nil? + query_params[:'filter[owned_by]'] = @api_client.build_collection_param(opts[:'filter_owned_by'], :multi) if !opts[:'filter_owned_by'].nil? # header parameters header_params = opts[:header_params] || {} @@ -1004,8 +1004,8 @@ def list_personal_access_tokens_with_http_info(opts = {}) # Revoke a personal access token. # # @see #revoke_personal_access_token_with_http_info - def revoke_personal_access_token(pat_id, opts = {}) - revoke_personal_access_token_with_http_info(pat_id, opts) + def revoke_personal_access_token(token_id, opts = {}) + revoke_personal_access_token_with_http_info(token_id, opts) nil end @@ -1013,20 +1013,20 @@ def revoke_personal_access_token(pat_id, opts = {}) # # Revoke a specific personal access token. # - # @param pat_id [String] The ID of the personal access token. + # @param token_id [String] The ID of the access token. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def revoke_personal_access_token_with_http_info(pat_id, opts = {}) + def revoke_personal_access_token_with_http_info(token_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeyManagementAPI.revoke_personal_access_token ...' end - # verify the required parameter 'pat_id' is set - if @api_client.config.client_side_validation && pat_id.nil? - fail ArgumentError, "Missing the required parameter 'pat_id' when calling KeyManagementAPI.revoke_personal_access_token" + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling KeyManagementAPI.revoke_personal_access_token" end # resource path - local_var_path = '/api/v2/personal_access_tokens/{pat_id}'.sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/personal_access_tokens/{token_id}'.sub('{token_id}', CGI.escape(token_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1286,8 +1286,8 @@ def update_current_user_application_key_with_http_info(app_key_id, body, opts = # Update a personal access token. # # @see #update_personal_access_token_with_http_info - def update_personal_access_token(pat_id, body, opts = {}) - data, _status_code, _headers = update_personal_access_token_with_http_info(pat_id, body, opts) + def update_personal_access_token(token_id, body, opts = {}) + data, _status_code, _headers = update_personal_access_token_with_http_info(token_id, body, opts) data end @@ -1295,25 +1295,25 @@ def update_personal_access_token(pat_id, body, opts = {}) # # Update a specific personal access token. # - # @param pat_id [String] The ID of the personal access token. + # @param token_id [String] The ID of the access token. # @param body [PersonalAccessTokenUpdateRequest] # @param opts [Hash] the optional parameters # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers - def update_personal_access_token_with_http_info(pat_id, body, opts = {}) + def update_personal_access_token_with_http_info(token_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: KeyManagementAPI.update_personal_access_token ...' end - # verify the required parameter 'pat_id' is set - if @api_client.config.client_side_validation && pat_id.nil? - fail ArgumentError, "Missing the required parameter 'pat_id' when calling KeyManagementAPI.update_personal_access_token" + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling KeyManagementAPI.update_personal_access_token" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling KeyManagementAPI.update_personal_access_token" end # resource path - local_var_path = '/api/v2/personal_access_tokens/{pat_id}'.sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/personal_access_tokens/{token_id}'.sub('{token_id}', CGI.escape(token_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} diff --git a/lib/datadog_api_client/v2/api/service_accounts_api.rb b/lib/datadog_api_client/v2/api/service_accounts_api.rb index ef823b7d407f..551d4f890c85 100644 --- a/lib/datadog_api_client/v2/api/service_accounts_api.rb +++ b/lib/datadog_api_client/v2/api/service_accounts_api.rb @@ -105,7 +105,7 @@ def create_service_account_access_token(service_account_id, body, opts = {}) # @param service_account_id [String] The ID of the service account. # @param body [ServiceAccountAccessTokenCreateRequest] # @param opts [Hash] the optional parameters - # @return [Array<(PersonalAccessTokenCreateResponse, Integer, Hash)>] PersonalAccessTokenCreateResponse data, response status code and response headers + # @return [Array<(ServiceAccessTokenCreateResponse, Integer, Hash)>] ServiceAccessTokenCreateResponse data, response status code and response headers def create_service_account_access_token_with_http_info(service_account_id, body, opts = {}) if @api_client.config.debugging @@ -139,7 +139,7 @@ def create_service_account_access_token_with_http_info(service_account_id, body, post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'PersonalAccessTokenCreateResponse' + return_type = opts[:debug_return_type] || 'ServiceAccessTokenCreateResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] @@ -307,20 +307,20 @@ def delete_service_account_application_key_with_http_info(service_account_id, ap # Get an access token for a service account. # # @see #get_service_account_access_token_with_http_info - def get_service_account_access_token(service_account_id, pat_id, opts = {}) - data, _status_code, _headers = get_service_account_access_token_with_http_info(service_account_id, pat_id, opts) + def get_service_account_access_token(service_account_id, token_id, opts = {}) + data, _status_code, _headers = get_service_account_access_token_with_http_info(service_account_id, token_id, opts) data end # Get an access token for a service account. # - # 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 service_account_id [String] The ID of the service account. - # @param pat_id [String] The ID of the personal access token. + # @param token_id [String] The ID of the access token. # @param opts [Hash] the optional parameters - # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers - def get_service_account_access_token_with_http_info(service_account_id, pat_id, opts = {}) + # @return [Array<(ServiceAccessTokenResponse, Integer, Hash)>] ServiceAccessTokenResponse data, response status code and response headers + def get_service_account_access_token_with_http_info(service_account_id, token_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.get_service_account_access_token ...' @@ -329,12 +329,12 @@ def get_service_account_access_token_with_http_info(service_account_id, pat_id, if @api_client.config.client_side_validation && service_account_id.nil? fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.get_service_account_access_token" end - # verify the required parameter 'pat_id' is set - if @api_client.config.client_side_validation && pat_id.nil? - fail ArgumentError, "Missing the required parameter 'pat_id' when calling ServiceAccountsAPI.get_service_account_access_token" + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling ServiceAccountsAPI.get_service_account_access_token" end # resource path - local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{token_id}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{token_id}', CGI.escape(token_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -351,7 +351,7 @@ def get_service_account_access_token_with_http_info(service_account_id, pat_id, post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'PersonalAccessTokenResponse' + return_type = opts[:debug_return_type] || 'ServiceAccessTokenResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] @@ -460,9 +460,9 @@ def list_service_account_access_tokens(service_account_id, opts = {}) # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. # @option opts [Integer] :page_number Specific page number to return. - # @option opts [PersonalAccessTokensSort] :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. - # @option opts [String] :filter Filter personal access tokens by the specified string. - # @return [Array<(ListPersonalAccessTokensResponse, Integer, Hash)>] ListPersonalAccessTokensResponse data, response status code and response headers + # @option opts [PersonalAccessTokensSort] :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. + # @option opts [String] :filter Filter access tokens by the specified string. + # @return [Array<(ListServiceAccessTokensResponse, Integer, Hash)>] ListServiceAccessTokensResponse data, response status code and response headers def list_service_account_access_tokens_with_http_info(service_account_id, opts = {}) if @api_client.config.debugging @@ -472,7 +472,7 @@ def list_service_account_access_tokens_with_http_info(service_account_id, opts = if @api_client.config.client_side_validation && service_account_id.nil? fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.list_service_account_access_tokens" end - allowable_values = ['name', '-name', 'created_at', '-created_at', 'expires_at', '-expires_at'] + allowable_values = ['name', '-name', 'created_at', '-created_at', 'expires_at', '-expires_at', 'last_used_at', '-last_used_at'] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end @@ -498,7 +498,7 @@ def list_service_account_access_tokens_with_http_info(service_account_id, opts = post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'ListPersonalAccessTokensResponse' + return_type = opts[:debug_return_type] || 'ListServiceAccessTokensResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] @@ -605,8 +605,8 @@ def list_service_account_application_keys_with_http_info(service_account_id, opt # Revoke an access token for a service account. # # @see #revoke_service_account_access_token_with_http_info - def revoke_service_account_access_token(service_account_id, pat_id, opts = {}) - revoke_service_account_access_token_with_http_info(service_account_id, pat_id, opts) + def revoke_service_account_access_token(service_account_id, token_id, opts = {}) + revoke_service_account_access_token_with_http_info(service_account_id, token_id, opts) nil end @@ -615,10 +615,10 @@ def revoke_service_account_access_token(service_account_id, pat_id, opts = {}) # Revoke a specific access token for a service account. # # @param service_account_id [String] The ID of the service account. - # @param pat_id [String] The ID of the personal access token. + # @param token_id [String] The ID of the access token. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def revoke_service_account_access_token_with_http_info(service_account_id, pat_id, opts = {}) + def revoke_service_account_access_token_with_http_info(service_account_id, token_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.revoke_service_account_access_token ...' @@ -627,12 +627,12 @@ def revoke_service_account_access_token_with_http_info(service_account_id, pat_i if @api_client.config.client_side_validation && service_account_id.nil? fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.revoke_service_account_access_token" end - # verify the required parameter 'pat_id' is set - if @api_client.config.client_side_validation && pat_id.nil? - fail ArgumentError, "Missing the required parameter 'pat_id' when calling ServiceAccountsAPI.revoke_service_account_access_token" + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling ServiceAccountsAPI.revoke_service_account_access_token" end # resource path - local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{token_id}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{token_id}', CGI.escape(token_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -675,8 +675,8 @@ def revoke_service_account_access_token_with_http_info(service_account_id, pat_i # Update an access token for a service account. # # @see #update_service_account_access_token_with_http_info - def update_service_account_access_token(service_account_id, pat_id, body, opts = {}) - data, _status_code, _headers = update_service_account_access_token_with_http_info(service_account_id, pat_id, body, opts) + def update_service_account_access_token(service_account_id, token_id, body, opts = {}) + data, _status_code, _headers = update_service_account_access_token_with_http_info(service_account_id, token_id, body, opts) data end @@ -685,11 +685,11 @@ def update_service_account_access_token(service_account_id, pat_id, body, opts = # Update a specific access token for a service account. # # @param service_account_id [String] The ID of the service account. - # @param pat_id [String] The ID of the personal access token. - # @param body [PersonalAccessTokenUpdateRequest] + # @param token_id [String] The ID of the access token. + # @param body [ServiceAccountAccessTokenUpdateRequest] # @param opts [Hash] the optional parameters - # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers - def update_service_account_access_token_with_http_info(service_account_id, pat_id, body, opts = {}) + # @return [Array<(ServiceAccessTokenResponse, Integer, Hash)>] ServiceAccessTokenResponse data, response status code and response headers + def update_service_account_access_token_with_http_info(service_account_id, token_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.update_service_account_access_token ...' @@ -698,16 +698,16 @@ def update_service_account_access_token_with_http_info(service_account_id, pat_i if @api_client.config.client_side_validation && service_account_id.nil? fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.update_service_account_access_token" end - # verify the required parameter 'pat_id' is set - if @api_client.config.client_side_validation && pat_id.nil? - fail ArgumentError, "Missing the required parameter 'pat_id' when calling ServiceAccountsAPI.update_service_account_access_token" + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling ServiceAccountsAPI.update_service_account_access_token" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ServiceAccountsAPI.update_service_account_access_token" end # resource path - local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_id}', CGI.escape(pat_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{token_id}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{token_id}', CGI.escape(token_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -726,7 +726,7 @@ def update_service_account_access_token_with_http_info(service_account_id, pat_i post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'PersonalAccessTokenResponse' + return_type = opts[:debug_return_type] || 'ServiceAccessTokenResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] diff --git a/lib/datadog_api_client/v2/models/access_token_list_item.rb b/lib/datadog_api_client/v2/models/access_token_list_item.rb new file mode 100644 index 000000000000..ad5b214818f0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/access_token_list_item.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An access token entry returned by the personal access tokens list endpoint. May represent either a personal or a service access token. + class AccessTokenListItem + include BaseGenericModel + + # Attributes of an access token. + attr_accessor :attributes + + # ID of the access token. + attr_accessor :id + + # Resources related to the access token entry in the mixed list response. + attr_accessor :relationships + + # Resource type returned by the access tokens list endpoint. Includes both personal and service access tokens. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PersonalAccessTokenAttributes', + :'id' => :'String', + :'relationships' => :'AccessTokenListItemRelationships', + :'type' => :'AccessTokensType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AccessTokenListItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/access_token_list_item_relationships.rb b/lib/datadog_api_client/v2/models/access_token_list_item_relationships.rb new file mode 100644 index 000000000000..ab4328634851 --- /dev/null +++ b/lib/datadog_api_client/v2/models/access_token_list_item_relationships.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resources related to the access token entry in the mixed list response. + class AccessTokenListItemRelationships + include BaseGenericModel + + # Relationship to the access token's owner. + attr_accessor :owned_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'owned_by' => :'owned_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'owned_by' => :'RelationshipToAccessTokenOwner' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AccessTokenListItemRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'owned_by') + self.owned_by = attributes[:'owned_by'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + owned_by == o.owned_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [owned_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/access_token_owner_type.rb b/lib/datadog_api_client/v2/models/access_token_owner_type.rb new file mode 100644 index 000000000000..79135f0b1825 --- /dev/null +++ b/lib/datadog_api_client/v2/models/access_token_owner_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Owner resource type. Either a user or a service account. + class AccessTokenOwnerType + include BaseEnumModel + + USERS = "users".freeze + SERVICE_ACCOUNT = "service_account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/access_tokens_type.rb b/lib/datadog_api_client/v2/models/access_tokens_type.rb new file mode 100644 index 000000000000..2cc5eae2dbef --- /dev/null +++ b/lib/datadog_api_client/v2/models/access_tokens_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource type returned by the access tokens list endpoint. Includes both personal and service access tokens. + class AccessTokensType + include BaseEnumModel + + PERSONAL_ACCESS_TOKENS = "personal_access_tokens".freeze + SERVICE_ACCESS_TOKENS = "service_access_tokens".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/full_personal_access_token.rb b/lib/datadog_api_client/v2/models/full_personal_access_token.rb index 0e188dae74a6..867a992d8fff 100644 --- a/lib/datadog_api_client/v2/models/full_personal_access_token.rb +++ b/lib/datadog_api_client/v2/models/full_personal_access_token.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Datadog personal access token, including the token key. + # Datadog access token, including the token key. class FullPersonalAccessToken include BaseGenericModel - # Attributes of a full personal access token, including the token key. + # Attributes of a full access token, including the token key. attr_accessor :attributes - # ID of the personal access token. + # ID of the access token. attr_accessor :id - # Resources related to the personal access token. + # Resources related to the access token. attr_accessor :relationships # Personal access tokens resource type. diff --git a/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb b/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb index 6052e702996d..19e3f7d4ddf5 100644 --- a/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb +++ b/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb @@ -17,26 +17,26 @@ require 'time' module DatadogAPIClient::V2 - # Attributes of a full personal access token, including the token key. + # Attributes of a full access token, including the token key. class FullPersonalAccessTokenAttributes include BaseGenericModel - # Creation date of the personal access token. + # Creation date of the access token. attr_accessor :created_at - # Expiration date of the personal access token. + # Expiration date of the access token. attr_accessor :expires_at - # The personal access token key. Only returned upon creation. + # The access token key. Only returned upon creation. attr_accessor :key - # Name of the personal access token. + # Name of the access token. attr_accessor :name - # The public portion of the personal access token. + # The public portion of the access token. attr_accessor :public_portion - # Array of scopes granted to the personal access token. + # Array of scopes granted to the access token. attr_accessor :scopes attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/full_service_access_token.rb b/lib/datadog_api_client/v2/models/full_service_access_token.rb new file mode 100644 index 000000000000..9dcd751a3b08 --- /dev/null +++ b/lib/datadog_api_client/v2/models/full_service_access_token.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Datadog access token, including the token key. + class FullServiceAccessToken + include BaseGenericModel + + # Attributes of a full access token, including the token key. + attr_accessor :attributes + + # ID of the access token. + attr_accessor :id + + # Resources related to the access token. + attr_accessor :relationships + + # Service access tokens resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FullServiceAccessTokenAttributes', + :'id' => :'String', + :'relationships' => :'ServiceAccessTokenRelationships', + :'type' => :'ServiceAccessTokensType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FullServiceAccessToken` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/full_service_access_token_attributes.rb b/lib/datadog_api_client/v2/models/full_service_access_token_attributes.rb new file mode 100644 index 000000000000..10eae4f7519c --- /dev/null +++ b/lib/datadog_api_client/v2/models/full_service_access_token_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a full access token, including the token key. + class FullServiceAccessTokenAttributes + include BaseGenericModel + + # Creation date of the access token. + attr_accessor :created_at + + # Expiration date of the access token. + attr_accessor :expires_at + + # The access token key. Only returned upon creation. + attr_accessor :key + + # Name of the access token. + attr_accessor :name + + # The public portion of the access token. + attr_accessor :public_portion + + # Array of scopes granted to the access token. + attr_accessor :scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'expires_at' => :'expires_at', + :'key' => :'key', + :'name' => :'name', + :'public_portion' => :'public_portion', + :'scopes' => :'scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'expires_at' => :'Time', + :'key' => :'String', + :'name' => :'String', + :'public_portion' => :'String', + :'scopes' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'expires_at', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FullServiceAccessTokenAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'public_portion') + self.public_portion = attributes[:'public_portion'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + expires_at == o.expires_at && + key == o.key && + name == o.name && + public_portion == o.public_portion && + scopes == o.scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, expires_at, key, name, public_portion, scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_personal_access_tokens_response.rb b/lib/datadog_api_client/v2/models/list_personal_access_tokens_response.rb index 218f900b00d2..2cc4fbfc4b07 100644 --- a/lib/datadog_api_client/v2/models/list_personal_access_tokens_response.rb +++ b/lib/datadog_api_client/v2/models/list_personal_access_tokens_response.rb @@ -17,14 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # Response for a list of personal access tokens. + # Response for a list of access tokens. Includes both personal and service access tokens. class ListPersonalAccessTokensResponse include BaseGenericModel - # Array of personal access tokens. + # Array of access tokens. Includes both personal and service access tokens. attr_accessor :data - # Additional information related to the personal access token response. + # Additional information related to the access token response. attr_accessor :meta attr_accessor :additional_properties @@ -42,7 +42,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'Array', + :'data' => :'Array', :'meta' => :'PersonalAccessTokenResponseMeta' } end diff --git a/lib/datadog_api_client/v2/models/list_service_access_tokens_response.rb b/lib/datadog_api_client/v2/models/list_service_access_tokens_response.rb new file mode 100644 index 000000000000..5f7a91fdfbd6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_service_access_tokens_response.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a list of access tokens. + class ListServiceAccessTokensResponse + include BaseGenericModel + + # Array of access tokens. + attr_accessor :data + + # Additional information related to the access token response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ServiceAccessTokenResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListServiceAccessTokensResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token.rb b/lib/datadog_api_client/v2/models/personal_access_token.rb index 151ec2c1cc04..68d81f089ed5 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Datadog personal access token. + # Datadog access token. class PersonalAccessToken include BaseGenericModel - # Attributes of a personal access token. + # Attributes of an access token. attr_accessor :attributes - # ID of the personal access token. + # ID of the access token. attr_accessor :id - # Resources related to the personal access token. + # Resources related to the access token. attr_accessor :relationships # Personal access tokens resource type. diff --git a/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb b/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb index 118f6c7514b8..1c5d01444078 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb @@ -17,29 +17,29 @@ require 'time' module DatadogAPIClient::V2 - # Attributes of a personal access token. + # Attributes of an access token. class PersonalAccessTokenAttributes include BaseGenericModel - # Creation date of the personal access token. + # Creation date of the access token. attr_accessor :created_at - # Expiration date of the personal access token. + # Expiration date of the access token. attr_accessor :expires_at - # Date the personal access token was last used. + # Date the access token was last used. attr_accessor :last_used_at - # Date of last modification of the personal access token. + # Date of last modification of the access token. attr_accessor :modified_at - # Name of the personal access token. + # Name of the access token. attr_accessor :name - # The public portion of the personal access token. + # The public portion of the access token. attr_accessor :public_portion - # Array of scopes granted to the personal access token. + # Array of scopes granted to the access token. attr_accessor :scopes attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/personal_access_token_create_attributes.rb b/lib/datadog_api_client/v2/models/personal_access_token_create_attributes.rb index 958007508550..615c478c54b0 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_create_attributes.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_create_attributes.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Attributes used to create a personal access token. + # Attributes used to create an access token. class PersonalAccessTokenCreateAttributes include BaseGenericModel - # 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. attr_reader :expires_at - # Name of the personal access token. + # Name of the access token. attr_reader :name - # Array of scopes to grant the personal access token. + # Array of scopes to grant the access token. attr_reader :scopes attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/personal_access_token_create_data.rb b/lib/datadog_api_client/v2/models/personal_access_token_create_data.rb index 6e7d592556f9..4e1a89e90b59 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_create_data.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_create_data.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Object used to create a personal access token. + # Object used to create an access token. class PersonalAccessTokenCreateData include BaseGenericModel - # Attributes used to create a personal access token. + # Attributes used to create an access token. attr_reader :attributes # Personal access tokens resource type. diff --git a/lib/datadog_api_client/v2/models/personal_access_token_create_request.rb b/lib/datadog_api_client/v2/models/personal_access_token_create_request.rb index 10b79afa22b7..4e4092ba2bf0 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_create_request.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_create_request.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Request used to create a personal access token. + # Request used to create an access token. class PersonalAccessTokenCreateRequest include BaseGenericModel - # Object used to create a personal access token. + # Object used to create an access token. attr_reader :data attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/personal_access_token_create_response.rb b/lib/datadog_api_client/v2/models/personal_access_token_create_response.rb index 5b9c0c212995..24d95a5ae5b1 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_create_response.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_create_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Response for creating a personal access token. Includes the token key. + # Response for creating an access token. Includes the token key. class PersonalAccessTokenCreateResponse include BaseGenericModel - # Datadog personal access token, including the token key. + # Datadog access token, including the token key. attr_accessor :data attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/personal_access_token_relationships.rb b/lib/datadog_api_client/v2/models/personal_access_token_relationships.rb index ec8646ae7c67..9857a59afbac 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_relationships.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_relationships.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # Resources related to the personal access token. + # Resources related to the access token. class PersonalAccessTokenRelationships include BaseGenericModel diff --git a/lib/datadog_api_client/v2/models/personal_access_token_response.rb b/lib/datadog_api_client/v2/models/personal_access_token_response.rb index f69c91c6f4fe..9a7e44ba581e 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_response.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Response for retrieving a personal access token. + # Response for retrieving an access token. class PersonalAccessTokenResponse include BaseGenericModel - # Datadog personal access token. + # Datadog access token. attr_accessor :data attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/personal_access_token_response_meta.rb b/lib/datadog_api_client/v2/models/personal_access_token_response_meta.rb index aca323882cb1..ad7c96f62f8c 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_response_meta.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_response_meta.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V2 - # Additional information related to the personal access token response. + # Additional information related to the access token response. class PersonalAccessTokenResponseMeta include BaseGenericModel diff --git a/lib/datadog_api_client/v2/models/personal_access_token_response_meta_page.rb b/lib/datadog_api_client/v2/models/personal_access_token_response_meta_page.rb index 2a32411dcefc..f2b1f0ac7ee8 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_response_meta_page.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_response_meta_page.rb @@ -21,7 +21,7 @@ module DatadogAPIClient::V2 class PersonalAccessTokenResponseMetaPage include BaseGenericModel - # Total filtered personal access token count. + # Total filtered access token count. attr_accessor :total_filtered_count attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/personal_access_token_update_attributes.rb b/lib/datadog_api_client/v2/models/personal_access_token_update_attributes.rb index ea1b1d559175..62a386ddeacd 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_update_attributes.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_update_attributes.rb @@ -17,14 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # Attributes used to update a personal access token. + # Attributes used to update an access token. class PersonalAccessTokenUpdateAttributes include BaseGenericModel - # Name of the personal access token. + # Name of the access token. attr_accessor :name - # Array of scopes to grant the personal access token. + # Array of scopes to grant the access token. attr_accessor :scopes attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/personal_access_token_update_data.rb b/lib/datadog_api_client/v2/models/personal_access_token_update_data.rb index 9d6cfcf4b18d..889dc4224410 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_update_data.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_update_data.rb @@ -17,14 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # Object used to update a personal access token. + # Object used to update an access token. class PersonalAccessTokenUpdateData include BaseGenericModel - # Attributes used to update a personal access token. + # Attributes used to update an access token. attr_reader :attributes - # ID of the personal access token. + # ID of the access token. attr_reader :id # Personal access tokens resource type. diff --git a/lib/datadog_api_client/v2/models/personal_access_token_update_request.rb b/lib/datadog_api_client/v2/models/personal_access_token_update_request.rb index fce3a5f9b6e0..210ee0d7804c 100644 --- a/lib/datadog_api_client/v2/models/personal_access_token_update_request.rb +++ b/lib/datadog_api_client/v2/models/personal_access_token_update_request.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Request used to update a personal access token. + # Request used to update an access token. class PersonalAccessTokenUpdateRequest include BaseGenericModel - # Object used to update a personal access token. + # Object used to update an access token. attr_reader :data attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/personal_access_tokens_sort.rb b/lib/datadog_api_client/v2/models/personal_access_tokens_sort.rb index f5fc8de5f111..92cdb11312df 100644 --- a/lib/datadog_api_client/v2/models/personal_access_tokens_sort.rb +++ b/lib/datadog_api_client/v2/models/personal_access_tokens_sort.rb @@ -27,5 +27,7 @@ class PersonalAccessTokensSort CREATED_AT_DESCENDING = "-created_at".freeze EXPIRES_AT_ASCENDING = "expires_at".freeze EXPIRES_AT_DESCENDING = "-expires_at".freeze + LAST_USED_AT_ASCENDING = "last_used_at".freeze + LAST_USED_AT_DESCENDING = "-last_used_at".freeze end end diff --git a/lib/datadog_api_client/v2/models/relationship_to_access_token_owner.rb b/lib/datadog_api_client/v2/models/relationship_to_access_token_owner.rb new file mode 100644 index 000000000000..4b14328d551b --- /dev/null +++ b/lib/datadog_api_client/v2/models/relationship_to_access_token_owner.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to the access token's owner. + class RelationshipToAccessTokenOwner + include BaseGenericModel + + # Relationship to the access token's owner. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RelationshipToAccessTokenOwnerData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToAccessTokenOwner` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/relationship_to_access_token_owner_data.rb b/lib/datadog_api_client/v2/models/relationship_to_access_token_owner_data.rb new file mode 100644 index 000000000000..a38c13253915 --- /dev/null +++ b/lib/datadog_api_client/v2/models/relationship_to_access_token_owner_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to the access token's owner. + class RelationshipToAccessTokenOwnerData + include BaseGenericModel + + # A unique identifier that represents the owner. + attr_reader :id + + # Owner resource type. Either a user or a service account. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'AccessTokenOwnerType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToAccessTokenOwnerData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/relationship_to_service_account.rb b/lib/datadog_api_client/v2/models/relationship_to_service_account.rb new file mode 100644 index 000000000000..dfe313d35353 --- /dev/null +++ b/lib/datadog_api_client/v2/models/relationship_to_service_account.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to service account. + class RelationshipToServiceAccount + include BaseGenericModel + + # Relationship to service account object. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RelationshipToServiceAccountData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToServiceAccount` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/relationship_to_service_account_data.rb b/lib/datadog_api_client/v2/models/relationship_to_service_account_data.rb new file mode 100644 index 000000000000..2512a0bdf318 --- /dev/null +++ b/lib/datadog_api_client/v2/models/relationship_to_service_account_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to service account object. + class RelationshipToServiceAccountData + include BaseGenericModel + + # A unique identifier that represents the service account. + attr_reader :id + + # Service account resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'ServiceAccountType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToServiceAccountData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_access_token.rb b/lib/datadog_api_client/v2/models/service_access_token.rb new file mode 100644 index 000000000000..c8466d02583e --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_access_token.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Datadog access token. + class ServiceAccessToken + include BaseGenericModel + + # Attributes of an access token. + attr_accessor :attributes + + # ID of the access token. + attr_accessor :id + + # Resources related to the access token. + attr_accessor :relationships + + # Service access tokens resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceAccessTokenAttributes', + :'id' => :'String', + :'relationships' => :'ServiceAccessTokenRelationships', + :'type' => :'ServiceAccessTokensType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccessToken` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_access_token_attributes.rb b/lib/datadog_api_client/v2/models/service_access_token_attributes.rb new file mode 100644 index 000000000000..953d5c9b8dd4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_access_token_attributes.rb @@ -0,0 +1,177 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an access token. + class ServiceAccessTokenAttributes + include BaseGenericModel + + # Creation date of the access token. + attr_accessor :created_at + + # Expiration date of the access token. + attr_accessor :expires_at + + # Date the access token was last used. + attr_accessor :last_used_at + + # Date of last modification of the access token. + attr_accessor :modified_at + + # Name of the access token. + attr_accessor :name + + # The public portion of the access token. + attr_accessor :public_portion + + # Array of scopes granted to the access token. + attr_accessor :scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'expires_at' => :'expires_at', + :'last_used_at' => :'last_used_at', + :'modified_at' => :'modified_at', + :'name' => :'name', + :'public_portion' => :'public_portion', + :'scopes' => :'scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'expires_at' => :'Time', + :'last_used_at' => :'Time', + :'modified_at' => :'Time', + :'name' => :'String', + :'public_portion' => :'String', + :'scopes' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'expires_at', + :'last_used_at', + :'modified_at', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccessTokenAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'public_portion') + self.public_portion = attributes[:'public_portion'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + expires_at == o.expires_at && + last_used_at == o.last_used_at && + modified_at == o.modified_at && + name == o.name && + public_portion == o.public_portion && + scopes == o.scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, expires_at, last_used_at, modified_at, name, public_portion, scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_access_token_create_response.rb b/lib/datadog_api_client/v2/models/service_access_token_create_response.rb new file mode 100644 index 000000000000..a6d921a3d85b --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_access_token_create_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for creating an access token. Includes the token key. + class ServiceAccessTokenCreateResponse + include BaseGenericModel + + # Datadog access token, including the token key. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FullServiceAccessToken' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccessTokenCreateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_access_token_relationships.rb b/lib/datadog_api_client/v2/models/service_access_token_relationships.rb new file mode 100644 index 000000000000..397bef115e9e --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_access_token_relationships.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resources related to the access token. + class ServiceAccessTokenRelationships + include BaseGenericModel + + # Relationship to service account. + attr_accessor :owned_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'owned_by' => :'owned_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'owned_by' => :'RelationshipToServiceAccount' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccessTokenRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'owned_by') + self.owned_by = attributes[:'owned_by'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + owned_by == o.owned_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [owned_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_access_token_response.rb b/lib/datadog_api_client/v2/models/service_access_token_response.rb new file mode 100644 index 000000000000..481e58150ce8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_access_token_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for retrieving an access token. + class ServiceAccessTokenResponse + include BaseGenericModel + + # Datadog access token. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ServiceAccessToken' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccessTokenResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_access_token_response_meta.rb b/lib/datadog_api_client/v2/models/service_access_token_response_meta.rb new file mode 100644 index 000000000000..978c51bf1b16 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_access_token_response_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Additional information related to the access token response. + class ServiceAccessTokenResponseMeta + include BaseGenericModel + + # Pagination information. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'ServiceAccessTokenResponseMetaPage' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccessTokenResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_access_token_response_meta_page.rb b/lib/datadog_api_client/v2/models/service_access_token_response_meta_page.rb new file mode 100644 index 000000000000..9ed4d3df21d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_access_token_response_meta_page.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination information. + class ServiceAccessTokenResponseMetaPage + include BaseGenericModel + + # Total filtered access token count. + attr_accessor :total_filtered_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_filtered_count' => :'total_filtered_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_filtered_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccessTokenResponseMetaPage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_filtered_count') + self.total_filtered_count = attributes[:'total_filtered_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_filtered_count == o.total_filtered_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_filtered_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_access_tokens_type.rb b/lib/datadog_api_client/v2/models/service_access_tokens_type.rb new file mode 100644 index 000000000000..f1c02d801e66 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_access_tokens_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Service access tokens resource type. + class ServiceAccessTokensType + include BaseEnumModel + + SERVICE_ACCESS_TOKENS = "service_access_tokens".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/service_account_access_token_create_data.rb b/lib/datadog_api_client/v2/models/service_account_access_token_create_data.rb index c0c45b75bae7..77a9ebec4cbf 100644 --- a/lib/datadog_api_client/v2/models/service_account_access_token_create_data.rb +++ b/lib/datadog_api_client/v2/models/service_account_access_token_create_data.rb @@ -24,7 +24,7 @@ class ServiceAccountAccessTokenCreateData # Attributes used to create a service account access token. attr_reader :attributes - # Personal access tokens resource type. + # Service access tokens resource type. attr_reader :type attr_accessor :additional_properties @@ -43,7 +43,7 @@ def self.attribute_map def self.openapi_types { :'attributes' => :'ServiceAccountAccessTokenCreateAttributes', - :'type' => :'PersonalAccessTokensType' + :'type' => :'ServiceAccessTokensType' } end diff --git a/lib/datadog_api_client/v2/models/service_account_access_token_update_attributes.rb b/lib/datadog_api_client/v2/models/service_account_access_token_update_attributes.rb new file mode 100644 index 000000000000..7036610d696b --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_account_access_token_update_attributes.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes used to update a service account access token. + class ServiceAccountAccessTokenUpdateAttributes + include BaseGenericModel + + # Name of the access token. + attr_accessor :name + + # Array of scopes to grant the access token. + attr_accessor :scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'scopes' => :'scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'scopes' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccountAccessTokenUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + scopes == o.scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_account_access_token_update_data.rb b/lib/datadog_api_client/v2/models/service_account_access_token_update_data.rb new file mode 100644 index 000000000000..0fd21c101157 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_account_access_token_update_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object used to update a service account access token. + class ServiceAccountAccessTokenUpdateData + include BaseGenericModel + + # Attributes used to update a service account access token. + attr_reader :attributes + + # ID of the access token. + attr_reader :id + + # Service access tokens resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceAccountAccessTokenUpdateAttributes', + :'id' => :'String', + :'type' => :'ServiceAccessTokensType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccountAccessTokenUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_account_access_token_update_request.rb b/lib/datadog_api_client/v2/models/service_account_access_token_update_request.rb new file mode 100644 index 000000000000..d3d8eded73b9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_account_access_token_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request used to update a service account access token. + class ServiceAccountAccessTokenUpdateRequest + include BaseGenericModel + + # Object used to update a service account access token. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ServiceAccountAccessTokenUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccountAccessTokenUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_account_type.rb b/lib/datadog_api_client/v2/models/service_account_type.rb new file mode 100644 index 000000000000..fdaffbbb47d6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_account_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Service account resource type. + class ServiceAccountType + include BaseEnumModel + + SERVICE_ACCOUNT = "service_account".freeze + end +end