From 1bf485ca382aa7f22fe729fe2904f61f58a42e32 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 07:28:14 +0000 Subject: [PATCH 1/6] Regenerate client from commit c33af48 of spec repo (#3404) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 476 ++++++++++++++---- ...ce-account-returns-Created-response.frozen | 2 +- ...rvice-account-returns-Created-response.yml | 22 +- ...service-account-returns-OK-response.frozen | 2 +- ...-a-service-account-returns-OK-response.yml | 28 +- ...account-returns-No-Content-response.frozen | 2 +- ...ce-account-returns-No-Content-response.yml | 26 +- ...service-account-returns-OK-response.frozen | 2 +- ...-a-service-account-returns-OK-response.yml | 30 +- .../ListPersonalAccessTokens.rb | 2 +- .../ListPersonalAccessTokens_4153414404.rb | 5 + .../CreateServiceAccountAccessToken.rb | 2 +- .../UpdateServiceAccountAccessToken.rb | 10 +- features/scenarios_model_mapping.rb | 16 +- features/v2/given.json | 2 +- features/v2/key_management.feature | 35 +- features/v2/service_accounts.feature | 32 +- features/v2/undo.json | 4 +- lib/datadog_api_client/inflector.rb | 23 + .../v2/api/key_management_api.rb | 66 +-- .../v2/api/service_accounts_api.rb | 74 +-- .../v2/models/access_token_list_item.rb | 135 +++++ .../access_token_list_item_relationships.rb | 105 ++++ .../v2/models/access_token_owner_type.rb | 27 + .../v2/models/access_tokens_type.rb | 27 + .../v2/models/full_personal_access_token.rb | 8 +- .../full_personal_access_token_attributes.rb | 14 +- .../v2/models/full_service_access_token.rb | 135 +++++ .../full_service_access_token_attributes.rb | 165 ++++++ .../list_personal_access_tokens_response.rb | 8 +- .../list_service_access_tokens_response.rb | 117 +++++ .../v2/models/personal_access_token.rb | 8 +- .../personal_access_token_attributes.rb | 16 +- ...personal_access_token_create_attributes.rb | 8 +- .../personal_access_token_create_data.rb | 4 +- .../personal_access_token_create_request.rb | 4 +- .../personal_access_token_create_response.rb | 4 +- .../personal_access_token_relationships.rb | 2 +- .../models/personal_access_token_response.rb | 4 +- .../personal_access_token_response_meta.rb | 2 +- ...ersonal_access_token_response_meta_page.rb | 2 +- ...personal_access_token_update_attributes.rb | 6 +- .../personal_access_token_update_data.rb | 6 +- .../personal_access_token_update_request.rb | 4 +- .../v2/models/personal_access_tokens_sort.rb | 2 + .../relationship_to_access_token_owner.rb | 123 +++++ ...relationship_to_access_token_owner_data.rb | 144 ++++++ .../models/relationship_to_service_account.rb | 123 +++++ .../relationship_to_service_account_data.rb | 144 ++++++ .../v2/models/service_access_token.rb | 135 +++++ .../models/service_access_token_attributes.rb | 177 +++++++ .../service_access_token_create_response.rb | 105 ++++ .../service_access_token_relationships.rb | 105 ++++ .../models/service_access_token_response.rb | 105 ++++ .../service_access_token_response_meta.rb | 105 ++++ ...service_access_token_response_meta_page.rb | 105 ++++ .../v2/models/service_access_tokens_type.rb | 26 + ...ervice_account_access_token_create_data.rb | 4 +- ..._account_access_token_update_attributes.rb | 117 +++++ ...ervice_account_access_token_update_data.rb | 165 ++++++ ...ice_account_access_token_update_request.rb | 123 +++++ .../v2/models/service_account_type.rb | 26 + 62 files changed, 3194 insertions(+), 312 deletions(-) create mode 100644 examples/v2/key-management/ListPersonalAccessTokens_4153414404.rb create mode 100644 lib/datadog_api_client/v2/models/access_token_list_item.rb create mode 100644 lib/datadog_api_client/v2/models/access_token_list_item_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/access_token_owner_type.rb create mode 100644 lib/datadog_api_client/v2/models/access_tokens_type.rb create mode 100644 lib/datadog_api_client/v2/models/full_service_access_token.rb create mode 100644 lib/datadog_api_client/v2/models/full_service_access_token_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/list_service_access_tokens_response.rb create mode 100644 lib/datadog_api_client/v2/models/relationship_to_access_token_owner.rb create mode 100644 lib/datadog_api_client/v2/models/relationship_to_access_token_owner_data.rb create mode 100644 lib/datadog_api_client/v2/models/relationship_to_service_account.rb create mode 100644 lib/datadog_api_client/v2/models/relationship_to_service_account_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_access_token.rb create mode 100644 lib/datadog_api_client/v2/models/service_access_token_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_access_token_create_response.rb create mode 100644 lib/datadog_api_client/v2/models/service_access_token_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/service_access_token_response.rb create mode 100644 lib/datadog_api_client/v2/models/service_access_token_response_meta.rb create mode 100644 lib/datadog_api_client/v2/models/service_access_token_response_meta_page.rb create mode 100644 lib/datadog_api_client/v2/models/service_access_tokens_type.rb create mode 100644 lib/datadog_api_client/v2/models/service_account_access_token_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_account_access_token_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_account_access_token_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/service_account_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4d59bfade193..f4b982844665 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: @@ -35261,12 +35300,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" @@ -35274,36 +35313,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" @@ -49488,12 +49579,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" @@ -49663,6 +49754,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: @@ -64500,12 +64602,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" @@ -64513,46 +64615,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" @@ -64562,19 +64664,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" @@ -64588,7 +64690,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" @@ -64599,7 +64701,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" @@ -64607,25 +64709,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" @@ -64634,19 +64736,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" @@ -64656,12 +64758,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: @@ -64672,7 +64774,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" @@ -64689,6 +64791,8 @@ components: - -created_at - expires_at - -expires_at + - last_used_at + - -last_used_at type: string x-enum-varnames: - NAME_ASCENDING @@ -64697,6 +64801,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. @@ -68067,6 +68173,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: @@ -68425,6 +68552,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: @@ -79508,6 +79656,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: @@ -79539,7 +79790,7 @@ components: attributes: $ref: "#/components/schemas/ServiceAccountAccessTokenCreateAttributes" type: - $ref: "#/components/schemas/PersonalAccessTokensType" + $ref: "#/components/schemas/ServiceAccessTokensType" required: - attributes - type @@ -79552,6 +79803,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: @@ -79594,6 +79886,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: @@ -140300,14 +140600,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: @@ -140320,6 +140620,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 @@ -140344,7 +140645,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": @@ -140415,12 +140716,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 @@ -140447,10 +140748,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: @@ -140463,6 +140764,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 @@ -140496,7 +140798,7 @@ paths: description: Update a specific personal access token. operationId: UpdatePersonalAccessToken parameters: - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" requestBody: content: application/json: @@ -140526,6 +140828,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 @@ -156156,16 +156459,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: @@ -156211,7 +156515,7 @@ paths: scopes: - dashboards_read - dashboards_write - type: personal_access_tokens + type: service_access_tokens schema: $ref: "#/components/schemas/ServiceAccountAccessTokenCreateRequest" required: true @@ -156227,14 +156531,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: @@ -156264,13 +156568,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 @@ -156296,11 +156600,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: @@ -156312,13 +156616,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: @@ -156346,7 +156651,7 @@ paths: operationId: UpdateServiceAccountAccessToken parameters: - $ref: "#/components/parameters/ServiceAccountID" - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" requestBody: content: application/json: @@ -156355,14 +156660,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": @@ -156375,13 +156680,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 From cba2f846b9cd9d67d8a93f178be370eabad76c90 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 07:54:20 +0000 Subject: [PATCH 2/6] Regenerate client from commit 719a584 of spec repo (#3408) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v1/openapi.yaml | 280 +++++++++++++++++- ...dashboard-with-hostmap-infra-widget.frozen | 1 + ...ew-dashboard-with-hostmap-infra-widget.yml | 45 +++ .../dashboards/CreateDashboard_2882802132.rb | 62 ++++ features/v1/dashboards.feature | 9 + .../hostmap_infra_widget.json | 60 ++++ lib/datadog_api_client/inflector.rb | 10 + .../v1/models/host_map_widget_definition.rb | 2 +- .../host_map_widget_definition_requests.rb | 117 +++++++- .../v1/models/host_map_widget_dimension.rb | 28 ++ .../v1/models/host_map_widget_formula.rb | 165 +++++++++++ .../v1/models/host_map_widget_group_by.rb | 133 +++++++++ .../host_map_widget_infrastructure_request.rb | 244 +++++++++++++++ ..._map_widget_infrastructure_request_leaf.rb | 232 +++++++++++++++ ...get_infrastructure_request_request_type.rb | 26 ++ .../host_map_widget_infrastructure_style.rb | 135 +++++++++ .../v1/models/host_map_widget_node_type.rb | 29 ++ .../models/host_map_widget_scalar_request.rb | 170 +++++++++++ ...p_widget_scalar_request_response_format.rb | 26 ++ 19 files changed, 1768 insertions(+), 6 deletions(-) create mode 100644 cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-infra-widget.frozen create mode 100644 cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-infra-widget.yml create mode 100644 examples/v1/dashboards/CreateDashboard_2882802132.rb create mode 100644 features/v1/dashboards_json_payload/hostmap_infra_widget.json create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_dimension.rb create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_formula.rb create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_group_by.rb create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request.rb create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request_leaf.rb create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request_request_type.rb create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_infrastructure_style.rb create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_node_type.rb create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_scalar_request.rb create mode 100644 lib/datadog_api_client/v1/models/host_map_widget_scalar_request_response_format.rb diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 8a0eaeb9d034..2b22002269f4 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4581,13 +4581,58 @@ components: - requests type: object HostMapWidgetDefinitionRequests: - description: List of definitions. + description: >- + Query definition for the host map widget. Supports two mutually exclusive formats distinguished by the presence of `request_type`: the legacy metric-based format (`fill`/`size`) and the infrastructure-backed format (`request_type`, `node_type`, `enrichments`). example: {} properties: + child: + $ref: "#/components/schemas/HostMapWidgetInfrastructureRequest" + conditional_formats: + description: List of conditional formatting rules applied to fill values. + items: + $ref: "#/components/schemas/WidgetConditionalFormat" + type: array + enrichments: + description: Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + example: + - formulas: + - dimension: fill + formula: "query1" + queries: + - data_source: metrics + name: "query1" + query: "avg:system.cpu.user{*} by {host}" + response_format: scalar + items: + $ref: "#/components/schemas/HostMapWidgetScalarRequest" + type: array fill: $ref: "#/components/schemas/HostMapRequest" + filter: + description: Filter string for the entity set in tag format (for example, `env:prod`). + example: "env:prod" + type: string + group_by: + description: |- + Defines how entities are grouped into tiles. The ordering of entries implies + the grouping hierarchy. + items: + $ref: "#/components/schemas/HostMapWidgetGroupBy" + type: array + no_group_hosts: + description: Whether to hide entities that have no group assignment. + type: boolean + no_metric_hosts: + description: Whether to hide entities that have no enrichment data. + type: boolean + node_type: + $ref: "#/components/schemas/HostMapWidgetNodeType" + request_type: + $ref: "#/components/schemas/HostMapWidgetInfrastructureRequestRequestType" size: $ref: "#/components/schemas/HostMapRequest" + style: + $ref: "#/components/schemas/HostMapWidgetInfrastructureStyle" type: object HostMapWidgetDefinitionStyle: description: The style to apply to the widget. @@ -4614,6 +4659,239 @@ components: type: string x-enum-varnames: - HOSTMAP + HostMapWidgetDimension: + description: Visual dimension driven by a formula in the infrastructure host map widget. + enum: + - node + - fill + - size + example: node + type: string + x-enum-varnames: + - NODE + - FILL + - SIZE + HostMapWidgetFormula: + description: |- + Formula for the infrastructure host map widget that specifies both the expression + and the visual dimension it populates. + properties: + alias: + description: Expression alias. + example: "my-metric" + type: string + dimension: + $ref: "#/components/schemas/HostMapWidgetDimension" + formula: + description: String expression built from queries, formulas, and functions. + example: "query1" + type: string + number_format: + $ref: "#/components/schemas/WidgetNumberFormat" + required: + - formula + - dimension + type: object + HostMapWidgetGroupBy: + description: Defines a grouping dimension for the infrastructure host map. + properties: + column: + description: Column name from the entity table (for example, `cloud_provider`, `tags`, `labels`). + example: tags + type: string + key: + description: Key within the column for nested attribute types (for example, `service` within `tags`). + example: service + type: string + required: + - column + type: object + HostMapWidgetInfrastructureRequest: + description: |- + Infrastructure-backed request for the host map widget. Supports entity-based + visualization with metric query enrichments, tag-based filtering, flexible grouping, + and hierarchical views. + properties: + child: + $ref: "#/components/schemas/HostMapWidgetInfrastructureRequestLeaf" + description: |- + Optional child request for hierarchical visualization (for example, hosts containing + containers). Maximum one level of nesting. + conditional_formats: + description: List of conditional formatting rules applied to fill values. + items: + $ref: "#/components/schemas/WidgetConditionalFormat" + type: array + enrichments: + description: Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + example: + - formulas: + - dimension: fill + formula: "query1" + queries: + - data_source: metrics + name: "query1" + query: "avg:system.cpu.user{*} by {host}" + response_format: scalar + items: + $ref: "#/components/schemas/HostMapWidgetScalarRequest" + type: array + filter: + description: Filter string for the entity set in tag format (for example, `env:prod`). + example: "env:prod" + type: string + group_by: + description: |- + Defines how entities are grouped into tiles. The ordering of entries implies + the grouping hierarchy. + items: + $ref: "#/components/schemas/HostMapWidgetGroupBy" + type: array + no_group_hosts: + description: Whether to hide entities that have no group assignment. + type: boolean + no_metric_hosts: + description: Whether to hide entities that have no enrichment data. + type: boolean + node_type: + $ref: "#/components/schemas/HostMapWidgetNodeType" + request_type: + $ref: "#/components/schemas/HostMapWidgetInfrastructureRequestRequestType" + style: + $ref: "#/components/schemas/HostMapWidgetInfrastructureStyle" + required: + - request_type + - node_type + - enrichments + type: object + HostMapWidgetInfrastructureRequestLeaf: + description: Infrastructure-backed host map child request (leaf node, no further nesting supported). + properties: + conditional_formats: + description: List of conditional formatting rules applied to fill values. + items: + $ref: "#/components/schemas/WidgetConditionalFormat" + type: array + enrichments: + description: Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + example: + - formulas: + - dimension: fill + formula: "query1" + queries: + - data_source: metrics + name: "query1" + query: "avg:system.cpu.user{*} by {host}" + response_format: scalar + items: + $ref: "#/components/schemas/HostMapWidgetScalarRequest" + type: array + filter: + description: Filter string for the entity set in tag format (for example, `env:prod`). + example: "env:prod" + type: string + group_by: + description: |- + Defines how entities are grouped into tiles. The ordering of entries implies + the grouping hierarchy. + items: + $ref: "#/components/schemas/HostMapWidgetGroupBy" + type: array + no_group_hosts: + description: Whether to hide entities that have no group assignment. + type: boolean + no_metric_hosts: + description: Whether to hide entities that have no enrichment data. + type: boolean + node_type: + $ref: "#/components/schemas/HostMapWidgetNodeType" + request_type: + $ref: "#/components/schemas/HostMapWidgetInfrastructureRequestRequestType" + style: + $ref: "#/components/schemas/HostMapWidgetInfrastructureStyle" + required: + - request_type + - node_type + - enrichments + type: object + HostMapWidgetInfrastructureRequestRequestType: + description: Identifies this as an infrastructure-backed host map request. + enum: + - infrastructure_hostmap + example: infrastructure_hostmap + type: string + x-enum-varnames: + - INFRASTRUCTURE_HOSTMAP + HostMapWidgetInfrastructureStyle: + description: Style configuration for the infrastructure host map. + properties: + fill_max: + description: Maximum value for the fill color scale. Omit to use automatic scaling. + format: double + type: number + fill_min: + description: Minimum value for the fill color scale. Omit to use automatic scaling. + format: double + type: number + palette: + description: Color palette name or alias. + example: hostmap_blues + type: string + palette_flip: + description: Whether to invert the color palette. + type: boolean + type: object + HostMapWidgetNodeType: + description: Which type of infrastructure entity to visualize in the host map. + enum: + - host + - container + - pod + - cluster + example: host + type: string + x-enum-varnames: + - HOST + - CONTAINER + - POD + - CLUSTER + HostMapWidgetScalarRequest: + description: |- + Scalar formula request for the infrastructure host map widget. Each formula specifies + which visual dimension it drives. + properties: + formulas: + description: List of formulas that operate on queries, each assigned to a visual dimension. + example: + - dimension: fill + formula: "query1" + items: + $ref: "#/components/schemas/HostMapWidgetFormula" + type: array + queries: + description: List of queries that can be returned directly or used in formulas. + example: + - data_source: "metrics" + name: "my_query" + query: "avg:system.cpu.user{*}" + items: + $ref: "#/components/schemas/FormulaAndFunctionQueryDefinition" + type: array + response_format: + $ref: "#/components/schemas/HostMapWidgetScalarRequestResponseFormat" + required: + - response_format + - queries + - formulas + type: object + HostMapWidgetScalarRequestResponseFormat: + description: Response format for the scalar formula request. Only `scalar` is supported. + enum: + - scalar + example: scalar + type: string + x-enum-varnames: + - SCALAR HostMeta: description: Metadata associated with your host. properties: diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-infra-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-infra-widget.frozen new file mode 100644 index 000000000000..ca27f8a5eff5 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-infra-widget.frozen @@ -0,0 +1 @@ +2026-05-28T19:18:07.925Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-infra-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-infra-widget.yml new file mode 100644 index 000000000000..acbbc1611214 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-infra-widget.yml @@ -0,0 +1,45 @@ +http_interactions: +- recorded_at: Thu, 28 May 2026 19:18:07 GMT + request: + body: + encoding: UTF-8 + string: '{"description":null,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_hostmap_infra_widget-1779995887","widgets":[{"definition":{"requests":{"enrichments":[{"formulas":[{"dimension":"fill","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*} + by {host}"}],"response_format":"scalar"}],"filter":"env:prod","group_by":[{"column":"tags","key":"service"}],"node_type":"host","request_type":"infrastructure_hostmap","style":{"palette":"green_to_orange","palette_flip":false}},"title":"","title_align":"left","title_size":"16","type":"hostmap"},"layout":{"height":22,"width":47,"x":0,"y":0}}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + encoding: UTF-8 + string: '{"id":"ca3-5na-ti2","title":"Test-Create_a_new_dashboard_with_hostmap_infra_widget-1779995887","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"free","url":"/dashboard/ca3-5na-ti2/test-createanewdashboardwithhostmapinfrawidget-1779995887","template_variables":[],"widgets":[{"definition":{"requests":{"enrichments":[{"formulas":[{"dimension":"fill","formula":"query1"}],"queries":[{"data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*} + by {host}"}],"response_format":"scalar"}],"filter":"env:prod","group_by":[{"column":"tags","key":"service"}],"node_type":"host","request_type":"infrastructure_hostmap","style":{"palette":"green_to_orange","palette_flip":false}},"title":"","title_align":"left","title_size":"16","type":"hostmap"},"layout":{"height":22,"width":47,"x":0,"y":0},"id":7949207519561974}],"notify_list":[],"created_at":"2026-05-28T19:18:08.023029+00:00","modified_at":"2026-05-28T19:18:08.023029+00:00","restricted_roles":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 28 May 2026 19:18:07 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/ca3-5na-ti2 + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"ca3-5na-ti2"}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_2882802132.rb b/examples/v1/dashboards/CreateDashboard_2882802132.rb new file mode 100644 index 000000000000..ab06ce5fae5d --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2882802132.rb @@ -0,0 +1,62 @@ +# Create a new dashboard with hostmap infra widget + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Dashboard", + description: nil, + widgets: [ + DatadogAPIClient::V1::Widget.new({ + layout: DatadogAPIClient::V1::WidgetLayout.new({ + x: 0, + y: 0, + width: 47, + height: 22, + }), + definition: DatadogAPIClient::V1::HostMapWidgetDefinition.new({ + title: "", + title_size: "16", + title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, + type: DatadogAPIClient::V1::HostMapWidgetDefinitionType::HOSTMAP, + requests: DatadogAPIClient::V1::HostMapWidgetDefinitionRequests.new({ + request_type: DatadogAPIClient::V1::HostMapWidgetInfrastructureRequestRequestType::INFRASTRUCTURE_HOSTMAP, + node_type: DatadogAPIClient::V1::HostMapWidgetNodeType::HOST, + filter: "env:prod", + group_by: [ + DatadogAPIClient::V1::HostMapWidgetGroupBy.new({ + column: "tags", + key: "service", + }), + ], + enrichments: [ + DatadogAPIClient::V1::HostMapWidgetScalarRequest.new({ + response_format: DatadogAPIClient::V1::HostMapWidgetScalarRequestResponseFormat::SCALAR, + queries: [ + DatadogAPIClient::V1::FormulaAndFunctionMetricQueryDefinition.new({ + data_source: DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource::METRICS, + name: "query1", + query: "avg:system.cpu.user{*} by {host}", + }), + ], + formulas: [ + DatadogAPIClient::V1::HostMapWidgetFormula.new({ + formula: "query1", + dimension: DatadogAPIClient::V1::HostMapWidgetDimension::FILL, + }), + ], + }), + ], + style: DatadogAPIClient::V1::HostMapWidgetInfrastructureStyle.new({ + palette: "green_to_orange", + palette_flip: false, + }), + }), + }), + }), + ], + template_variables: [], + layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE, + notify_list: [], +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 655b599b89b5..65c4c044abf8 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -581,6 +581,15 @@ Feature: Dashboards And the response "widgets[0].definition.xaxis.num_buckets" is equal to 75 And the response "widgets[0].definition.markers" is equal to [{"display_type": "percentile", "value": "50"}, {"display_type": "percentile", "value": "99"}] + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with hostmap infra widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/hostmap_infra_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "hostmap" + And the response "widgets[0].definition.requests" is equal to {"request_type": "infrastructure_hostmap", "node_type": "host", "filter": "env:prod", "group_by": [{"column": "tags", "key": "service"}], "enrichments": [{"response_format": "scalar", "queries": [{"data_source": "metrics", "name": "query1", "query": "avg:system.cpu.user{*} by {host}"}], "formulas": [{"formula": "query1", "dimension": "fill"}]}], "style": {"palette": "green_to_orange", "palette_flip": false}} + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with hostmap widget Given new "CreateDashboard" request diff --git a/features/v1/dashboards_json_payload/hostmap_infra_widget.json b/features/v1/dashboards_json_payload/hostmap_infra_widget.json new file mode 100644 index 000000000000..5890905638dc --- /dev/null +++ b/features/v1/dashboards_json_payload/hostmap_infra_widget.json @@ -0,0 +1,60 @@ +{ + "title":"{{ unique }}", + "description":null, + "widgets":[ + { + "layout":{ + "x":0, + "y":0, + "width":47, + "height":22 + }, + "definition":{ + "title":"", + "title_size":"16", + "title_align":"left", + "type":"hostmap", + "requests":{ + "request_type":"infrastructure_hostmap", + "node_type":"host", + "filter":"env:prod", + "group_by":[ + { + "column":"tags", + "key":"service" + } + ], + "enrichments":[ + { + "response_format":"scalar", + "queries":[ + { + "data_source":"metrics", + "name":"query1", + "query":"avg:system.cpu.user{*} by {host}" + } + ], + "formulas":[ + { + "formula":"query1", + "dimension":"fill" + } + ] + } + ], + "style":{ + "palette":"green_to_orange", + "palette_flip":false + } + } + } + } + ], + "template_variables":[ + + ], + "layout_type":"free", + "notify_list":[ + + ] +} diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ba7071dbca39..6b717920967a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -215,6 +215,16 @@ def overrides "v1.host_map_widget_definition_requests" => "HostMapWidgetDefinitionRequests", "v1.host_map_widget_definition_style" => "HostMapWidgetDefinitionStyle", "v1.host_map_widget_definition_type" => "HostMapWidgetDefinitionType", + "v1.host_map_widget_dimension" => "HostMapWidgetDimension", + "v1.host_map_widget_formula" => "HostMapWidgetFormula", + "v1.host_map_widget_group_by" => "HostMapWidgetGroupBy", + "v1.host_map_widget_infrastructure_request" => "HostMapWidgetInfrastructureRequest", + "v1.host_map_widget_infrastructure_request_leaf" => "HostMapWidgetInfrastructureRequestLeaf", + "v1.host_map_widget_infrastructure_request_request_type" => "HostMapWidgetInfrastructureRequestRequestType", + "v1.host_map_widget_infrastructure_style" => "HostMapWidgetInfrastructureStyle", + "v1.host_map_widget_node_type" => "HostMapWidgetNodeType", + "v1.host_map_widget_scalar_request" => "HostMapWidgetScalarRequest", + "v1.host_map_widget_scalar_request_response_format" => "HostMapWidgetScalarRequestResponseFormat", "v1.host_meta" => "HostMeta", "v1.host_meta_install_method" => "HostMetaInstallMethod", "v1.host_metrics" => "HostMetrics", diff --git a/lib/datadog_api_client/v1/models/host_map_widget_definition.rb b/lib/datadog_api_client/v1/models/host_map_widget_definition.rb index f99ddaedaf44..fef4bb756104 100644 --- a/lib/datadog_api_client/v1/models/host_map_widget_definition.rb +++ b/lib/datadog_api_client/v1/models/host_map_widget_definition.rb @@ -42,7 +42,7 @@ class HostMapWidgetDefinition # Notes on the title. attr_accessor :notes - # List of definitions. + # Query definition for the host map widget. Supports two mutually exclusive formats distinguished by the presence of `request_type`: the legacy metric-based format (`fill`/`size`) and the infrastructure-backed format (`request_type`, `node_type`, `enrichments`). attr_reader :requests # List of tags used to filter the map. diff --git a/lib/datadog_api_client/v1/models/host_map_widget_definition_requests.rb b/lib/datadog_api_client/v1/models/host_map_widget_definition_requests.rb index 4990b2b411a8..5ee4d043f4c3 100644 --- a/lib/datadog_api_client/v1/models/host_map_widget_definition_requests.rb +++ b/lib/datadog_api_client/v1/models/host_map_widget_definition_requests.rb @@ -17,24 +17,67 @@ require 'time' module DatadogAPIClient::V1 - # List of definitions. + # Query definition for the host map widget. Supports two mutually exclusive formats distinguished by the presence of `request_type`: the legacy metric-based format (`fill`/`size`) and the infrastructure-backed format (`request_type`, `node_type`, `enrichments`). class HostMapWidgetDefinitionRequests include BaseGenericModel + # Infrastructure-backed request for the host map widget. Supports entity-based + # visualization with metric query enrichments, tag-based filtering, flexible grouping, + # and hierarchical views. + attr_accessor :child + + # List of conditional formatting rules applied to fill values. + attr_accessor :conditional_formats + + # Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + attr_accessor :enrichments + # Updated host map. attr_accessor :fill + # Filter string for the entity set in tag format (for example, `env:prod`). + attr_accessor :filter + + # Defines how entities are grouped into tiles. The ordering of entries implies + # the grouping hierarchy. + attr_accessor :group_by + + # Whether to hide entities that have no group assignment. + attr_accessor :no_group_hosts + + # Whether to hide entities that have no enrichment data. + attr_accessor :no_metric_hosts + + # Which type of infrastructure entity to visualize in the host map. + attr_accessor :node_type + + # Identifies this as an infrastructure-backed host map request. + attr_accessor :request_type + # Updated host map. attr_accessor :size + # Style configuration for the infrastructure host map. + attr_accessor :style + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { + :'child' => :'child', + :'conditional_formats' => :'conditional_formats', + :'enrichments' => :'enrichments', :'fill' => :'fill', - :'size' => :'size' + :'filter' => :'filter', + :'group_by' => :'group_by', + :'no_group_hosts' => :'no_group_hosts', + :'no_metric_hosts' => :'no_metric_hosts', + :'node_type' => :'node_type', + :'request_type' => :'request_type', + :'size' => :'size', + :'style' => :'style' } end @@ -42,8 +85,18 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'child' => :'HostMapWidgetInfrastructureRequest', + :'conditional_formats' => :'Array', + :'enrichments' => :'Array', :'fill' => :'HostMapRequest', - :'size' => :'HostMapRequest' + :'filter' => :'String', + :'group_by' => :'Array', + :'no_group_hosts' => :'Boolean', + :'no_metric_hosts' => :'Boolean', + :'node_type' => :'HostMapWidgetNodeType', + :'request_type' => :'HostMapWidgetInfrastructureRequestRequestType', + :'size' => :'HostMapRequest', + :'style' => :'HostMapWidgetInfrastructureStyle' } end @@ -65,13 +118,59 @@ def initialize(attributes = {}) end } + if attributes.key?(:'child') + self.child = attributes[:'child'] + end + + if attributes.key?(:'conditional_formats') + if (value = attributes[:'conditional_formats']).is_a?(Array) + self.conditional_formats = value + end + end + + if attributes.key?(:'enrichments') + if (value = attributes[:'enrichments']).is_a?(Array) + self.enrichments = value + end + end + if attributes.key?(:'fill') self.fill = attributes[:'fill'] end + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'no_group_hosts') + self.no_group_hosts = attributes[:'no_group_hosts'] + end + + if attributes.key?(:'no_metric_hosts') + self.no_metric_hosts = attributes[:'no_metric_hosts'] + end + + if attributes.key?(:'node_type') + self.node_type = attributes[:'node_type'] + end + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + if attributes.key?(:'size') self.size = attributes[:'size'] end + + if attributes.key?(:'style') + self.style = attributes[:'style'] + end end # Returns the object in the form of hash, with additionalProperties support. @@ -100,8 +199,18 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + child == o.child && + conditional_formats == o.conditional_formats && + enrichments == o.enrichments && fill == o.fill && + filter == o.filter && + group_by == o.group_by && + no_group_hosts == o.no_group_hosts && + no_metric_hosts == o.no_metric_hosts && + node_type == o.node_type && + request_type == o.request_type && size == o.size && + style == o.style && additional_properties == o.additional_properties end @@ -109,7 +218,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [fill, size, additional_properties].hash + [child, conditional_formats, enrichments, fill, filter, group_by, no_group_hosts, no_metric_hosts, node_type, request_type, size, style, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_dimension.rb b/lib/datadog_api_client/v1/models/host_map_widget_dimension.rb new file mode 100644 index 000000000000..19b125a5684e --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_dimension.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V1 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::V1 + # Visual dimension driven by a formula in the infrastructure host map widget. + class HostMapWidgetDimension + include BaseEnumModel + + NODE = "node".freeze + FILL = "fill".freeze + SIZE = "size".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_formula.rb b/lib/datadog_api_client/v1/models/host_map_widget_formula.rb new file mode 100644 index 000000000000..bfff55f8cc18 --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_formula.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V1 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::V1 + # Formula for the infrastructure host map widget that specifies both the expression + # and the visual dimension it populates. + class HostMapWidgetFormula + include BaseGenericModel + + # Expression alias. + attr_accessor :_alias + + # Visual dimension driven by a formula in the infrastructure host map widget. + attr_reader :dimension + + # String expression built from queries, formulas, and functions. + attr_reader :formula + + # Number format options for the widget. + attr_accessor :number_format + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'dimension' => :'dimension', + :'formula' => :'formula', + :'number_format' => :'number_format' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'dimension' => :'HostMapWidgetDimension', + :'formula' => :'String', + :'number_format' => :'WidgetNumberFormat' + } + 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::V1::HostMapWidgetFormula` 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?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'dimension') + self.dimension = attributes[:'dimension'] + end + + if attributes.key?(:'formula') + self.formula = attributes[:'formula'] + end + + if attributes.key?(:'number_format') + self.number_format = attributes[:'number_format'] + 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 @dimension.nil? + return false if @formula.nil? + true + end + + # Custom attribute writer method with validation + # @param dimension [Object] Object to be assigned + # @!visibility private + def dimension=(dimension) + if dimension.nil? + fail ArgumentError, 'invalid value for "dimension", dimension cannot be nil.' + end + @dimension = dimension + end + + # Custom attribute writer method with validation + # @param formula [Object] Object to be assigned + # @!visibility private + def formula=(formula) + if formula.nil? + fail ArgumentError, 'invalid value for "formula", formula cannot be nil.' + end + @formula = formula + 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 && + _alias == o._alias && + dimension == o.dimension && + formula == o.formula && + number_format == o.number_format && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, dimension, formula, number_format, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_group_by.rb b/lib/datadog_api_client/v1/models/host_map_widget_group_by.rb new file mode 100644 index 000000000000..d6e72c88f6d6 --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_group_by.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V1 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::V1 + # Defines a grouping dimension for the infrastructure host map. + class HostMapWidgetGroupBy + include BaseGenericModel + + # Column name from the entity table (for example, `cloud_provider`, `tags`, `labels`). + attr_reader :column + + # Key within the column for nested attribute types (for example, `service` within `tags`). + attr_accessor :key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'column' => :'column', + :'key' => :'key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'column' => :'String', + :'key' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::HostMapWidgetGroupBy` 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?(:'column') + self.column = attributes[:'column'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + 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 @column.nil? + true + end + + # Custom attribute writer method with validation + # @param column [Object] Object to be assigned + # @!visibility private + def column=(column) + if column.nil? + fail ArgumentError, 'invalid value for "column", column cannot be nil.' + end + @column = column + 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 && + column == o.column && + key == o.key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [column, key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request.rb b/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request.rb new file mode 100644 index 000000000000..5710b4240acc --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request.rb @@ -0,0 +1,244 @@ +=begin +#Datadog API V1 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::V1 + # Infrastructure-backed request for the host map widget. Supports entity-based + # visualization with metric query enrichments, tag-based filtering, flexible grouping, + # and hierarchical views. + class HostMapWidgetInfrastructureRequest + include BaseGenericModel + + # Infrastructure-backed host map child request (leaf node, no further nesting supported). + attr_accessor :child + + # List of conditional formatting rules applied to fill values. + attr_accessor :conditional_formats + + # Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + attr_reader :enrichments + + # Filter string for the entity set in tag format (for example, `env:prod`). + attr_accessor :filter + + # Defines how entities are grouped into tiles. The ordering of entries implies + # the grouping hierarchy. + attr_accessor :group_by + + # Whether to hide entities that have no group assignment. + attr_accessor :no_group_hosts + + # Whether to hide entities that have no enrichment data. + attr_accessor :no_metric_hosts + + # Which type of infrastructure entity to visualize in the host map. + attr_reader :node_type + + # Identifies this as an infrastructure-backed host map request. + attr_reader :request_type + + # Style configuration for the infrastructure host map. + attr_accessor :style + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'child' => :'child', + :'conditional_formats' => :'conditional_formats', + :'enrichments' => :'enrichments', + :'filter' => :'filter', + :'group_by' => :'group_by', + :'no_group_hosts' => :'no_group_hosts', + :'no_metric_hosts' => :'no_metric_hosts', + :'node_type' => :'node_type', + :'request_type' => :'request_type', + :'style' => :'style' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'child' => :'HostMapWidgetInfrastructureRequestLeaf', + :'conditional_formats' => :'Array', + :'enrichments' => :'Array', + :'filter' => :'String', + :'group_by' => :'Array', + :'no_group_hosts' => :'Boolean', + :'no_metric_hosts' => :'Boolean', + :'node_type' => :'HostMapWidgetNodeType', + :'request_type' => :'HostMapWidgetInfrastructureRequestRequestType', + :'style' => :'HostMapWidgetInfrastructureStyle' + } + 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::V1::HostMapWidgetInfrastructureRequest` 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?(:'child') + self.child = attributes[:'child'] + end + + if attributes.key?(:'conditional_formats') + if (value = attributes[:'conditional_formats']).is_a?(Array) + self.conditional_formats = value + end + end + + if attributes.key?(:'enrichments') + if (value = attributes[:'enrichments']).is_a?(Array) + self.enrichments = value + end + end + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'no_group_hosts') + self.no_group_hosts = attributes[:'no_group_hosts'] + end + + if attributes.key?(:'no_metric_hosts') + self.no_metric_hosts = attributes[:'no_metric_hosts'] + end + + if attributes.key?(:'node_type') + self.node_type = attributes[:'node_type'] + end + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'style') + self.style = attributes[:'style'] + 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 @enrichments.nil? + return false if @node_type.nil? + return false if @request_type.nil? + true + end + + # Custom attribute writer method with validation + # @param enrichments [Object] Object to be assigned + # @!visibility private + def enrichments=(enrichments) + if enrichments.nil? + fail ArgumentError, 'invalid value for "enrichments", enrichments cannot be nil.' + end + @enrichments = enrichments + end + + # Custom attribute writer method with validation + # @param node_type [Object] Object to be assigned + # @!visibility private + def node_type=(node_type) + if node_type.nil? + fail ArgumentError, 'invalid value for "node_type", node_type cannot be nil.' + end + @node_type = node_type + end + + # Custom attribute writer method with validation + # @param request_type [Object] Object to be assigned + # @!visibility private + def request_type=(request_type) + if request_type.nil? + fail ArgumentError, 'invalid value for "request_type", request_type cannot be nil.' + end + @request_type = request_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 && + child == o.child && + conditional_formats == o.conditional_formats && + enrichments == o.enrichments && + filter == o.filter && + group_by == o.group_by && + no_group_hosts == o.no_group_hosts && + no_metric_hosts == o.no_metric_hosts && + node_type == o.node_type && + request_type == o.request_type && + style == o.style && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [child, conditional_formats, enrichments, filter, group_by, no_group_hosts, no_metric_hosts, node_type, request_type, style, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request_leaf.rb b/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request_leaf.rb new file mode 100644 index 000000000000..3efc290ce099 --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request_leaf.rb @@ -0,0 +1,232 @@ +=begin +#Datadog API V1 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::V1 + # Infrastructure-backed host map child request (leaf node, no further nesting supported). + class HostMapWidgetInfrastructureRequestLeaf + include BaseGenericModel + + # List of conditional formatting rules applied to fill values. + attr_accessor :conditional_formats + + # Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + attr_reader :enrichments + + # Filter string for the entity set in tag format (for example, `env:prod`). + attr_accessor :filter + + # Defines how entities are grouped into tiles. The ordering of entries implies + # the grouping hierarchy. + attr_accessor :group_by + + # Whether to hide entities that have no group assignment. + attr_accessor :no_group_hosts + + # Whether to hide entities that have no enrichment data. + attr_accessor :no_metric_hosts + + # Which type of infrastructure entity to visualize in the host map. + attr_reader :node_type + + # Identifies this as an infrastructure-backed host map request. + attr_reader :request_type + + # Style configuration for the infrastructure host map. + attr_accessor :style + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'conditional_formats' => :'conditional_formats', + :'enrichments' => :'enrichments', + :'filter' => :'filter', + :'group_by' => :'group_by', + :'no_group_hosts' => :'no_group_hosts', + :'no_metric_hosts' => :'no_metric_hosts', + :'node_type' => :'node_type', + :'request_type' => :'request_type', + :'style' => :'style' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'conditional_formats' => :'Array', + :'enrichments' => :'Array', + :'filter' => :'String', + :'group_by' => :'Array', + :'no_group_hosts' => :'Boolean', + :'no_metric_hosts' => :'Boolean', + :'node_type' => :'HostMapWidgetNodeType', + :'request_type' => :'HostMapWidgetInfrastructureRequestRequestType', + :'style' => :'HostMapWidgetInfrastructureStyle' + } + 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::V1::HostMapWidgetInfrastructureRequestLeaf` 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?(:'conditional_formats') + if (value = attributes[:'conditional_formats']).is_a?(Array) + self.conditional_formats = value + end + end + + if attributes.key?(:'enrichments') + if (value = attributes[:'enrichments']).is_a?(Array) + self.enrichments = value + end + end + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'no_group_hosts') + self.no_group_hosts = attributes[:'no_group_hosts'] + end + + if attributes.key?(:'no_metric_hosts') + self.no_metric_hosts = attributes[:'no_metric_hosts'] + end + + if attributes.key?(:'node_type') + self.node_type = attributes[:'node_type'] + end + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'style') + self.style = attributes[:'style'] + 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 @enrichments.nil? + return false if @node_type.nil? + return false if @request_type.nil? + true + end + + # Custom attribute writer method with validation + # @param enrichments [Object] Object to be assigned + # @!visibility private + def enrichments=(enrichments) + if enrichments.nil? + fail ArgumentError, 'invalid value for "enrichments", enrichments cannot be nil.' + end + @enrichments = enrichments + end + + # Custom attribute writer method with validation + # @param node_type [Object] Object to be assigned + # @!visibility private + def node_type=(node_type) + if node_type.nil? + fail ArgumentError, 'invalid value for "node_type", node_type cannot be nil.' + end + @node_type = node_type + end + + # Custom attribute writer method with validation + # @param request_type [Object] Object to be assigned + # @!visibility private + def request_type=(request_type) + if request_type.nil? + fail ArgumentError, 'invalid value for "request_type", request_type cannot be nil.' + end + @request_type = request_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 && + conditional_formats == o.conditional_formats && + enrichments == o.enrichments && + filter == o.filter && + group_by == o.group_by && + no_group_hosts == o.no_group_hosts && + no_metric_hosts == o.no_metric_hosts && + node_type == o.node_type && + request_type == o.request_type && + style == o.style && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [conditional_formats, enrichments, filter, group_by, no_group_hosts, no_metric_hosts, node_type, request_type, style, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request_request_type.rb b/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request_request_type.rb new file mode 100644 index 000000000000..1019bedfc751 --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_request_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 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::V1 + # Identifies this as an infrastructure-backed host map request. + class HostMapWidgetInfrastructureRequestRequestType + include BaseEnumModel + + INFRASTRUCTURE_HOSTMAP = "infrastructure_hostmap".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_style.rb b/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_style.rb new file mode 100644 index 000000000000..4f8d2510315b --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_infrastructure_style.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V1 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::V1 + # Style configuration for the infrastructure host map. + class HostMapWidgetInfrastructureStyle + include BaseGenericModel + + # Maximum value for the fill color scale. Omit to use automatic scaling. + attr_accessor :fill_max + + # Minimum value for the fill color scale. Omit to use automatic scaling. + attr_accessor :fill_min + + # Color palette name or alias. + attr_accessor :palette + + # Whether to invert the color palette. + attr_accessor :palette_flip + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fill_max' => :'fill_max', + :'fill_min' => :'fill_min', + :'palette' => :'palette', + :'palette_flip' => :'palette_flip' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fill_max' => :'Float', + :'fill_min' => :'Float', + :'palette' => :'String', + :'palette_flip' => :'Boolean' + } + 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::V1::HostMapWidgetInfrastructureStyle` 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?(:'fill_max') + self.fill_max = attributes[:'fill_max'] + end + + if attributes.key?(:'fill_min') + self.fill_min = attributes[:'fill_min'] + end + + if attributes.key?(:'palette') + self.palette = attributes[:'palette'] + end + + if attributes.key?(:'palette_flip') + self.palette_flip = attributes[:'palette_flip'] + 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 && + fill_max == o.fill_max && + fill_min == o.fill_min && + palette == o.palette && + palette_flip == o.palette_flip && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fill_max, fill_min, palette, palette_flip, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_node_type.rb b/lib/datadog_api_client/v1/models/host_map_widget_node_type.rb new file mode 100644 index 000000000000..2f21d19d76dd --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_node_type.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V1 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::V1 + # Which type of infrastructure entity to visualize in the host map. + class HostMapWidgetNodeType + include BaseEnumModel + + HOST = "host".freeze + CONTAINER = "container".freeze + POD = "pod".freeze + CLUSTER = "cluster".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_scalar_request.rb b/lib/datadog_api_client/v1/models/host_map_widget_scalar_request.rb new file mode 100644 index 000000000000..2f30cd9f98e0 --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_scalar_request.rb @@ -0,0 +1,170 @@ +=begin +#Datadog API V1 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::V1 + # Scalar formula request for the infrastructure host map widget. Each formula specifies + # which visual dimension it drives. + class HostMapWidgetScalarRequest + include BaseGenericModel + + # List of formulas that operate on queries, each assigned to a visual dimension. + attr_reader :formulas + + # List of queries that can be returned directly or used in formulas. + attr_reader :queries + + # Response format for the scalar formula request. Only `scalar` is supported. + attr_reader :response_format + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'formulas' => :'formulas', + :'queries' => :'queries', + :'response_format' => :'response_format' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'formulas' => :'Array', + :'queries' => :'Array', + :'response_format' => :'HostMapWidgetScalarRequestResponseFormat' + } + 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::V1::HostMapWidgetScalarRequest` 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?(:'formulas') + if (value = attributes[:'formulas']).is_a?(Array) + self.formulas = value + end + end + + if attributes.key?(:'queries') + if (value = attributes[:'queries']).is_a?(Array) + self.queries = value + end + end + + if attributes.key?(:'response_format') + self.response_format = attributes[:'response_format'] + 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 @formulas.nil? + return false if @queries.nil? + return false if @response_format.nil? + true + end + + # Custom attribute writer method with validation + # @param formulas [Object] Object to be assigned + # @!visibility private + def formulas=(formulas) + if formulas.nil? + fail ArgumentError, 'invalid value for "formulas", formulas cannot be nil.' + end + @formulas = formulas + end + + # Custom attribute writer method with validation + # @param queries [Object] Object to be assigned + # @!visibility private + def queries=(queries) + if queries.nil? + fail ArgumentError, 'invalid value for "queries", queries cannot be nil.' + end + @queries = queries + end + + # Custom attribute writer method with validation + # @param response_format [Object] Object to be assigned + # @!visibility private + def response_format=(response_format) + if response_format.nil? + fail ArgumentError, 'invalid value for "response_format", response_format cannot be nil.' + end + @response_format = response_format + 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 && + formulas == o.formulas && + queries == o.queries && + response_format == o.response_format && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [formulas, queries, response_format, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_scalar_request_response_format.rb b/lib/datadog_api_client/v1/models/host_map_widget_scalar_request_response_format.rb new file mode 100644 index 000000000000..c5ad25c6e255 --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_scalar_request_response_format.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 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::V1 + # Response format for the scalar formula request. Only `scalar` is supported. + class HostMapWidgetScalarRequestResponseFormat + include BaseEnumModel + + SCALAR = "scalar".freeze + end +end From 72934a5cfc02d09c12de4fdf1f24236f9a1c20e7 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 07:59:45 +0000 Subject: [PATCH 3/6] Regenerate client from commit befca65 of spec repo (#3411) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 104 ++++++++++++ ...kConvertExistingSecurityMonitoringRules.rb | 18 ++ features/scenarios_model_mapping.rb | 3 + features/v2/security_monitoring.feature | 21 +++ features/v2/undo.json | 6 + lib/datadog_api_client/inflector.rb | 4 + .../v2/api/security_monitoring_api.rb | 72 ++++++++ ...monitoring_rule_convert_bulk_attributes.rb | 130 +++++++++++++++ ...urity_monitoring_rule_convert_bulk_data.rb | 154 ++++++++++++++++++ ..._monitoring_rule_convert_bulk_data_type.rb | 26 +++ ...ty_monitoring_rule_convert_bulk_payload.rb | 123 ++++++++++++++ 11 files changed, 661 insertions(+) create mode 100644 examples/v2/security-monitoring/BulkConvertExistingSecurityMonitoringRules.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_payload.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f4b982844665..21ac2684f485 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -76342,6 +76342,53 @@ components: required: - status type: object + SecurityMonitoringRuleConvertBulkAttributes: + description: Attributes for bulk converting security monitoring rules to Terraform. + properties: + ruleIds: + description: "List of rule IDs to convert. Each rule will be included in the resulting ZIP file\nas a separate Terraform file." + example: + - def-000-u7q + - def-000-7dd + items: + description: A rule ID to include in the bulk convert. + type: string + minItems: 1 + type: array + required: + - ruleIds + type: object + SecurityMonitoringRuleConvertBulkData: + description: Data for bulk converting security monitoring rules to Terraform. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringRuleConvertBulkAttributes" + id: + description: Request ID. + example: convert_bulk + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringRuleConvertBulkDataType" + required: + - attributes + - type + type: object + SecurityMonitoringRuleConvertBulkDataType: + description: The type of the resource. + enum: + - security_monitoring_rules_convert_bulk + example: security_monitoring_rules_convert_bulk + type: string + x-enum-varnames: + - SECURITY_MONITORING_RULES_CONVERT_BULK + SecurityMonitoringRuleConvertBulkPayload: + description: Payload for bulk converting security monitoring rules to Terraform. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringRuleConvertBulkData" + required: + - data + type: object SecurityMonitoringRuleConvertPayload: description: Convert a rule from JSON to Terraform. oneOf: @@ -153879,6 +153926,63 @@ paths: operator: OR permissions: - security_monitoring_rules_write + /api/v2/security_monitoring/rules/convert/bulk: + post: + description: |- + Convert a list of existing security monitoring rules to Terraform for the Datadog provider + resource `datadog_security_monitoring_rule`. Returns a ZIP archive containing one Terraform + file per rule. You can convert rules for the following types: + - App and API Protection + - Cloud SIEM (log detection and signal correlation) + - Workload Protection + operationId: BulkConvertExistingSecurityMonitoringRules + requestBody: + content: + "application/json": + examples: + default: + value: + data: + attributes: + ruleIds: + - def-000-u7q + - def-000-7dd + id: convert_bulk + type: security_monitoring_rules_convert_bulk + schema: + $ref: "#/components/schemas/SecurityMonitoringRuleConvertBulkPayload" + required: true + responses: + "200": + content: + application/zip: + examples: + default: + value: "" + schema: + format: binary + type: string + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: Bulk convert rules to Terraform + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_read /api/v2/security_monitoring/rules/test: post: description: |- diff --git a/examples/v2/security-monitoring/BulkConvertExistingSecurityMonitoringRules.rb b/examples/v2/security-monitoring/BulkConvertExistingSecurityMonitoringRules.rb new file mode 100644 index 000000000000..a34db2bb8bb3 --- /dev/null +++ b/examples/v2/security-monitoring/BulkConvertExistingSecurityMonitoringRules.rb @@ -0,0 +1,18 @@ +# Bulk convert rules to Terraform returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringRuleConvertBulkPayload.new({ + data: DatadogAPIClient::V2::SecurityMonitoringRuleConvertBulkData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringRuleConvertBulkAttributes.new({ + rule_ids: [ + "def-000-u7q", + "def-000-7dd", + ], + }), + id: "convert_bulk", + type: DatadogAPIClient::V2::SecurityMonitoringRuleConvertBulkDataType::SECURITY_MONITORING_RULES_CONVERT_BULK, + }), +}) +p api_instance.bulk_convert_existing_security_monitoring_rules(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 10a87830d075..c3511c20380c 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2271,6 +2271,9 @@ "v2.ConvertSecurityMonitoringRuleFromJSONToTerraform" => { "body" => "SecurityMonitoringRuleConvertPayload", }, + "v2.BulkConvertExistingSecurityMonitoringRules" => { + "body" => "SecurityMonitoringRuleConvertBulkPayload", + }, "v2.TestSecurityMonitoringRule" => { "body" => "SecurityMonitoringRuleTestRequest", }, diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 4bafaa9bebfb..d23634826e6a 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -115,6 +115,27 @@ Feature: Security Monitoring And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" And the response "data.attributes.insights" has item with field "resource_id" with value "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Bulk convert rules to Terraform returns "Bad Request" response + Given new "BulkConvertExistingSecurityMonitoringRules" request + And body with value {"data": {"attributes": {"ruleIds": ["def-000-u7q", "def-000-7dd"]}, "id": "convert_bulk", "type": "security_monitoring_rules_convert_bulk"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Bulk convert rules to Terraform returns "Not Found" response + Given new "BulkConvertExistingSecurityMonitoringRules" request + And body with value {"data": {"attributes": {"ruleIds": ["def-000-u7q", "def-000-7dd"]}, "id": "convert_bulk", "type": "security_monitoring_rules_convert_bulk"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Bulk convert rules to Terraform returns "OK" response + Given new "BulkConvertExistingSecurityMonitoringRules" request + And body with value {"data": {"attributes": {"ruleIds": ["def-000-u7q", "def-000-7dd"]}, "id": "convert_bulk", "type": "security_monitoring_rules_convert_bulk"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Bulk delete security monitoring rules returns "Bad Request" response Given new "BulkDeleteSecurityMonitoringRules" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 6307f5135f36..7c2c10a20142 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6688,6 +6688,12 @@ "type": "idempotent" } }, + "BulkConvertExistingSecurityMonitoringRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "TestSecurityMonitoringRule": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 6b717920967a..a2bf9039b2d8 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5846,6 +5846,10 @@ def overrides "v2.security_monitoring_rule_case_action_options_flagged_ip_type" => "SecurityMonitoringRuleCaseActionOptionsFlaggedIPType", "v2.security_monitoring_rule_case_action_type" => "SecurityMonitoringRuleCaseActionType", "v2.security_monitoring_rule_case_create" => "SecurityMonitoringRuleCaseCreate", + "v2.security_monitoring_rule_convert_bulk_attributes" => "SecurityMonitoringRuleConvertBulkAttributes", + "v2.security_monitoring_rule_convert_bulk_data" => "SecurityMonitoringRuleConvertBulkData", + "v2.security_monitoring_rule_convert_bulk_data_type" => "SecurityMonitoringRuleConvertBulkDataType", + "v2.security_monitoring_rule_convert_bulk_payload" => "SecurityMonitoringRuleConvertBulkPayload", "v2.security_monitoring_rule_convert_payload" => "SecurityMonitoringRuleConvertPayload", "v2.security_monitoring_rule_convert_response" => "SecurityMonitoringRuleConvertResponse", "v2.security_monitoring_rule_create_payload" => "SecurityMonitoringRuleCreatePayload", diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index af0443c45d0b..14499c50ad99 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -311,6 +311,78 @@ def batch_get_security_monitoring_dataset_dependencies_with_http_info(body, opts return data, status_code, headers end + # Bulk convert rules to Terraform. + # + # @see #bulk_convert_existing_security_monitoring_rules_with_http_info + def bulk_convert_existing_security_monitoring_rules(body, opts = {}) + data, _status_code, _headers = bulk_convert_existing_security_monitoring_rules_with_http_info(body, opts) + data + end + + # Bulk convert rules to Terraform. + # + # Convert a list of existing security monitoring rules to Terraform for the Datadog provider + # resource `datadog_security_monitoring_rule`. Returns a ZIP archive containing one Terraform + # file per rule. You can convert rules for the following types: + # - App and API Protection + # - Cloud SIEM (log detection and signal correlation) + # - Workload Protection + # + # @param body [SecurityMonitoringRuleConvertBulkPayload] + # @param opts [Hash] the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def bulk_convert_existing_security_monitoring_rules_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.bulk_convert_existing_security_monitoring_rules ...' + 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 SecurityMonitoringAPI.bulk_convert_existing_security_monitoring_rules" + end + # resource path + local_var_path = '/api/v2/security_monitoring/rules/convert/bulk' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/zip', 'application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'File' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :bulk_convert_existing_security_monitoring_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#bulk_convert_existing_security_monitoring_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Bulk subscribe to sample log generation. # # @see #bulk_create_sample_log_generation_subscriptions_with_http_info diff --git a/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_attributes.rb new file mode 100644 index 000000000000..bf4e0ffd3b1e --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_attributes.rb @@ -0,0 +1,130 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for bulk converting security monitoring rules to Terraform. + class SecurityMonitoringRuleConvertBulkAttributes + include BaseGenericModel + + # List of rule IDs to convert. Each rule will be included in the resulting ZIP file + # as a separate Terraform file. + attr_reader :rule_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'rule_ids' => :'ruleIds' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'rule_ids' => :'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::SecurityMonitoringRuleConvertBulkAttributes` 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?(:'rule_ids') + if (value = attributes[:'rule_ids']).is_a?(Array) + self.rule_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @rule_ids.nil? + return false if @rule_ids.length < 1 + true + end + + # Custom attribute writer method with validation + # @param rule_ids [Object] Object to be assigned + # @!visibility private + def rule_ids=(rule_ids) + if rule_ids.nil? + fail ArgumentError, 'invalid value for "rule_ids", rule_ids cannot be nil.' + end + if rule_ids.length < 1 + fail ArgumentError, 'invalid value for "rule_ids", number of items must be greater than or equal to 1.' + end + @rule_ids = rule_ids + 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 && + rule_ids == o.rule_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [rule_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_data.rb new file mode 100644 index 000000000000..6a85609246d6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for bulk converting security monitoring rules to Terraform. + class SecurityMonitoringRuleConvertBulkData + include BaseGenericModel + + # Attributes for bulk converting security monitoring rules to Terraform. + attr_reader :attributes + + # Request ID. + attr_accessor :id + + # The type of the resource. + 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' => :'SecurityMonitoringRuleConvertBulkAttributes', + :'id' => :'String', + :'type' => :'SecurityMonitoringRuleConvertBulkDataType' + } + 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::SecurityMonitoringRuleConvertBulkData` 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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/security_monitoring_rule_convert_bulk_data_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_data_type.rb new file mode 100644 index 000000000000..330532fdba65 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. + class SecurityMonitoringRuleConvertBulkDataType + include BaseEnumModel + + SECURITY_MONITORING_RULES_CONVERT_BULK = "security_monitoring_rules_convert_bulk".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_payload.rb b/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_payload.rb new file mode 100644 index 000000000000..0fa2a4bb30e8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_bulk_payload.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 + # Payload for bulk converting security monitoring rules to Terraform. + class SecurityMonitoringRuleConvertBulkPayload + include BaseGenericModel + + # Data for bulk converting security monitoring rules to Terraform. + 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' => :'SecurityMonitoringRuleConvertBulkData' + } + 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::SecurityMonitoringRuleConvertBulkPayload` 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 From edc92c8595061164730f7d4de023d537d3a08cac Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 08:12:11 +0000 Subject: [PATCH 4/6] Regenerate client from commit 15d471f of spec repo (#3389) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 717 +++++++++++++++++- .../BatchUpdateLLMObsDataset.rb | 45 ++ .../llm-observability/CloneLLMObsDataset.rb | 19 + .../llm-observability/ExportLLMObsDataset.rb | 8 + .../RestoreLLMObsDatasetVersion.rb | 18 + .../UploadLLMObsDatasetRecordsFile.rb | 8 + features/scenarios_model_mapping.rb | 30 + features/v2/llm_observability.feature | 154 ++++ features/v2/undo.json | 32 + lib/datadog_api_client/configuration.rb | 5 + lib/datadog_api_client/inflector.rb | 14 + .../v2/api/llm_observability_api.rb | 431 +++++++++++ ...et_batch_update_data_attributes_request.rb | 153 ++++ ...m_obs_dataset_batch_update_data_request.rb | 165 ++++ ..._obs_dataset_batch_update_insert_record.rb | 166 ++++ .../llm_obs_dataset_batch_update_request.rb | 123 +++ ..._obs_dataset_batch_update_update_record.rb | 172 +++++ ...s_dataset_clone_data_attributes_request.rb | 133 ++++ .../llm_obs_dataset_clone_data_request.rb | 165 ++++ .../models/llm_obs_dataset_clone_request.rb | 123 +++ .../models/llm_obs_dataset_export_format.rb | 26 + .../llm_obs_dataset_record_tag_operations.rb | 131 ++++ .../llm_obs_dataset_records_upload_file.rb | 105 +++ ...restore_version_data_attributes_request.rb | 127 ++++ ...bs_dataset_restore_version_data_request.rb | 165 ++++ ...llm_obs_dataset_restore_version_request.rb | 123 +++ 26 files changed, 3340 insertions(+), 18 deletions(-) create mode 100644 examples/v2/llm-observability/BatchUpdateLLMObsDataset.rb create mode 100644 examples/v2/llm-observability/CloneLLMObsDataset.rb create mode 100644 examples/v2/llm-observability/ExportLLMObsDataset.rb create mode 100644 examples/v2/llm-observability/RestoreLLMObsDatasetVersion.rb create mode 100644 examples/v2/llm-observability/UploadLLMObsDatasetRecordsFile.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_insert_record.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_update_record.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_clone_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_export_format.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_record_tag_operations.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_records_upload_file.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_request.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 21ac2684f485..25b7d2083191 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -45430,6 +45430,142 @@ components: type: string x-enum-varnames: - DELETION_REQUEST + LLMObsDatasetBatchUpdateDataAttributesRequest: + description: Attributes for batch-updating records in an LLM Observability dataset. + properties: + create_new_version: + description: Whether to create a new dataset version when applying the batch update. Defaults to `true`. + example: true + type: boolean + delete_records: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateDeleteRecords" + insert_records: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateInsertRecords" + tags: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + update_records: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateUpdateRecords" + type: object + LLMObsDatasetBatchUpdateDataRequest: + description: Data object for batch-updating records in an LLM Observability dataset. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateDataAttributesRequest" + id: + description: Unique identifier of the dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetBatchUpdateDeleteRecords: + description: Record IDs to delete. + items: + description: A record ID to delete. + type: string + type: array + LLMObsDatasetBatchUpdateInsertRecord: + description: A record to insert as part of a batch update on an LLM Observability dataset. + properties: + expected_output: + $ref: "#/components/schemas/AnyValue" + id: + description: Optional user-provided identifier for the record. If omitted, the server generates an identifier. + example: "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c" + type: string + input: + $ref: "#/components/schemas/AnyValue" + metadata: + additionalProperties: {} + description: Arbitrary metadata associated with the record. + type: object + tag_operations: + $ref: "#/components/schemas/LLMObsDatasetRecordTagOperations" + tags: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + required: + - input + type: object + LLMObsDatasetBatchUpdateInsertRecords: + description: Records to insert. + items: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateInsertRecord" + type: array + LLMObsDatasetBatchUpdateRequest: + description: Request to batch-insert, update, and delete records in an LLM Observability dataset. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateDataRequest" + required: + - data + type: object + LLMObsDatasetBatchUpdateUpdateRecord: + description: A record update payload as part of a batch update on an LLM Observability dataset. + properties: + expected_output: + $ref: "#/components/schemas/AnyValue" + id: + description: Unique identifier of the record to update. + example: "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c" + type: string + input: + $ref: "#/components/schemas/AnyValue" + metadata: + additionalProperties: {} + description: Updated metadata associated with the record. + type: object + tag_operations: + $ref: "#/components/schemas/LLMObsDatasetRecordTagOperations" + required: + - id + type: object + LLMObsDatasetBatchUpdateUpdateRecords: + description: Records to update by ID. + items: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateUpdateRecord" + type: array + LLMObsDatasetCloneDataAttributesRequest: + description: Attributes for cloning an LLM Observability dataset. + properties: + description: + description: Description of the cloned dataset. + example: "Clone of the original dataset for experimentation." + type: string + name: + description: Name of the cloned dataset. + example: "My cloned dataset" + type: string + required: + - name + type: object + LLMObsDatasetCloneDataRequest: + description: Data object for cloning an LLM Observability dataset. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetCloneDataAttributesRequest" + id: + description: Identifier of the source dataset to clone. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetCloneRequest: + description: Request to clone an LLM Observability dataset. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetCloneDataRequest" + required: + - data + type: object LLMObsDatasetDataAttributesRequest: description: Attributes for creating an LLM Observability dataset. properties: @@ -45586,6 +45722,15 @@ components: required: - id type: object + LLMObsDatasetExportFormat: + default: csv + description: Supported export format for an LLM Observability dataset. + enum: + - csv + example: csv + type: string + x-enum-varnames: + - CSV LLMObsDatasetRecordDataResponse: description: A single LLM Observability dataset record. properties: @@ -45639,6 +45784,22 @@ components: required: - input type: object + LLMObsDatasetRecordTagOperations: + description: Explicit tag operations for updating records. Operations are applied in order, Remove then Add then Set. `set` is the final override; if specified, the result of `remove` and `add` is discarded. + properties: + add: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + remove: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + set: + $ref: "#/components/schemas/LLMObsDatasetRecordTagsList" + type: object + LLMObsDatasetRecordTagsList: + description: List of tag strings. + items: + description: A tag. + type: string + type: array LLMObsDatasetRecordUpdateItem: description: A record update payload for an LLM Observability dataset. properties: @@ -45755,6 +45916,14 @@ components: required: - data type: object + LLMObsDatasetRecordsUploadFile: + description: Multipart payload for uploading dataset records from a file. + properties: + file: + description: The records file to upload. Currently only CSV is supported. The file must include an `input` column. Optional columns include `id`, `expected_output`, `metadata`, and `tags`. + format: binary + type: string + type: object LLMObsDatasetRequest: description: Request to create an LLM Observability dataset. properties: @@ -45771,6 +45940,42 @@ components: required: - data type: object + LLMObsDatasetRestoreVersionDataAttributesRequest: + description: Attributes for restoring an LLM Observability dataset to a previous version. + properties: + dataset_version: + description: Version number of the dataset to restore. Must be between 0 and the current version of the dataset, inclusive. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - dataset_version + type: object + LLMObsDatasetRestoreVersionDataRequest: + description: Data object for restoring an LLM Observability dataset to a previous version. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetRestoreVersionDataAttributesRequest" + id: + description: Unique identifier of the dataset to restore. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetRestoreVersionRequest: + description: Request to restore an LLM Observability dataset to a previous version. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetRestoreVersionDataRequest" + required: + - data + type: object LLMObsDatasetType: description: Resource type of an LLM Observability dataset. enum: @@ -129997,10 +130202,10 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state: - get: - description: Retrieve the draft state of a dataset, including whether it is currently locked for editing and which user holds the lock. - operationId: GetLLMObsDatasetDraftState + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_update: + post: + description: Insert, update, and delete records in a single dataset operation. By default, a new dataset version is created when the batch is applied. + operationId: BatchUpdateLLMObsDataset parameters: - description: The ID of the LLM Observability project. example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" @@ -130016,6 +130221,137 @@ paths: required: true schema: type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + create_new_version: true + delete_records: + - rec-old-record-1 + insert_records: + - expected_output: + answer: "Paris" + input: + question: "What is the capital of France?" + tags: + - "topic:geography" + update_records: + - expected_output: + answer: "Paris, France" + id: rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: datasets + schema: + $ref: "#/components/schemas/LLMObsDatasetBatchUpdateRequest" + description: Batch update payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - records: + - created_at: "2024-01-15T10:30:00Z" + dataset_id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + expected_output: + answer: "Paris, France" + id: rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c + input: + question: "What is the capital of France?" + metadata: + updated_at: "2024-01-15T10:30:00Z" + schema: + $ref: "#/components/schemas/LLMObsDatasetRecordsMutationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "413": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Payload Too Large + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Batch update LLM Observability dataset records + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/clone: + post: + description: Clone a dataset, copying its current records into a new dataset within the same project. + operationId: CloneLLMObsDataset + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the source LLM Observability dataset to clone. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: "Clone of the original dataset for experimentation." + name: "My cloned dataset" + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: datasets + schema: + $ref: "#/components/schemas/LLMObsDatasetCloneRequest" + description: Clone dataset payload. + required: true responses: "200": content: @@ -130025,16 +130361,16 @@ paths: value: data: attributes: - drafting_since: "2024-01-15T10:30:00Z" - user: - email: jane.doe@example.com - handle: jane.doe@example.com - id: 00000000-0000-0000-0000-000000000010 - name: Jane Doe - id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d - type: draft_state_data + created_at: "2024-01-15T10:30:00Z" + current_version: 0 + description: "Clone of the original dataset for experimentation." + metadata: + name: "My cloned dataset" + updated_at: "2024-01-15T10:30:00Z" + id: 7c8d4e9a-1234-5678-9abc-def012345678 + type: datasets schema: - $ref: "#/components/schemas/LLMObsDatasetDraftStateResponse" + $ref: "#/components/schemas/LLMObsDatasetResponse" description: OK "400": content: @@ -130071,16 +130407,96 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Get LLM Observability dataset draft state + summary: Clone an LLM Observability dataset tags: - LLM Observability x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state/lock: - patch: - description: Acquire the draft lock on a dataset for the calling user. The lock prevents other users from concurrently editing the dataset draft. - operationId: LockLLMObsDatasetDraftState + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state: + get: + description: Retrieve the draft state of a dataset, including whether it is currently locked for editing and which user holds the lock. + operationId: GetLLMObsDatasetDraftState + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + drafting_since: "2024-01-15T10:30:00Z" + user: + email: jane.doe@example.com + handle: jane.doe@example.com + id: 00000000-0000-0000-0000-000000000010 + name: Jane Doe + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: draft_state_data + schema: + $ref: "#/components/schemas/LLMObsDatasetDraftStateResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get LLM Observability dataset draft state + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state/lock: + patch: + description: Acquire the draft lock on a dataset for the calling user. The lock prevents other users from concurrently editing the dataset draft. + operationId: LockLLMObsDatasetDraftState parameters: - description: The ID of the LLM Observability project. example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" @@ -130220,6 +130636,88 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/export: + get: + description: Download the contents of a dataset as a CSV file. The download is streamed and includes one row per dataset record. + operationId: ExportLLMObsDataset + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + - description: Export format for the dataset contents. Only `csv` is currently supported. + in: query + name: format + schema: + $ref: "#/components/schemas/LLMObsDatasetExportFormat" + - description: Version of the dataset to export. If omitted, the current version is used. Must be between 0 and the current version of the dataset, inclusive. + in: query + name: version + schema: + format: int64 + maximum: 2147483647 + type: integer + responses: + "200": + content: + text/csv: + examples: + default: + value: "id,input,expected_output,metadata,tags\nrec-1,\"What is 2+2?\",\"4\",{},\"\"" + schema: + type: string + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Export an LLM Observability dataset + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/records: get: description: List all records in an LLM Observability dataset, sorted by creation date, newest first. @@ -130530,6 +131028,84 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/restore: + post: + description: Restore a dataset to a previous version. The dataset's current version is bumped, and its records are replaced with the records from the specified prior version. + operationId: RestoreLLMObsDatasetVersion + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + dataset_version: 1 + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: datasets + schema: + $ref: "#/components/schemas/LLMObsDatasetRestoreVersionRequest" + description: Restore dataset version payload. + required: true + responses: + "200": + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Restore an LLM Observability dataset version + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/versions: get: description: List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. @@ -130613,6 +131189,111 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v2/{project_id}/datasets/{dataset_id}/records/upload: + post: + description: |- + Upload records to a dataset from a file. The request is a `multipart/form-data` upload containing a single `file` part. + Currently only CSV is supported. The CSV must include an `input` column. Optional columns are `id`, `expected_output`, `metadata`, and `tags`. + + The response is a Server-Sent Events stream (`text/event-stream`) emitting progress updates while records are processed. The stream emits the following named events: + - `progress`: incremental record counts written so far. + - `completed`: terminal event with a JSON body containing `records_created`. + - `error`: terminal event with a JSON body containing an error `message`. + operationId: UploadLLMObsDatasetRecordsFile + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + - description: Whether to skip records whose `input` already exists in the dataset. Defaults to `false`. + in: query + name: deduplicate + schema: + default: false + type: boolean + - description: Whether to overwrite existing records that share the same user-provided `id`. Defaults to `true`. + in: query + name: overwrite + schema: + default: true + type: boolean + - description: Tags to apply to every uploaded record, in addition to any tags defined on individual rows. Can be repeated, e.g. `tags=env:prod&tags=team:ai`. + in: query + name: tags + schema: + items: + type: string + type: array + - description: Whether to enrich the response with user metadata. + in: query + name: "include[user_data]" + schema: + type: boolean + requestBody: + content: + multipart/form-data: + examples: + default: + value: + file: records.csv + schema: + $ref: "#/components/schemas/LLMObsDatasetRecordsUploadFile" + description: Multipart upload payload containing the records file. + required: true + responses: + "200": + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Upload records to an LLM Observability dataset + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v3/experiments/{experiment_id}/events: get: description: Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. diff --git a/examples/v2/llm-observability/BatchUpdateLLMObsDataset.rb b/examples/v2/llm-observability/BatchUpdateLLMObsDataset.rb new file mode 100644 index 000000000000..d892f110fddd --- /dev/null +++ b/examples/v2/llm-observability/BatchUpdateLLMObsDataset.rb @@ -0,0 +1,45 @@ +# Batch update LLM Observability dataset records returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.batch_update_llm_obs_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsDatasetBatchUpdateRequest.new({ + data: DatadogAPIClient::V2::LLMObsDatasetBatchUpdateDataRequest.new({ + attributes: DatadogAPIClient::V2::LLMObsDatasetBatchUpdateDataAttributesRequest.new({ + create_new_version: true, + delete_records: [], + insert_records: [ + DatadogAPIClient::V2::LLMObsDatasetBatchUpdateInsertRecord.new({ + expected_output: nil, + id: "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", + input: nil, + tag_operations: DatadogAPIClient::V2::LLMObsDatasetRecordTagOperations.new({ + add: [], + remove: [], + set: [], + }), + tags: [], + }), + ], + tags: [], + update_records: [ + DatadogAPIClient::V2::LLMObsDatasetBatchUpdateUpdateRecord.new({ + expected_output: nil, + id: "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", + input: nil, + tag_operations: DatadogAPIClient::V2::LLMObsDatasetRecordTagOperations.new({ + add: [], + remove: [], + set: [], + }), + }), + ], + }), + id: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", + type: DatadogAPIClient::V2::LLMObsDatasetType::DATASETS, + }), +}) +p api_instance.batch_update_llm_obs_dataset("project_id", "dataset_id", body) diff --git a/examples/v2/llm-observability/CloneLLMObsDataset.rb b/examples/v2/llm-observability/CloneLLMObsDataset.rb new file mode 100644 index 000000000000..b425735a79b0 --- /dev/null +++ b/examples/v2/llm-observability/CloneLLMObsDataset.rb @@ -0,0 +1,19 @@ +# Clone an LLM Observability dataset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.clone_llm_obs_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsDatasetCloneRequest.new({ + data: DatadogAPIClient::V2::LLMObsDatasetCloneDataRequest.new({ + attributes: DatadogAPIClient::V2::LLMObsDatasetCloneDataAttributesRequest.new({ + description: "Clone of the original dataset for experimentation.", + name: "My cloned dataset", + }), + id: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", + type: DatadogAPIClient::V2::LLMObsDatasetType::DATASETS, + }), +}) +p api_instance.clone_llm_obs_dataset("project_id", "dataset_id", body) diff --git a/examples/v2/llm-observability/ExportLLMObsDataset.rb b/examples/v2/llm-observability/ExportLLMObsDataset.rb new file mode 100644 index 000000000000..ef1cfac8fa6b --- /dev/null +++ b/examples/v2/llm-observability/ExportLLMObsDataset.rb @@ -0,0 +1,8 @@ +# Export an LLM Observability dataset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.export_llm_obs_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.export_llm_obs_dataset("project_id", "dataset_id") diff --git a/examples/v2/llm-observability/RestoreLLMObsDatasetVersion.rb b/examples/v2/llm-observability/RestoreLLMObsDatasetVersion.rb new file mode 100644 index 000000000000..d9c702378916 --- /dev/null +++ b/examples/v2/llm-observability/RestoreLLMObsDatasetVersion.rb @@ -0,0 +1,18 @@ +# Restore an LLM Observability dataset version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.restore_llm_obs_dataset_version".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsDatasetRestoreVersionRequest.new({ + data: DatadogAPIClient::V2::LLMObsDatasetRestoreVersionDataRequest.new({ + attributes: DatadogAPIClient::V2::LLMObsDatasetRestoreVersionDataAttributesRequest.new({ + dataset_version: 1, + }), + id: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", + type: DatadogAPIClient::V2::LLMObsDatasetType::DATASETS, + }), +}) +p api_instance.restore_llm_obs_dataset_version("project_id", "dataset_id", body) diff --git a/examples/v2/llm-observability/UploadLLMObsDatasetRecordsFile.rb b/examples/v2/llm-observability/UploadLLMObsDatasetRecordsFile.rb new file mode 100644 index 000000000000..9701f51caa04 --- /dev/null +++ b/examples/v2/llm-observability/UploadLLMObsDatasetRecordsFile.rb @@ -0,0 +1,8 @@ +# Upload records to an LLM Observability dataset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.upload_llm_obs_dataset_records_file".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.upload_llm_obs_dataset_records_file("project_id", "dataset_id") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index c3511c20380c..fe446d237e62 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1054,6 +1054,16 @@ "dataset_id" => "String", "body" => "LLMObsDatasetUpdateRequest", }, + "v2.BatchUpdateLLMObsDataset" => { + "project_id" => "String", + "dataset_id" => "String", + "body" => "LLMObsDatasetBatchUpdateRequest", + }, + "v2.CloneLLMObsDataset" => { + "project_id" => "String", + "dataset_id" => "String", + "body" => "LLMObsDatasetCloneRequest", + }, "v2.GetLLMObsDatasetDraftState" => { "project_id" => "String", "dataset_id" => "String", @@ -1066,6 +1076,12 @@ "project_id" => "String", "dataset_id" => "String", }, + "v2.ExportLLMObsDataset" => { + "project_id" => "String", + "dataset_id" => "String", + "format" => "LLMObsDatasetExportFormat", + "version" => "Integer", + }, "v2.ListLLMObsDatasetRecords" => { "project_id" => "String", "dataset_id" => "String", @@ -1088,10 +1104,24 @@ "dataset_id" => "String", "body" => "LLMObsDeleteDatasetRecordsRequest", }, + "v2.RestoreLLMObsDatasetVersion" => { + "project_id" => "String", + "dataset_id" => "String", + "body" => "LLMObsDatasetRestoreVersionRequest", + }, "v2.ListLLMObsDatasetVersions" => { "project_id" => "String", "dataset_id" => "String", }, + "v2.UploadLLMObsDatasetRecordsFile" => { + "project_id" => "String", + "dataset_id" => "String", + "deduplicate" => "Boolean", + "overwrite" => "Boolean", + "tags" => "Array", + "include_user_data" => "Boolean", + "file" => "File", + }, "v2.ListLLMObsExperimentEvents" => { "experiment_id" => "String", "page_limit" => "Integer", diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index 63b64631db28..ea384fa8ed44 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -109,6 +109,76 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Batch update LLM Observability dataset records returns "Bad Request" response + Given operation "BatchUpdateLLMObsDataset" enabled + And new "BatchUpdateLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"create_new_version": true, "delete_records": [], "insert_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}, "tags": []}], "tags": [], "update_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}}]}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Batch update LLM Observability dataset records returns "Not Found" response + Given operation "BatchUpdateLLMObsDataset" enabled + And new "BatchUpdateLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"create_new_version": true, "delete_records": [], "insert_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}, "tags": []}], "tags": [], "update_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}}]}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Batch update LLM Observability dataset records returns "OK" response + Given operation "BatchUpdateLLMObsDataset" enabled + And new "BatchUpdateLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"create_new_version": true, "delete_records": [], "insert_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}, "tags": []}], "tags": [], "update_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}}]}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Batch update LLM Observability dataset records returns "Payload Too Large" response + Given operation "BatchUpdateLLMObsDataset" enabled + And new "BatchUpdateLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"create_new_version": true, "delete_records": [], "insert_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}, "tags": []}], "tags": [], "update_records": [{"expected_output": null, "id": "rec-7c3f5a1b-9e2d-4f8a-b1c6-3d7e9f0a2b4c", "input": null, "tag_operations": {"add": [], "remove": [], "set": []}}]}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 413 Payload Too Large + + @generated @skip @team:DataDog/ml-observability + Scenario: Clone an LLM Observability dataset returns "Bad Request" response + Given operation "CloneLLMObsDataset" enabled + And new "CloneLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Clone of the original dataset for experimentation.", "name": "My cloned dataset"}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Clone an LLM Observability dataset returns "Not Found" response + Given operation "CloneLLMObsDataset" enabled + And new "CloneLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Clone of the original dataset for experimentation.", "name": "My cloned dataset"}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Clone an LLM Observability dataset returns "OK" response + Given operation "CloneLLMObsDataset" enabled + And new "CloneLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Clone of the original dataset for experimentation.", "name": "My cloned dataset"}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Create an LLM Observability annotation queue returns "Bad Request" response Given operation "CreateLLMObsAnnotationQueue" enabled @@ -417,6 +487,33 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Export an LLM Observability dataset returns "Bad Request" response + Given operation "ExportLLMObsDataset" enabled + And new "ExportLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Export an LLM Observability dataset returns "Not Found" response + Given operation "ExportLLMObsDataset" enabled + And new "ExportLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Export an LLM Observability dataset returns "OK" response + Given operation "ExportLLMObsDataset" enabled + And new "ExportLLMObsDataset" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Get LLM Observability dataset draft state returns "Bad Request" response Given operation "GetLLMObsDatasetDraftState" enabled @@ -770,6 +867,36 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Restore an LLM Observability dataset version returns "Bad Request" response + Given operation "RestoreLLMObsDatasetVersion" enabled + And new "RestoreLLMObsDatasetVersion" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"dataset_version": 1}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Restore an LLM Observability dataset version returns "Not Found" response + Given operation "RestoreLLMObsDatasetVersion" enabled + And new "RestoreLLMObsDatasetVersion" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"dataset_version": 1}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Restore an LLM Observability dataset version returns "OK" response + Given operation "RestoreLLMObsDatasetVersion" enabled + And new "RestoreLLMObsDatasetVersion" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"dataset_version": 1}, "id": "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d", "type": "datasets"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Run an LLM inference returns "Bad Request" response Given operation "CreateLLMObsIntegrationInference" enabled @@ -1040,3 +1167,30 @@ Feature: LLM Observability And body with value {"data": {"attributes": {"annotation_schema": {"label_schemas": [{"description": "Rating of the response quality.", "has_assessment": false, "has_reasoning": false, "id": "abc-123", "is_assessment": false, "is_integer": false, "is_required": true, "max": 5.0, "min": 0.0, "name": "quality", "type": "score", "values": ["good", "bad", "neutral"]}]}}, "type": "queues"}} When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: Upload records to an LLM Observability dataset returns "Bad Request" response + Given operation "UploadLLMObsDatasetRecordsFile" enabled + And new "UploadLLMObsDatasetRecordsFile" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Upload records to an LLM Observability dataset returns "Not Found" response + Given operation "UploadLLMObsDatasetRecordsFile" enabled + And new "UploadLLMObsDatasetRecordsFile" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Upload records to an LLM Observability dataset returns "OK" response + Given operation "UploadLLMObsDatasetRecordsFile" enabled + And new "UploadLLMObsDatasetRecordsFile" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 7c2c10a20142..71e42bf1b94b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4016,6 +4016,20 @@ "type": "idempotent" } }, + "BatchUpdateLLMObsDataset": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "CloneLLMObsDataset": { + "tag": "LLM Observability", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "GetLLMObsDatasetDraftState": { "tag": "LLM Observability", "undo": { @@ -4034,6 +4048,12 @@ "type": "idempotent" } }, + "ExportLLMObsDataset": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsDatasetRecords": { "tag": "LLM Observability", "undo": { @@ -4071,12 +4091,24 @@ "type": "unsafe" } }, + "RestoreLLMObsDatasetVersion": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "ListLLMObsDatasetVersions": { "tag": "LLM Observability", "undo": { "type": "safe" } }, + "UploadLLMObsDatasetRecordsFile": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "ListLLMObsExperimentEvents": { "tag": "LLM Observability", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 926289b770a4..eeeec9db856f 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -208,6 +208,8 @@ def initialize "v2.trigger_fleet_schedule": false, "v2.update_fleet_schedule": false, "v2.aggregate_llm_obs_experimentation": false, + "v2.batch_update_llm_obs_dataset": false, + "v2.clone_llm_obs_dataset": false, "v2.create_llm_obs_annotation_queue": false, "v2.create_llm_obs_annotation_queue_interactions": false, "v2.create_llm_obs_dataset": false, @@ -224,6 +226,7 @@ def initialize "v2.delete_llm_obs_datasets": false, "v2.delete_llm_obs_experiments": false, "v2.delete_llm_obs_projects": false, + "v2.export_llm_obs_dataset": false, "v2.get_llm_obs_annotated_interactions": false, "v2.get_llm_obs_annotated_interactions_by_trace_i_ds": false, "v2.get_llm_obs_annotation_queue_label_schema": false, @@ -240,6 +243,7 @@ def initialize "v2.list_llm_obs_projects": false, "v2.list_llm_obs_spans": false, "v2.lock_llm_obs_dataset_draft_state": false, + "v2.restore_llm_obs_dataset_version": false, "v2.search_llm_obs_experimentation": false, "v2.search_llm_obs_spans": false, "v2.simple_search_llm_obs_experimentation": false, @@ -251,6 +255,7 @@ def initialize "v2.update_llm_obs_dataset_records": false, "v2.update_llm_obs_experiment": false, "v2.update_llm_obs_project": false, + "v2.upload_llm_obs_dataset_records_file": false, "v2.create_annotation": false, "v2.delete_annotation": false, "v2.get_page_annotations": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index a2bf9039b2d8..67fc3b9b9500 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3922,6 +3922,14 @@ def overrides "v2.llm_obs_data_deletion_response_attributes" => "LLMObsDataDeletionResponseAttributes", "v2.llm_obs_data_deletion_response_data" => "LLMObsDataDeletionResponseData", "v2.llm_obs_data_deletion_response_type" => "LLMObsDataDeletionResponseType", + "v2.llm_obs_dataset_batch_update_data_attributes_request" => "LLMObsDatasetBatchUpdateDataAttributesRequest", + "v2.llm_obs_dataset_batch_update_data_request" => "LLMObsDatasetBatchUpdateDataRequest", + "v2.llm_obs_dataset_batch_update_insert_record" => "LLMObsDatasetBatchUpdateInsertRecord", + "v2.llm_obs_dataset_batch_update_request" => "LLMObsDatasetBatchUpdateRequest", + "v2.llm_obs_dataset_batch_update_update_record" => "LLMObsDatasetBatchUpdateUpdateRecord", + "v2.llm_obs_dataset_clone_data_attributes_request" => "LLMObsDatasetCloneDataAttributesRequest", + "v2.llm_obs_dataset_clone_data_request" => "LLMObsDatasetCloneDataRequest", + "v2.llm_obs_dataset_clone_request" => "LLMObsDatasetCloneRequest", "v2.llm_obs_dataset_data_attributes_request" => "LLMObsDatasetDataAttributesRequest", "v2.llm_obs_dataset_data_attributes_response" => "LLMObsDatasetDataAttributesResponse", "v2.llm_obs_dataset_data_request" => "LLMObsDatasetDataRequest", @@ -3931,6 +3939,7 @@ def overrides "v2.llm_obs_dataset_draft_state_response" => "LLMObsDatasetDraftStateResponse", "v2.llm_obs_dataset_draft_state_type" => "LLMObsDatasetDraftStateType", "v2.llm_obs_dataset_draft_state_user" => "LLMObsDatasetDraftStateUser", + "v2.llm_obs_dataset_export_format" => "LLMObsDatasetExportFormat", "v2.llm_obs_dataset_record_data_response" => "LLMObsDatasetRecordDataResponse", "v2.llm_obs_dataset_record_item" => "LLMObsDatasetRecordItem", "v2.llm_obs_dataset_records_data_attributes_request" => "LLMObsDatasetRecordsDataAttributesRequest", @@ -3942,9 +3951,14 @@ def overrides "v2.llm_obs_dataset_records_update_data_attributes_request" => "LLMObsDatasetRecordsUpdateDataAttributesRequest", "v2.llm_obs_dataset_records_update_data_request" => "LLMObsDatasetRecordsUpdateDataRequest", "v2.llm_obs_dataset_records_update_request" => "LLMObsDatasetRecordsUpdateRequest", + "v2.llm_obs_dataset_records_upload_file" => "LLMObsDatasetRecordsUploadFile", + "v2.llm_obs_dataset_record_tag_operations" => "LLMObsDatasetRecordTagOperations", "v2.llm_obs_dataset_record_update_item" => "LLMObsDatasetRecordUpdateItem", "v2.llm_obs_dataset_request" => "LLMObsDatasetRequest", "v2.llm_obs_dataset_response" => "LLMObsDatasetResponse", + "v2.llm_obs_dataset_restore_version_data_attributes_request" => "LLMObsDatasetRestoreVersionDataAttributesRequest", + "v2.llm_obs_dataset_restore_version_data_request" => "LLMObsDatasetRestoreVersionDataRequest", + "v2.llm_obs_dataset_restore_version_request" => "LLMObsDatasetRestoreVersionRequest", "v2.llm_obs_datasets_response" => "LLMObsDatasetsResponse", "v2.llm_obs_dataset_type" => "LLMObsDatasetType", "v2.llm_obs_dataset_update_data_attributes_request" => "LLMObsDatasetUpdateDataAttributesRequest", diff --git a/lib/datadog_api_client/v2/api/llm_observability_api.rb b/lib/datadog_api_client/v2/api/llm_observability_api.rb index 64031b0dcacc..4e8a60da520b 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -99,6 +99,172 @@ def aggregate_llm_obs_experimentation_with_http_info(body, opts = {}) return data, status_code, headers end + # Batch update LLM Observability dataset records. + # + # @see #batch_update_llm_obs_dataset_with_http_info + def batch_update_llm_obs_dataset(project_id, dataset_id, body, opts = {}) + data, _status_code, _headers = batch_update_llm_obs_dataset_with_http_info(project_id, dataset_id, body, opts) + data + end + + # Batch update LLM Observability dataset records. + # + # Insert, update, and delete records in a single dataset operation. By default, a new dataset version is created when the batch is applied. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param body [LLMObsDatasetBatchUpdateRequest] Batch update payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDatasetRecordsMutationResponse, Integer, Hash)>] LLMObsDatasetRecordsMutationResponse data, response status code and response headers + def batch_update_llm_obs_dataset_with_http_info(project_id, dataset_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.batch_update_llm_obs_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.batch_update_llm_obs_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.batch_update_llm_obs_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.batch_update_llm_obs_dataset ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.batch_update_llm_obs_dataset" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.batch_update_llm_obs_dataset" + 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 LLMObservabilityAPI.batch_update_llm_obs_dataset" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/batch_update'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDatasetRecordsMutationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :batch_update_llm_obs_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#batch_update_llm_obs_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Clone an LLM Observability dataset. + # + # @see #clone_llm_obs_dataset_with_http_info + def clone_llm_obs_dataset(project_id, dataset_id, body, opts = {}) + data, _status_code, _headers = clone_llm_obs_dataset_with_http_info(project_id, dataset_id, body, opts) + data + end + + # Clone an LLM Observability dataset. + # + # Clone a dataset, copying its current records into a new dataset within the same project. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the source LLM Observability dataset to clone. + # @param body [LLMObsDatasetCloneRequest] Clone dataset payload. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDatasetResponse, Integer, Hash)>] LLMObsDatasetResponse data, response status code and response headers + def clone_llm_obs_dataset_with_http_info(project_id, dataset_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.clone_llm_obs_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.clone_llm_obs_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.clone_llm_obs_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.clone_llm_obs_dataset ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.clone_llm_obs_dataset" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.clone_llm_obs_dataset" + 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 LLMObservabilityAPI.clone_llm_obs_dataset" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/clone'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'LLMObsDatasetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :clone_llm_obs_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#clone_llm_obs_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an LLM Observability annotation queue. # # @see #create_llm_obs_annotation_queue_with_http_info @@ -1335,6 +1501,93 @@ def delete_llm_obs_projects_with_http_info(body, opts = {}) return data, status_code, headers end + # Export an LLM Observability dataset. + # + # @see #export_llm_obs_dataset_with_http_info + def export_llm_obs_dataset(project_id, dataset_id, opts = {}) + data, _status_code, _headers = export_llm_obs_dataset_with_http_info(project_id, dataset_id, opts) + data + end + + # Export an LLM Observability dataset. + # + # Download the contents of a dataset as a CSV file. The download is streamed and includes one row per dataset record. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param opts [Hash] the optional parameters + # @option opts [LLMObsDatasetExportFormat] :format Export format for the dataset contents. Only `csv` is currently supported. + # @option opts [Integer] :version Version of the dataset to export. If omitted, the current version is used. Must be between 0 and the current version of the dataset, inclusive. + # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers + def export_llm_obs_dataset_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.export_llm_obs_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.export_llm_obs_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.export_llm_obs_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.export_llm_obs_dataset ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.export_llm_obs_dataset" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.export_llm_obs_dataset" + end + allowable_values = ['csv'] + if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format']) + fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'version'].nil? && opts[:'version'] > 2147483647 + fail ArgumentError, 'invalid value for "opts[:"version"]" when calling LLMObservabilityAPI.export_llm_obs_dataset, must be smaller than or equal to 2147483647.' + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/export'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil? + query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'String' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :export_llm_obs_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#export_llm_obs_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get annotated queue interactions. # # @see #get_llm_obs_annotated_interactions_with_http_info @@ -2570,6 +2823,89 @@ def lock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts return data, status_code, headers end + # Restore an LLM Observability dataset version. + # + # @see #restore_llm_obs_dataset_version_with_http_info + def restore_llm_obs_dataset_version(project_id, dataset_id, body, opts = {}) + restore_llm_obs_dataset_version_with_http_info(project_id, dataset_id, body, opts) + nil + end + + # Restore an LLM Observability dataset version. + # + # Restore a dataset to a previous version. The dataset's current version is bumped, and its records are replaced with the records from the specified prior version. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param body [LLMObsDatasetRestoreVersionRequest] Restore dataset version payload. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def restore_llm_obs_dataset_version_with_http_info(project_id, dataset_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.restore_llm_obs_dataset_version".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.restore_llm_obs_dataset_version") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.restore_llm_obs_dataset_version")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.restore_llm_obs_dataset_version ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.restore_llm_obs_dataset_version" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.restore_llm_obs_dataset_version" + 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 LLMObservabilityAPI.restore_llm_obs_dataset_version" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/restore'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :restore_llm_obs_dataset_version, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#restore_llm_obs_dataset_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Search LLM Observability experimentation entities. # # @see #search_llm_obs_experimentation_with_http_info @@ -3430,5 +3766,100 @@ def update_llm_obs_project_with_http_info(project_id, body, opts = {}) end return data, status_code, headers end + + # Upload records to an LLM Observability dataset. + # + # @see #upload_llm_obs_dataset_records_file_with_http_info + def upload_llm_obs_dataset_records_file(project_id, dataset_id, opts = {}) + upload_llm_obs_dataset_records_file_with_http_info(project_id, dataset_id, opts) + nil + end + + # Upload records to an LLM Observability dataset. + # + # Upload records to a dataset from a file. The request is a `multipart/form-data` upload containing a single `file` part. + # Currently only CSV is supported. The CSV must include an `input` column. Optional columns are `id`, `expected_output`, `metadata`, and `tags`. + # + # The response is a Server-Sent Events stream (`text/event-stream`) emitting progress updates while records are processed. The stream emits the following named events: + # - `progress`: incremental record counts written so far. + # - `completed`: terminal event with a JSON body containing `records_created`. + # - `error`: terminal event with a JSON body containing an error `message`. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param opts [Hash] the optional parameters + # @option opts [Boolean] :deduplicate Whether to skip records whose `input` already exists in the dataset. Defaults to `false`. + # @option opts [Boolean] :overwrite Whether to overwrite existing records that share the same user-provided `id`. Defaults to `true`. + # @option opts [Array] :tags Tags to apply to every uploaded record, in addition to any tags defined on individual rows. Can be repeated, e.g. `tags=env:prod&tags=team:ai`. + # @option opts [Boolean] :include_user_data Whether to enrich the response with user metadata. + # @option opts [File] :file The records file to upload. Currently only CSV is supported. The file must include an `input` column. Optional columns include `id`, `expected_output`, `metadata`, and `tags`. + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def upload_llm_obs_dataset_records_file_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.upload_llm_obs_dataset_records_file".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upload_llm_obs_dataset_records_file") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upload_llm_obs_dataset_records_file")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.upload_llm_obs_dataset_records_file ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.upload_llm_obs_dataset_records_file" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.upload_llm_obs_dataset_records_file" + end + # resource path + local_var_path = '/api/v2/llm-obs/v2/{project_id}/datasets/{dataset_id}/records/upload'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'deduplicate'] = opts[:'deduplicate'] if !opts[:'deduplicate'].nil? + query_params[:'overwrite'] = opts[:'overwrite'] if !opts[:'overwrite'].nil? + query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :multi) if !opts[:'tags'].nil? + query_params[:'include[user_data]'] = opts[:'include_user_data'] if !opts[:'include_user_data'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) + + # form parameters + form_params = opts[:form_params] || {} + form_params['file'] = opts[:'file'] if !opts[:'file'].nil? + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :upload_llm_obs_dataset_records_file, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LLMObservabilityAPI#upload_llm_obs_dataset_records_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_attributes_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_attributes_request.rb new file mode 100644 index 000000000000..8616ccb38b13 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_attributes_request.rb @@ -0,0 +1,153 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for batch-updating records in an LLM Observability dataset. + class LLMObsDatasetBatchUpdateDataAttributesRequest + include BaseGenericModel + + # Whether to create a new dataset version when applying the batch update. Defaults to `true`. + attr_accessor :create_new_version + + # Record IDs to delete. + attr_accessor :delete_records + + # Records to insert. + attr_accessor :insert_records + + # List of tag strings. + attr_accessor :tags + + # Records to update by ID. + attr_accessor :update_records + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'create_new_version' => :'create_new_version', + :'delete_records' => :'delete_records', + :'insert_records' => :'insert_records', + :'tags' => :'tags', + :'update_records' => :'update_records' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'create_new_version' => :'Boolean', + :'delete_records' => :'Array', + :'insert_records' => :'Array', + :'tags' => :'Array', + :'update_records' => :'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::LLMObsDatasetBatchUpdateDataAttributesRequest` 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?(:'create_new_version') + self.create_new_version = attributes[:'create_new_version'] + end + + if attributes.key?(:'delete_records') + if (value = attributes[:'delete_records']).is_a?(Array) + self.delete_records = value + end + end + + if attributes.key?(:'insert_records') + if (value = attributes[:'insert_records']).is_a?(Array) + self.insert_records = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'update_records') + if (value = attributes[:'update_records']).is_a?(Array) + self.update_records = 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 && + create_new_version == o.create_new_version && + delete_records == o.delete_records && + insert_records == o.insert_records && + tags == o.tags && + update_records == o.update_records && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [create_new_version, delete_records, insert_records, tags, update_records, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_request.rb new file mode 100644 index 000000000000..17f9342f9e1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_data_request.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 + # Data object for batch-updating records in an LLM Observability dataset. + class LLMObsDatasetBatchUpdateDataRequest + include BaseGenericModel + + # Attributes for batch-updating records in an LLM Observability dataset. + attr_reader :attributes + + # Unique identifier of the dataset. + attr_reader :id + + # Resource type of an LLM Observability dataset. + 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' => :'LLMObsDatasetBatchUpdateDataAttributesRequest', + :'id' => :'String', + :'type' => :'LLMObsDatasetType' + } + 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::LLMObsDatasetBatchUpdateDataRequest` 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/llm_obs_dataset_batch_update_insert_record.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_insert_record.rb new file mode 100644 index 000000000000..c62390142111 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_insert_record.rb @@ -0,0 +1,166 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A record to insert as part of a batch update on an LLM Observability dataset. + class LLMObsDatasetBatchUpdateInsertRecord + include BaseGenericModel + + # Represents any valid JSON value. + attr_accessor :expected_output + + # Optional user-provided identifier for the record. If omitted, the server generates an identifier. + attr_accessor :id + + # Represents any valid JSON value. + attr_accessor :input + + # Arbitrary metadata associated with the record. + attr_accessor :metadata + + # Explicit tag operations for updating records. Operations are applied in order, Remove then Add then Set. `set` is the final override; if specified, the result of `remove` and `add` is discarded. + attr_accessor :tag_operations + + # List of tag strings. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'expected_output' => :'expected_output', + :'id' => :'id', + :'input' => :'input', + :'metadata' => :'metadata', + :'tag_operations' => :'tag_operations', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'expected_output' => :'AnyValue', + :'id' => :'String', + :'input' => :'AnyValue', + :'metadata' => :'Hash', + :'tag_operations' => :'LLMObsDatasetRecordTagOperations', + :'tags' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'expected_output', + :'input', + ]) + 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::LLMObsDatasetBatchUpdateInsertRecord` 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?(:'expected_output') + self.expected_output = attributes[:'expected_output'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'input') + self.input = attributes[:'input'] + end + + if attributes.key?(:'metadata') + self.metadata = attributes[:'metadata'] + end + + if attributes.key?(:'tag_operations') + self.tag_operations = attributes[:'tag_operations'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = 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 && + expected_output == o.expected_output && + id == o.id && + input == o.input && + metadata == o.metadata && + tag_operations == o.tag_operations && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [expected_output, id, input, metadata, tag_operations, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_request.rb new file mode 100644 index 000000000000..c6d485ea22ec --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_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 to batch-insert, update, and delete records in an LLM Observability dataset. + class LLMObsDatasetBatchUpdateRequest + include BaseGenericModel + + # Data object for batch-updating records in an LLM Observability dataset. + 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' => :'LLMObsDatasetBatchUpdateDataRequest' + } + 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::LLMObsDatasetBatchUpdateRequest` 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/llm_obs_dataset_batch_update_update_record.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_update_record.rb new file mode 100644 index 000000000000..66ee0be8b426 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_batch_update_update_record.rb @@ -0,0 +1,172 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A record update payload as part of a batch update on an LLM Observability dataset. + class LLMObsDatasetBatchUpdateUpdateRecord + include BaseGenericModel + + # Represents any valid JSON value. + attr_accessor :expected_output + + # Unique identifier of the record to update. + attr_reader :id + + # Represents any valid JSON value. + attr_accessor :input + + # Updated metadata associated with the record. + attr_accessor :metadata + + # Explicit tag operations for updating records. Operations are applied in order, Remove then Add then Set. `set` is the final override; if specified, the result of `remove` and `add` is discarded. + attr_accessor :tag_operations + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'expected_output' => :'expected_output', + :'id' => :'id', + :'input' => :'input', + :'metadata' => :'metadata', + :'tag_operations' => :'tag_operations' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'expected_output' => :'AnyValue', + :'id' => :'String', + :'input' => :'AnyValue', + :'metadata' => :'Hash', + :'tag_operations' => :'LLMObsDatasetRecordTagOperations' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'expected_output', + :'input', + ]) + 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::LLMObsDatasetBatchUpdateUpdateRecord` 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?(:'expected_output') + self.expected_output = attributes[:'expected_output'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'input') + self.input = attributes[:'input'] + end + + if attributes.key?(:'metadata') + self.metadata = attributes[:'metadata'] + end + + if attributes.key?(:'tag_operations') + self.tag_operations = attributes[:'tag_operations'] + 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? + 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 + + # 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 && + expected_output == o.expected_output && + id == o.id && + input == o.input && + metadata == o.metadata && + tag_operations == o.tag_operations && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [expected_output, id, input, metadata, tag_operations, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_attributes_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_attributes_request.rb new file mode 100644 index 000000000000..ccb45631dd3c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_attributes_request.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for cloning an LLM Observability dataset. + class LLMObsDatasetCloneDataAttributesRequest + include BaseGenericModel + + # Description of the cloned dataset. + attr_accessor :description + + # Name of the cloned dataset. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetCloneDataAttributesRequest` 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?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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 @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + 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 && + description == o.description && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_request.rb new file mode 100644 index 000000000000..65091ebc93e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_data_request.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 + # Data object for cloning an LLM Observability dataset. + class LLMObsDatasetCloneDataRequest + include BaseGenericModel + + # Attributes for cloning an LLM Observability dataset. + attr_reader :attributes + + # Identifier of the source dataset to clone. + attr_reader :id + + # Resource type of an LLM Observability dataset. + 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' => :'LLMObsDatasetCloneDataAttributesRequest', + :'id' => :'String', + :'type' => :'LLMObsDatasetType' + } + 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::LLMObsDatasetCloneDataRequest` 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/llm_obs_dataset_clone_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_request.rb new file mode 100644 index 000000000000..0a8a93e40d4c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_clone_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 to clone an LLM Observability dataset. + class LLMObsDatasetCloneRequest + include BaseGenericModel + + # Data object for cloning an LLM Observability dataset. + 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' => :'LLMObsDatasetCloneDataRequest' + } + 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::LLMObsDatasetCloneRequest` 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/llm_obs_dataset_export_format.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_export_format.rb new file mode 100644 index 000000000000..a677ede43a28 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_export_format.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 + # Supported export format for an LLM Observability dataset. + class LLMObsDatasetExportFormat + include BaseEnumModel + + CSV = "csv".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_record_tag_operations.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_record_tag_operations.rb new file mode 100644 index 000000000000..e68caaca5fd9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_record_tag_operations.rb @@ -0,0 +1,131 @@ +=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 + # Explicit tag operations for updating records. Operations are applied in order, Remove then Add then Set. `set` is the final override; if specified, the result of `remove` and `add` is discarded. + class LLMObsDatasetRecordTagOperations + include BaseGenericModel + + # List of tag strings. + attr_accessor :add + + # List of tag strings. + attr_accessor :remove + + # List of tag strings. + attr_accessor :set + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'add' => :'add', + :'remove' => :'remove', + :'set' => :'set' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'add' => :'Array', + :'remove' => :'Array', + :'set' => :'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::LLMObsDatasetRecordTagOperations` 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?(:'add') + if (value = attributes[:'add']).is_a?(Array) + self.add = value + end + end + + if attributes.key?(:'remove') + if (value = attributes[:'remove']).is_a?(Array) + self.remove = value + end + end + + if attributes.key?(:'set') + if (value = attributes[:'set']).is_a?(Array) + self.set = 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 && + add == o.add && + remove == o.remove && + set == o.set && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [add, remove, set, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_records_upload_file.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_records_upload_file.rb new file mode 100644 index 000000000000..090c6587cc1c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_records_upload_file.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 + # Multipart payload for uploading dataset records from a file. + class LLMObsDatasetRecordsUploadFile + include BaseGenericModel + + # The records file to upload. Currently only CSV is supported. The file must include an `input` column. Optional columns include `id`, `expected_output`, `metadata`, and `tags`. + attr_accessor :file + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'file' => :'file' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'file' => :'File' + } + 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::LLMObsDatasetRecordsUploadFile` 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?(:'file') + self.file = attributes[:'file'] + 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 && + file == o.file && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [file, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_attributes_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_attributes_request.rb new file mode 100644 index 000000000000..39976cae2a41 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_attributes_request.rb @@ -0,0 +1,127 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for restoring an LLM Observability dataset to a previous version. + class LLMObsDatasetRestoreVersionDataAttributesRequest + include BaseGenericModel + + # Version number of the dataset to restore. Must be between 0 and the current version of the dataset, inclusive. + attr_reader :dataset_version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dataset_version' => :'dataset_version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dataset_version' => :'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::LLMObsDatasetRestoreVersionDataAttributesRequest` 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?(:'dataset_version') + self.dataset_version = attributes[:'dataset_version'] + 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 @dataset_version.nil? + return false if @dataset_version > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param dataset_version [Object] Object to be assigned + # @!visibility private + def dataset_version=(dataset_version) + if dataset_version.nil? + fail ArgumentError, 'invalid value for "dataset_version", dataset_version cannot be nil.' + end + if dataset_version > 2147483647 + fail ArgumentError, 'invalid value for "dataset_version", must be smaller than or equal to 2147483647.' + end + @dataset_version = dataset_version + 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 && + dataset_version == o.dataset_version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dataset_version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_request.rb new file mode 100644 index 000000000000..3297e3813d62 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_data_request.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 + # Data object for restoring an LLM Observability dataset to a previous version. + class LLMObsDatasetRestoreVersionDataRequest + include BaseGenericModel + + # Attributes for restoring an LLM Observability dataset to a previous version. + attr_reader :attributes + + # Unique identifier of the dataset to restore. + attr_reader :id + + # Resource type of an LLM Observability dataset. + 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' => :'LLMObsDatasetRestoreVersionDataAttributesRequest', + :'id' => :'String', + :'type' => :'LLMObsDatasetType' + } + 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::LLMObsDatasetRestoreVersionDataRequest` 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/llm_obs_dataset_restore_version_request.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_request.rb new file mode 100644 index 000000000000..9bbbcba5833e --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_restore_version_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 to restore an LLM Observability dataset to a previous version. + class LLMObsDatasetRestoreVersionRequest + include BaseGenericModel + + # Data object for restoring an LLM Observability dataset to a previous version. + 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' => :'LLMObsDatasetRestoreVersionDataRequest' + } + 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::LLMObsDatasetRestoreVersionRequest` 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 From 57cc4992136a94a580922ed116f700d7401027cd Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 09:00:16 +0000 Subject: [PATCH 5/6] Regenerate client from commit 6a02de5 of spec repo (#3384) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 254 ++++++++++++++++++ .../GetPermanentRetentionFilter.rb | 5 + .../ListPermanentRetentionFilters.rb | 5 + .../UpdatePermanentRetentionFilter.rb | 18 ++ features/scenarios_model_mapping.rb | 12 + features/v2/rum_retention_filters.feature | 50 ++++ features/v2/undo.json | 18 ++ lib/datadog_api_client/inflector.rb | 10 + .../v2/api/rum_retention_filters_api.rb | 226 ++++++++++++++++ ...m_permanent_retention_filter_attributes.rb | 135 ++++++++++ .../rum_permanent_retention_filter_data.rb | 125 +++++++++ ..._permanent_retention_filter_editability.rb | 105 ++++++++ .../rum_permanent_retention_filter_id.rb | 28 ++ ...rum_permanent_retention_filter_response.rb | 105 ++++++++ .../rum_permanent_retention_filter_type.rb | 26 ++ ...nent_retention_filter_update_attributes.rb | 105 ++++++++ ..._permanent_retention_filter_update_data.rb | 165 ++++++++++++ ...rmanent_retention_filter_update_request.rb | 123 +++++++++ ...um_permanent_retention_filters_response.rb | 107 ++++++++ 19 files changed, 1622 insertions(+) create mode 100644 examples/v2/rum-retention-filters/GetPermanentRetentionFilter.rb create mode 100644 examples/v2/rum-retention-filters/ListPermanentRetentionFilters.rb create mode 100644 examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_data.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_editability.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_id.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_response.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_type.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filters_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 25b7d2083191..b2e0e022c91c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1558,6 +1558,13 @@ components: required: true schema: type: string + RumPermanentRetentionFilterIDParameter: + description: The identifier of the permanent RUM retention filter. + in: path + name: permanent_rf_id + required: true + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" RumRetentionFilterIDParameter: description: Retention filter ID. in: path @@ -71551,6 +71558,100 @@ components: $ref: "#/components/schemas/RumMetricResponseData" type: array type: object + RumPermanentRetentionFilterAttributes: + description: The attributes of a permanent RUM retention filter. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumCrossProductSampling" + description: + description: A description of what the filter retains. + example: "All sessions generated by Synthetics are retained at 100%." + type: string + editability: + $ref: "#/components/schemas/RumPermanentRetentionFilterEditability" + name: + description: The display name of the permanent retention filter. + example: "Synthetics Sessions" + type: string + type: object + RumPermanentRetentionFilterData: + description: A permanent RUM retention filter. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + type: object + RumPermanentRetentionFilterEditability: + description: Indicates which cross-product fields of a permanent RUM retention filter can be updated. + properties: + trace_editable: + description: Whether the APM trace cross-product configuration of the filter can be updated. + example: true + type: boolean + type: object + RumPermanentRetentionFilterID: + description: The identifier of a permanent RUM retention filter. + enum: + - rum_apm_flat_sampling + - synthetics_sessions + - forced_replay_sessions + example: synthetics_sessions + type: string + x-enum-varnames: ["RUM_APM_FLAT_SAMPLING", "SYNTHETICS_SESSIONS", "FORCED_REPLAY_SESSIONS"] + RumPermanentRetentionFilterResponse: + description: A permanent RUM retention filter object. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: object + RumPermanentRetentionFilterType: + default: permanent_retention_filters + description: The type of the resource. The value should always be `permanent_retention_filters`. + enum: + - permanent_retention_filters + example: permanent_retention_filters + type: string + x-enum-varnames: ["PERMANENT_RETENTION_FILTERS"] + RumPermanentRetentionFilterUpdateAttributes: + description: The configuration to update on a permanent RUM retention filter. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumCrossProductSamplingUpdate" + type: object + RumPermanentRetentionFilterUpdateData: + description: The new permanent RUM retention filter configuration to update. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + required: + - id + - type + - attributes + type: object + RumPermanentRetentionFilterUpdateRequest: + description: The permanent RUM retention filter body to update. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateData" + required: + - data + type: object + RumPermanentRetentionFiltersResponse: + description: All permanent RUM retention filters for a RUM application. + properties: + data: + description: A list of permanent RUM retention filters. + items: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: array + type: object RumRetentionFilterAttributes: description: The object describing attributes of a RUM retention filter. properties: @@ -146732,6 +146833,159 @@ paths: tags: - Rum Retention Filters x-codegen-request-body-name: body + /api/v2/rum/applications/{app_id}/retention_filters/permanent: + get: + description: |- + Get the list of permanent RUM retention filters for a RUM application. + Permanent retention filters are predefined filters that cannot be created or deleted. + For each filter, the `editability` block indicates which cross-product fields can be updated. + operationId: ListPermanentRetentionFilters + parameters: + - $ref: "#/components/parameters/RumApplicationIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 100.0 + description: RUM retains all Synthetics sessions. + editability: + trace_editable: true + name: Synthetics Sessions + id: synthetics_sessions + type: permanent_retention_filters + - attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 100.0 + description: RUM retains all sessions with forced replays. + editability: + trace_editable: true + name: Forced Replay Sessions + id: forced_replay_sessions + type: permanent_retention_filters + - attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 100.0 + description: Configures APM trace sampling for RUM sessions using flat sampling. + editability: + trace_editable: false + name: RUM APM Flat Sampling + id: rum_apm_flat_sampling + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFiltersResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all permanent RUM retention filters + tags: + - Rum Retention Filters + /api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}: + get: + description: Get a permanent RUM retention filter for a RUM application by its identifier. + operationId: GetPermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 75.0 + description: RUM retains all Synthetics sessions. + editability: + trace_editable: true + name: Synthetics Sessions + id: synthetics_sessions + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a permanent RUM retention filter + tags: + - Rum Retention Filters + patch: + description: |- + Update the cross-product sampling configuration of a permanent RUM retention filter for a RUM application. + Only fields marked as editable in the `editability` block of the filter can be updated. + Updating a non-editable field returns a `400` response. + operationId: UpdatePermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 50.0 + id: synthetics_sessions + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateRequest" + description: New configuration of the permanent RUM retention filter. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 50.0 + description: RUM retains all Synthetics sessions. + editability: + trace_editable: true + name: Synthetics Sessions + id: synthetics_sessions + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + description: Updated + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a permanent RUM retention filter + tags: + - Rum Retention Filters + x-codegen-request-body-name: body /api/v2/rum/applications/{app_id}/retention_filters/{rf_id}: delete: description: Delete a RUM retention filter for a RUM application. diff --git a/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.rb b/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.rb new file mode 100644 index 000000000000..258af67a22d1 --- /dev/null +++ b/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.rb @@ -0,0 +1,5 @@ +# Get a permanent RUM retention filter returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new +p api_instance.get_permanent_retention_filter("app_id", RumPermanentRetentionFilterID::SYNTHETICS_SESSIONS) diff --git a/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.rb b/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.rb new file mode 100644 index 000000000000..ff8060e61043 --- /dev/null +++ b/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.rb @@ -0,0 +1,5 @@ +# Get all permanent RUM retention filters returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new +p api_instance.list_permanent_retention_filters("app_id") diff --git a/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.rb b/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.rb new file mode 100644 index 000000000000..d09f95133fc6 --- /dev/null +++ b/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.rb @@ -0,0 +1,18 @@ +# Update a permanent RUM retention filter returns "Updated" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new + +body = DatadogAPIClient::V2::RumPermanentRetentionFilterUpdateRequest.new({ + data: DatadogAPIClient::V2::RumPermanentRetentionFilterUpdateData.new({ + attributes: DatadogAPIClient::V2::RumPermanentRetentionFilterUpdateAttributes.new({ + cross_product_sampling: DatadogAPIClient::V2::RumCrossProductSamplingUpdate.new({ + trace_enabled: true, + trace_sample_rate: 25.0, + }), + }), + id: DatadogAPIClient::V2::RumPermanentRetentionFilterID::SYNTHETICS_SESSIONS, + type: DatadogAPIClient::V2::RumPermanentRetentionFilterType::PERMANENT_RETENTION_FILTERS, + }), +}) +p api_instance.update_permanent_retention_filter("app_id", RumPermanentRetentionFilterID::SYNTHETICS_SESSIONS, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index fe446d237e62..920e80f058e0 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4506,6 +4506,18 @@ "app_id" => "String", "body" => "RumRetentionFilterCreateRequest", }, + "v2.ListPermanentRetentionFilters" => { + "app_id" => "String", + }, + "v2.GetPermanentRetentionFilter" => { + "app_id" => "String", + "permanent_rf_id" => "RumPermanentRetentionFilterID", + }, + "v2.UpdatePermanentRetentionFilter" => { + "app_id" => "String", + "permanent_rf_id" => "RumPermanentRetentionFilterID", + "body" => "RumPermanentRetentionFilterUpdateRequest", + }, "v2.DeleteRetentionFilter" => { "app_id" => "String", "rf_id" => "String", diff --git a/features/v2/rum_retention_filters.feature b/features/v2/rum_retention_filters.feature index 08d0a42a2538..9c41dcedc0d0 100644 --- a/features/v2/rum_retention_filters.feature +++ b/features/v2/rum_retention_filters.feature @@ -70,6 +70,22 @@ Feature: Rum Retention Filters And the response "data.attributes.query" is equal to "custom_query" And the response "data.attributes.sample_rate" is equal to 25 + @generated @skip @team:DataDog/rum-backend + Scenario: Get a permanent RUM retention filter returns "Not Found" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a permanent RUM retention filter returns "OK" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/rum-backend Scenario: Get all RUM retention filters returns "OK" response Given new "ListRetentionFilters" request @@ -78,6 +94,13 @@ Feature: Rum Retention Filters Then the response status is 200 OK And the response "data" has length 3 + @generated @skip @team:DataDog/rum-backend + Scenario: Get all permanent RUM retention filters returns "OK" response + Given new "ListPermanentRetentionFilters" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/rum-backend Scenario: Order RUM retention filters returns "Bad Request" response Given new "OrderRetentionFilters" request @@ -130,3 +153,30 @@ Feature: Rum Retention Filters And the response "data.attributes.enabled" is equal to true And the response "data.attributes.query" is equal to "view_query" And the response "data.attributes.sample_rate" is equal to 100 + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent RUM retention filter returns "Bad Request" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "synthetics_sessions", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent RUM retention filter returns "Not Found" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "synthetics_sessions", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent RUM retention filter returns "Updated" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "synthetics_sessions", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 200 Updated diff --git a/features/v2/undo.json b/features/v2/undo.json index 71e42bf1b94b..f1a04b48a1aa 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5875,6 +5875,24 @@ "type": "safe" } }, + "ListPermanentRetentionFilters": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "GetPermanentRetentionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "UpdatePermanentRetentionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "idempotent" + } + }, "DeleteRetentionFilter": { "tag": "Rum Retention Filters", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 67fc3b9b9500..bfa0086bf6f1 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5530,6 +5530,16 @@ def overrides "v2.rum_metric_update_compute" => "RumMetricUpdateCompute", "v2.rum_metric_update_data" => "RumMetricUpdateData", "v2.rum_metric_update_request" => "RumMetricUpdateRequest", + "v2.rum_permanent_retention_filter_attributes" => "RumPermanentRetentionFilterAttributes", + "v2.rum_permanent_retention_filter_data" => "RumPermanentRetentionFilterData", + "v2.rum_permanent_retention_filter_editability" => "RumPermanentRetentionFilterEditability", + "v2.rum_permanent_retention_filter_id" => "RumPermanentRetentionFilterID", + "v2.rum_permanent_retention_filter_response" => "RumPermanentRetentionFilterResponse", + "v2.rum_permanent_retention_filters_response" => "RumPermanentRetentionFiltersResponse", + "v2.rum_permanent_retention_filter_type" => "RumPermanentRetentionFilterType", + "v2.rum_permanent_retention_filter_update_attributes" => "RumPermanentRetentionFilterUpdateAttributes", + "v2.rum_permanent_retention_filter_update_data" => "RumPermanentRetentionFilterUpdateData", + "v2.rum_permanent_retention_filter_update_request" => "RumPermanentRetentionFilterUpdateRequest", "v2.rum_product_analytics_retention_scale" => "RUMProductAnalyticsRetentionScale", "v2.rum_product_analytics_retention_state" => "RUMProductAnalyticsRetentionState", "v2.rum_product_scales" => "RUMProductScales", diff --git a/lib/datadog_api_client/v2/api/rum_retention_filters_api.rb b/lib/datadog_api_client/v2/api/rum_retention_filters_api.rb index 7b30e91e1bbe..0cd11c3ec557 100644 --- a/lib/datadog_api_client/v2/api/rum_retention_filters_api.rb +++ b/lib/datadog_api_client/v2/api/rum_retention_filters_api.rb @@ -166,6 +166,81 @@ def delete_retention_filter_with_http_info(app_id, rf_id, opts = {}) return data, status_code, headers end + # Get a permanent RUM retention filter. + # + # @see #get_permanent_retention_filter_with_http_info + def get_permanent_retention_filter(app_id, permanent_rf_id, opts = {}) + data, _status_code, _headers = get_permanent_retention_filter_with_http_info(app_id, permanent_rf_id, opts) + data + end + + # Get a permanent RUM retention filter. + # + # Get a permanent RUM retention filter for a RUM application by its identifier. + # + # @param app_id [String] RUM application ID. + # @param permanent_rf_id [RumPermanentRetentionFilterID] The identifier of the permanent RUM retention filter. + # @param opts [Hash] the optional parameters + # @return [Array<(RumPermanentRetentionFilterResponse, Integer, Hash)>] RumPermanentRetentionFilterResponse data, response status code and response headers + def get_permanent_retention_filter_with_http_info(app_id, permanent_rf_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.get_permanent_retention_filter ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling RumRetentionFiltersAPI.get_permanent_retention_filter" + end + # verify the required parameter 'permanent_rf_id' is set + if @api_client.config.client_side_validation && permanent_rf_id.nil? + fail ArgumentError, "Missing the required parameter 'permanent_rf_id' when calling RumRetentionFiltersAPI.get_permanent_retention_filter" + end + # verify enum value + allowable_values = ['rum_apm_flat_sampling', 'synthetics_sessions', 'forced_replay_sessions'] + if @api_client.config.client_side_validation && !allowable_values.include?(permanent_rf_id) + fail ArgumentError, "invalid value for \"permanent_rf_id\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')).sub('{permanent_rf_id}', CGI.escape(permanent_rf_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RumPermanentRetentionFilterResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_permanent_retention_filter, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumRetentionFiltersAPI#get_permanent_retention_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a RUM retention filter. # # @see #get_retention_filter_with_http_info @@ -236,6 +311,73 @@ def get_retention_filter_with_http_info(app_id, rf_id, opts = {}) return data, status_code, headers end + # Get all permanent RUM retention filters. + # + # @see #list_permanent_retention_filters_with_http_info + def list_permanent_retention_filters(app_id, opts = {}) + data, _status_code, _headers = list_permanent_retention_filters_with_http_info(app_id, opts) + data + end + + # Get all permanent RUM retention filters. + # + # Get the list of permanent RUM retention filters for a RUM application. + # Permanent retention filters are predefined filters that cannot be created or deleted. + # For each filter, the `editability` block indicates which cross-product fields can be updated. + # + # @param app_id [String] RUM application ID. + # @param opts [Hash] the optional parameters + # @return [Array<(RumPermanentRetentionFiltersResponse, Integer, Hash)>] RumPermanentRetentionFiltersResponse data, response status code and response headers + def list_permanent_retention_filters_with_http_info(app_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.list_permanent_retention_filters ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling RumRetentionFiltersAPI.list_permanent_retention_filters" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/permanent'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RumPermanentRetentionFiltersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_permanent_retention_filters, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumRetentionFiltersAPI#list_permanent_retention_filters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get all RUM retention filters. # # @see #list_retention_filters_with_http_info @@ -374,6 +516,90 @@ def order_retention_filters_with_http_info(app_id, body, opts = {}) return data, status_code, headers end + # Update a permanent RUM retention filter. + # + # @see #update_permanent_retention_filter_with_http_info + def update_permanent_retention_filter(app_id, permanent_rf_id, body, opts = {}) + data, _status_code, _headers = update_permanent_retention_filter_with_http_info(app_id, permanent_rf_id, body, opts) + data + end + + # Update a permanent RUM retention filter. + # + # Update the cross-product sampling configuration of a permanent RUM retention filter for a RUM application. + # Only fields marked as editable in the `editability` block of the filter can be updated. + # Updating a non-editable field returns a `400` response. + # + # @param app_id [String] RUM application ID. + # @param permanent_rf_id [RumPermanentRetentionFilterID] The identifier of the permanent RUM retention filter. + # @param body [RumPermanentRetentionFilterUpdateRequest] New configuration of the permanent RUM retention filter. + # @param opts [Hash] the optional parameters + # @return [Array<(RumPermanentRetentionFilterResponse, Integer, Hash)>] RumPermanentRetentionFilterResponse data, response status code and response headers + def update_permanent_retention_filter_with_http_info(app_id, permanent_rf_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.update_permanent_retention_filter ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling RumRetentionFiltersAPI.update_permanent_retention_filter" + end + # verify the required parameter 'permanent_rf_id' is set + if @api_client.config.client_side_validation && permanent_rf_id.nil? + fail ArgumentError, "Missing the required parameter 'permanent_rf_id' when calling RumRetentionFiltersAPI.update_permanent_retention_filter" + end + # verify enum value + allowable_values = ['rum_apm_flat_sampling', 'synthetics_sessions', 'forced_replay_sessions'] + if @api_client.config.client_side_validation && !allowable_values.include?(permanent_rf_id) + fail ArgumentError, "invalid value for \"permanent_rf_id\", must be one of #{allowable_values}" + 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 RumRetentionFiltersAPI.update_permanent_retention_filter" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')).sub('{permanent_rf_id}', CGI.escape(permanent_rf_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'RumPermanentRetentionFilterResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_permanent_retention_filter, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumRetentionFiltersAPI#update_permanent_retention_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a RUM retention filter. # # @see #update_retention_filter_with_http_info diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_attributes.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_attributes.rb new file mode 100644 index 000000000000..ea051e038351 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_attributes.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 + # The attributes of a permanent RUM retention filter. + class RumPermanentRetentionFilterAttributes + include BaseGenericModel + + # The configuration for cross-product retention filters. + attr_accessor :cross_product_sampling + + # A description of what the filter retains. + attr_accessor :description + + # Indicates which cross-product fields of a permanent RUM retention filter can be updated. + attr_accessor :editability + + # The display name of the permanent retention filter. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cross_product_sampling' => :'cross_product_sampling', + :'description' => :'description', + :'editability' => :'editability', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cross_product_sampling' => :'RumCrossProductSampling', + :'description' => :'String', + :'editability' => :'RumPermanentRetentionFilterEditability', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumPermanentRetentionFilterAttributes` 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?(:'cross_product_sampling') + self.cross_product_sampling = attributes[:'cross_product_sampling'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'editability') + self.editability = attributes[:'editability'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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 && + cross_product_sampling == o.cross_product_sampling && + description == o.description && + editability == o.editability && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cross_product_sampling, description, editability, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_data.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_data.rb new file mode 100644 index 000000000000..59119a78ef3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A permanent RUM retention filter. + class RumPermanentRetentionFilterData + include BaseGenericModel + + # The attributes of a permanent RUM retention filter. + attr_accessor :attributes + + # The identifier of a permanent RUM retention filter. + attr_accessor :id + + # The type of the resource. The value should always be `permanent_retention_filters`. + 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RumPermanentRetentionFilterAttributes', + :'id' => :'RumPermanentRetentionFilterID', + :'type' => :'RumPermanentRetentionFilterType' + } + 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::RumPermanentRetentionFilterData` 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 + + # 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/rum_permanent_retention_filter_editability.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_editability.rb new file mode 100644 index 000000000000..2e18a3d80a83 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_editability.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 + # Indicates which cross-product fields of a permanent RUM retention filter can be updated. + class RumPermanentRetentionFilterEditability + include BaseGenericModel + + # Whether the APM trace cross-product configuration of the filter can be updated. + attr_accessor :trace_editable + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'trace_editable' => :'trace_editable' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'trace_editable' => :'Boolean' + } + 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::RumPermanentRetentionFilterEditability` 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?(:'trace_editable') + self.trace_editable = attributes[:'trace_editable'] + 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 && + trace_editable == o.trace_editable && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [trace_editable, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_id.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_id.rb new file mode 100644 index 000000000000..b96224196f41 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_id.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The identifier of a permanent RUM retention filter. + class RumPermanentRetentionFilterID + include BaseEnumModel + + RUM_APM_FLAT_SAMPLING = "rum_apm_flat_sampling".freeze + SYNTHETICS_SESSIONS = "synthetics_sessions".freeze + FORCED_REPLAY_SESSIONS = "forced_replay_sessions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_response.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_response.rb new file mode 100644 index 000000000000..a4f767b89dcb --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_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 + # A permanent RUM retention filter object. + class RumPermanentRetentionFilterResponse + include BaseGenericModel + + # A permanent RUM retention filter. + 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' => :'RumPermanentRetentionFilterData' + } + 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::RumPermanentRetentionFilterResponse` 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/rum_permanent_retention_filter_type.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_type.rb new file mode 100644 index 000000000000..11653ad3419d --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. The value should always be `permanent_retention_filters`. + class RumPermanentRetentionFilterType + include BaseEnumModel + + PERMANENT_RETENTION_FILTERS = "permanent_retention_filters".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_attributes.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_attributes.rb new file mode 100644 index 000000000000..a455f47351ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_attributes.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 + # The configuration to update on a permanent RUM retention filter. + class RumPermanentRetentionFilterUpdateAttributes + include BaseGenericModel + + # The configuration for cross-product retention filters. All fields are optional for partial updates. + attr_accessor :cross_product_sampling + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cross_product_sampling' => :'cross_product_sampling' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cross_product_sampling' => :'RumCrossProductSamplingUpdate' + } + 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::RumPermanentRetentionFilterUpdateAttributes` 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?(:'cross_product_sampling') + self.cross_product_sampling = attributes[:'cross_product_sampling'] + 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 && + cross_product_sampling == o.cross_product_sampling && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cross_product_sampling, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_data.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_data.rb new file mode 100644 index 000000000000..2df9de4441da --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_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 + # The new permanent RUM retention filter configuration to update. + class RumPermanentRetentionFilterUpdateData + include BaseGenericModel + + # The configuration to update on a permanent RUM retention filter. + attr_reader :attributes + + # The identifier of a permanent RUM retention filter. + attr_reader :id + + # The type of the resource. The value should always be `permanent_retention_filters`. + 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' => :'RumPermanentRetentionFilterUpdateAttributes', + :'id' => :'RumPermanentRetentionFilterID', + :'type' => :'RumPermanentRetentionFilterType' + } + 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::RumPermanentRetentionFilterUpdateData` 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/rum_permanent_retention_filter_update_request.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_request.rb new file mode 100644 index 000000000000..6ec94c517d31 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_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 + # The permanent RUM retention filter body to update. + class RumPermanentRetentionFilterUpdateRequest + include BaseGenericModel + + # The new permanent RUM retention filter configuration to update. + 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' => :'RumPermanentRetentionFilterUpdateData' + } + 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::RumPermanentRetentionFilterUpdateRequest` 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/rum_permanent_retention_filters_response.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filters_response.rb new file mode 100644 index 000000000000..b6264cc128aa --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filters_response.rb @@ -0,0 +1,107 @@ +=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 + # All permanent RUM retention filters for a RUM application. + class RumPermanentRetentionFiltersResponse + include BaseGenericModel + + # A list of permanent RUM retention filters. + 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' => :'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::RumPermanentRetentionFiltersResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # 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 From 57e1d6fe9d845c01dbf42831079e7c686fd5875b Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 10:02:12 +0000 Subject: [PATCH 6/6] Regenerate client from commit 44f37c4 of spec repo (#3405) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v1/openapi.yaml | 2 ++ .../v1/models/formula_and_function_events_data_source.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 2b22002269f4..3a4885916a33 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3303,6 +3303,7 @@ components: - product_analytics - on_call_events - errors + - llm_observability example: "logs" type: string x-enum-varnames: @@ -3320,6 +3321,7 @@ components: - PRODUCT_ANALYTICS - ON_CALL_EVENTS - ERRORS + - LLM_OBSERVABILITY FormulaAndFunctionMetricAggregation: description: The aggregation methods available for metrics queries. enum: diff --git a/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb b/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb index 4ada1bf0fac1..e833ce307b7c 100644 --- a/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +++ b/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb @@ -35,5 +35,6 @@ class FormulaAndFunctionEventsDataSource PRODUCT_ANALYTICS = "product_analytics".freeze ON_CALL_EVENTS = "on_call_events".freeze ERRORS = "errors".freeze + LLM_OBSERVABILITY = "llm_observability".freeze end end