diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 085c5aa51a..0f8479d771 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5795,6 +5795,33 @@ components: type: $ref: '#/components/schemas/FindingType' type: object + BulkPutAppsDatastoreItemsRequest: + description: Request to insert multiple items into a datastore in a single operation. + properties: + data: + $ref: '#/components/schemas/BulkPutAppsDatastoreItemsRequestData' + type: object + BulkPutAppsDatastoreItemsRequestData: + description: Data wrapper containing the items to insert and their configuration + for the bulk insert operation. + properties: + attributes: + $ref: '#/components/schemas/BulkPutAppsDatastoreItemsRequestDataAttributes' + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object + BulkPutAppsDatastoreItemsRequestDataAttributes: + description: Configuration for bulk inserting multiple items into a datastore. + properties: + conflict_mode: + $ref: '#/components/schemas/DatastoreItemConflictMode' + values: + $ref: '#/components/schemas/DatastoreItemValues' + required: + - values + type: object CIAppAggregateBucketValue: description: A bucket value, can either be a timeseries or a single value. oneOf: @@ -10785,6 +10812,77 @@ components: - id - type type: object + CreateAppsDatastoreRequest: + description: Request to create a new datastore with specified configuration + and metadata. + properties: + data: + $ref: '#/components/schemas/CreateAppsDatastoreRequestData' + type: object + CreateAppsDatastoreRequestData: + description: Data wrapper containing the configuration needed to create a new + datastore. + properties: + attributes: + $ref: '#/components/schemas/CreateAppsDatastoreRequestDataAttributes' + id: + description: Optional ID for the new datastore. If not provided, one will + be generated automatically. + type: string + type: + $ref: '#/components/schemas/DatastoreDataType' + required: + - type + type: object + CreateAppsDatastoreRequestDataAttributes: + description: Configuration and metadata to create a new datastore. + properties: + description: + description: A human-readable description about the datastore. + type: string + name: + description: The display name for the new datastore. + example: datastore-name + type: string + org_access: + $ref: '#/components/schemas/CreateAppsDatastoreRequestDataAttributesOrgAccess' + primary_column_name: + $ref: '#/components/schemas/DatastoreAttributesPrimaryColumnName' + primary_key_generation_strategy: + $ref: '#/components/schemas/DatastorePrimaryKeyGenerationStrategy' + required: + - name + - primary_column_name + type: object + CreateAppsDatastoreRequestDataAttributesOrgAccess: + description: The organization access level for the datastore. For example, 'contributor'. + enum: + - contributor + - viewer + - manager + type: string + x-enum-varnames: + - CONTRIBUTOR + - VIEWER + - MANAGER + CreateAppsDatastoreResponse: + description: Response after successfully creating a new datastore, containing + the datastore's assigned ID. + properties: + data: + $ref: '#/components/schemas/CreateAppsDatastoreResponseData' + type: object + CreateAppsDatastoreResponseData: + description: The newly created datastore's data. + properties: + id: + description: The unique identifier assigned to the newly created datastore. + type: string + type: + $ref: '#/components/schemas/DatastoreDataType' + required: + - type + type: object CreateCustomFrameworkRequest: description: Request object to create a custom framework. properties: @@ -13512,6 +13610,134 @@ components: required: - data type: object + Datastore: + description: A datastore's complete configuration and metadata. + properties: + data: + $ref: '#/components/schemas/DatastoreData' + type: object + DatastoreArray: + description: A collection of datastores returned by list operations. + properties: + data: + description: An array of datastore objects containing their configurations + and metadata. + items: + $ref: '#/components/schemas/DatastoreData' + type: array + required: + - data + type: object + DatastoreAttributesPrimaryColumnName: + description: "The name of the primary key column for this datastore. Primary + column names:\n - Must abide by both [PostgreSQL naming conventions](https://www.postgresql.org/docs/7.0/syntax525.htm)\n + \ - Cannot exceed 63 characters" + example: '' + maxLength: 63 + type: string + DatastoreData: + description: Core information about a datastore, including its unique identifier + and attributes. + properties: + attributes: + $ref: '#/components/schemas/DatastoreDataAttributes' + id: + description: The unique identifier of the datastore. + type: string + type: + $ref: '#/components/schemas/DatastoreDataType' + required: + - type + type: object + DatastoreDataAttributes: + description: Detailed information about a datastore. + properties: + created_at: + description: Timestamp when the datastore was created. + format: date-time + type: string + creator_user_id: + description: The numeric ID of the user who created the datastore. + format: int64 + type: integer + creator_user_uuid: + description: The UUID of the user who created the datastore. + type: string + description: + description: A human-readable description about the datastore. + type: string + modified_at: + description: Timestamp when the datastore was last modified. + format: date-time + type: string + name: + description: The display name of the datastore. + type: string + org_id: + description: The ID of the organization that owns this datastore. + format: int64 + type: integer + primary_column_name: + $ref: '#/components/schemas/DatastoreAttributesPrimaryColumnName' + primary_key_generation_strategy: + $ref: '#/components/schemas/DatastorePrimaryKeyGenerationStrategy' + type: object + DatastoreDataType: + default: datastores + description: The resource type for datastores. + enum: + - datastores + example: datastores + type: string + x-enum-varnames: + - DATASTORES + DatastoreItemConflictMode: + description: How to handle conflicts when inserting items that already exist + in the datastore. + enum: + - fail_on_conflict + - overwrite_on_conflict + example: overwrite_on_conflict + type: string + x-enum-varnames: + - FAIL_ON_CONFLICT + - OVERWRITE_ON_CONFLICT + DatastoreItemValues: + description: An array of items to add to the datastore, where each item is a + set of key-value pairs representing the item's data. Up to 100 items can be + updated in a single request. + example: + - data: example data + key: value + - data: example data2 + key: value2 + items: + additionalProperties: {} + description: A single item's data as key-value pairs. Key names cannot exceed + 63 characters. + type: object + maxItems: 100 + type: array + DatastoreItemsDataType: + default: items + description: The resource type for datastore items. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS + DatastorePrimaryKeyGenerationStrategy: + description: Can be set to `uuid` to automatically generate primary keys when + new items are added. Default value is `none`, which requires you to supply + a primary key for each new item. + enum: + - none + - uuid + type: string + x-enum-varnames: + - NONE + - UUID Date: description: Date as Unix timestamp in milliseconds. example: 1722439510282 @@ -13537,6 +13763,59 @@ components: - id - type type: object + DeleteAppsDatastoreItemRequest: + description: Request to delete a specific item from a datastore by its primary + key. + properties: + data: + $ref: '#/components/schemas/DeleteAppsDatastoreItemRequestData' + type: object + DeleteAppsDatastoreItemRequestData: + description: Data wrapper containing the information needed to identify and + delete a specific datastore item. + properties: + attributes: + $ref: '#/components/schemas/DeleteAppsDatastoreItemRequestDataAttributes' + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object + DeleteAppsDatastoreItemRequestDataAttributes: + description: Attributes specifying which datastore item to delete by its primary + key. + properties: + id: + description: Optional unique identifier of the item to delete. + example: a7656bcc-51d4-4884-adf7-4d0d9a3e0633 + type: string + item_key: + description: The primary key value that identifies the item to delete. Cannot + exceed 256 characters. + example: primaryKey + maxLength: 256 + type: string + required: + - item_key + type: object + DeleteAppsDatastoreItemResponse: + description: Response from successfully deleting a datastore item. + properties: + data: + $ref: '#/components/schemas/DeleteAppsDatastoreItemResponseData' + type: object + DeleteAppsDatastoreItemResponseData: + description: Data containing the identifier of the datastore item that was successfully + deleted. + properties: + id: + description: The unique identifier of the item that was deleted. + type: string + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object DeleteAppsRequest: description: A request object for deleting multiple apps by ID. example: @@ -22969,6 +23248,125 @@ components: type: string x-enum-varnames: - ERROR_TRACKING_SEARCH_RESULT + ItemApiPayload: + description: A single datastore item with its content and metadata. + properties: + data: + $ref: '#/components/schemas/ItemApiPayloadData' + type: object + ItemApiPayloadArray: + description: A collection of datastore items with pagination and schema metadata. + properties: + data: + description: An array of datastore items with their content and metadata. + items: + $ref: '#/components/schemas/ItemApiPayloadData' + maxItems: 100 + type: array + meta: + $ref: '#/components/schemas/ItemApiPayloadMeta' + description: Metadata about the included items, including pagination info + and datastore schema. + required: + - data + type: object + ItemApiPayloadData: + description: Core data and metadata for a single datastore item. + properties: + attributes: + $ref: '#/components/schemas/ItemApiPayloadDataAttributes' + id: + description: The unique identifier of the datastore. + type: string + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object + ItemApiPayloadDataAttributes: + description: Metadata and content of a datastore item. + properties: + created_at: + description: Timestamp when the item was first created. + format: date-time + type: string + modified_at: + description: Timestamp when the item was last modified. + format: date-time + type: string + org_id: + description: The ID of the organization that owns this item. + format: int64 + type: integer + primary_column_name: + $ref: '#/components/schemas/DatastoreAttributesPrimaryColumnName' + signature: + description: A unique signature identifying this item version. + type: string + store_id: + description: The unique identifier of the datastore containing this item. + type: string + value: + $ref: '#/components/schemas/ItemApiPayloadDataAttributesValue' + type: object + ItemApiPayloadDataAttributesValue: + additionalProperties: {} + description: The data content (as key-value pairs) of a datastore item. + type: object + ItemApiPayloadMeta: + description: Additional metadata about a collection of datastore items, including + pagination and schema information. + properties: + page: + $ref: '#/components/schemas/ItemApiPayloadMetaPage' + schema: + $ref: '#/components/schemas/ItemApiPayloadMetaSchema' + type: object + ItemApiPayloadMetaPage: + description: Pagination information for a collection of datastore items. + properties: + hasMore: + description: Whether there are additional pages of items beyond the current + page. + type: boolean + totalCount: + description: The total number of items in the datastore, ignoring any filters. + format: int64 + type: integer + totalFilteredCount: + description: The total number of items that match the current filter criteria. + format: int64 + type: integer + type: object + ItemApiPayloadMetaSchema: + description: Schema information about the datastore, including its primary key + and field definitions. + properties: + fields: + description: An array describing the columns available in this datastore. + items: + $ref: '#/components/schemas/ItemApiPayloadMetaSchemaField' + type: array + primary_key: + description: The name of the primary key column for this datastore. + type: string + type: object + ItemApiPayloadMetaSchemaField: + description: Information about a specific column in the datastore schema. + properties: + name: + description: The name of this column in the datastore. + example: '' + type: string + type: + description: The data type of this column. For example, 'string', 'number', + or 'boolean'. + example: '' + type: string + required: + - name + - type + type: object JSONAPIErrorItem: description: API error response body properties: @@ -33877,6 +34275,32 @@ components: data: $ref: '#/components/schemas/Deployment' type: object + PutAppsDatastoreItemResponseArray: + description: Response after successfully inserting multiple items into a datastore, + containing the identifiers of the created items. + properties: + data: + description: An array of data objects containing the identifiers of the + successfully inserted items. + items: + $ref: '#/components/schemas/PutAppsDatastoreItemResponseData' + maxItems: 100 + type: array + required: + - data + type: object + PutAppsDatastoreItemResponseData: + description: Data containing the identifier of a single item that was successfully + inserted into the datastore. + properties: + id: + description: The unique identifier assigned to the inserted item. + type: string + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object PutIncidentNotificationRuleRequest: description: Put request for a notification rule. properties: @@ -45742,6 +46166,94 @@ components: type: string type: array type: object + UpdateAppsDatastoreItemRequest: + description: Request to update specific fields on an existing datastore item. + properties: + data: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequestData' + type: object + UpdateAppsDatastoreItemRequestData: + description: Data wrapper containing the item identifier and the changes to + apply during the update operation. + properties: + attributes: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequestDataAttributes' + id: + description: The unique identifier of the datastore item. + type: string + type: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequestDataType' + required: + - type + type: object + UpdateAppsDatastoreItemRequestDataAttributes: + description: Attributes for updating a datastore item, including the item key + and changes to apply. + properties: + id: + description: The unique identifier of the item being updated. + type: string + item_changes: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequestDataAttributesItemChanges' + item_key: + description: The primary key that identifies the item to update. Cannot + exceed 256 characters. + example: '' + maxLength: 256 + type: string + required: + - item_changes + - item_key + type: object + UpdateAppsDatastoreItemRequestDataAttributesItemChanges: + description: Changes to apply to a datastore item using set operations. + properties: + ops_set: + additionalProperties: {} + description: Set operation that contains key-value pairs to set on the datastore + item. + type: object + type: object + UpdateAppsDatastoreItemRequestDataType: + default: items + description: The resource type for datastore items. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS + UpdateAppsDatastoreRequest: + description: Request to update a datastore's configuration such as its name + or description. + properties: + data: + $ref: '#/components/schemas/UpdateAppsDatastoreRequestData' + type: object + UpdateAppsDatastoreRequestData: + description: Data wrapper containing the datastore identifier and the attributes + to update. + properties: + attributes: + $ref: '#/components/schemas/UpdateAppsDatastoreRequestDataAttributes' + id: + description: The unique identifier of the datastore to update. + type: string + type: + $ref: '#/components/schemas/DatastoreDataType' + required: + - type + type: object + UpdateAppsDatastoreRequestDataAttributes: + description: Attributes that can be updated on a datastore. + properties: + description: + description: A human-readable description about the datastore. + type: string + name: + description: The display name of the datastore. + type: string + type: object UpdateCustomFrameworkRequest: description: Request object to update a custom framework. properties: @@ -47765,6 +48277,378 @@ info: version: '1.0' openapi: 3.0.0 paths: + /api/v2/actions-datastores: + get: + description: Lists all datastores for the organization. + operationId: ListDatastores + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DatastoreArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List datastores + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_read + post: + description: Creates a new datastore. + operationId: CreateDatastore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAppsDatastoreRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAppsDatastoreResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create datastore + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_manage + /api/v2/actions-datastores/{datastore_id}: + delete: + description: Deletes a datastore by its unique identifier. + operationId: DeleteDatastore + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + responses: + '200': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete datastore + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_manage + get: + description: Retrieves a specific datastore by its ID. + operationId: GetDatastore + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Datastore' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get datastore + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_read + patch: + description: Updates an existing datastore's attributes. + operationId: UpdateDatastore + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAppsDatastoreRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Datastore' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update datastore + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_manage + /api/v2/actions-datastores/{datastore_id}/items: + delete: + description: Deletes an item from a datastore by its key. + operationId: DeleteDatastoreItem + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteAppsDatastoreItemRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteAppsDatastoreItemResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete datastore item + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_write + get: + description: Lists items from a datastore. You can filter the results by specifying + either an item key or a filter query parameter, but not both at the same time. + Supports server-side pagination for large datasets. + operationId: ListDatastoreItems + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + - description: Optional query filter to search items using the [logs search + syntax](https://docs.datadoghq.com/logs/explorer/search_syntax/). + in: query + name: filter + schema: + type: string + - description: Optional primary key value to retrieve a specific item. Cannot + be used together with the filter parameter. + in: query + name: item_key + schema: + maxLength: 256 + type: string + - description: Optional field to limit the number of items to return per page + for pagination. Up to 100 items can be returned per page. + in: query + name: page[limit] + schema: + format: int64 + maximum: 100 + minimum: 1 + type: integer + - description: Optional field to offset the number of items to skip from the + beginning of the result set for pagination. + in: query + name: page[offset] + schema: + format: int64 + type: integer + - description: Optional field to sort results by. Prefix with '-' for descending + order (e.g., '-created_at'). + in: query + name: sort + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemApiPayloadArray' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List datastore items + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_read + patch: + description: Partially updates an item in a datastore by its key. + operationId: UpdateDatastoreItem + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemApiPayload' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update datastore item + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_write + /api/v2/actions-datastores/{datastore_id}/items/bulk: + post: + description: Creates or replaces multiple items in a datastore by their keys + in a single operation. + operationId: BulkWriteDatastoreItems + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkPutAppsDatastoreItemsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PutAppsDatastoreItemResponseArray' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Bulk write datastore items + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_write /api/v2/actions/app_key_registrations: get: description: List App Key Registrations @@ -71931,6 +72815,12 @@ tags: description: Find out more at url: https://docs.datadoghq.com/service_management/workflows/connections/ name: Action Connection +- description: 'Leverage the Actions Datastore API to create, modify, and delete + + items in datastores owned by your organization.' + externalDocs: + url: https://docs.datadoghq.com/actions/datastore + name: Actions Datastores - description: "Datadog Agentless Scanning provides visibility into risks and vulnerabilities\nwithin your hosts, running containers, and serverless functions\u2014all without\nrequiring teams to install Agents on every host or where Agents cannot be installed.\nAgentless diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index f03f141a8c..cec40c58ca 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -11,6 +11,13 @@ datadog\_api\_client.v2.api.action\_connection\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.actions\_datastores\_api module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.actions_datastores_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.agentless\_scanning\_api module ----------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 343fae1626..4f30717b4f 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -2202,6 +2202,27 @@ datadog\_api\_client.v2.model.bulk\_mute\_findings\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.bulk\_put\_apps\_datastore\_items\_request module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.bulk_put_apps_datastore_items_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.bulk\_put\_apps\_datastore\_items\_request\_data module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.bulk\_put\_apps\_datastore\_items\_request\_data\_attributes module +------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.calculated\_field module ------------------------------------------------------ @@ -4288,6 +4309,48 @@ datadog\_api\_client.v2.model.create\_app\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_apps\_datastore\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_request\_data module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_request\_data\_attributes module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_request\_data\_attributes\_org\_access module +---------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_request_data_attributes_org_access + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_response\_data module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_response_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_custom\_framework\_request module ----------------------------------------------------------------------- @@ -5352,6 +5415,62 @@ datadog\_api\_client.v2.model.dataset\_update\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.datastore module +---------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.datastore + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.datastore\_array module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.datastore_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.datastore\_data module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.datastore_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.datastore\_data\_attributes module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.datastore_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.datastore\_data\_type module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.datastore_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.datastore\_item\_conflict\_mode module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.datastore_item_conflict_mode + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.datastore\_items\_data\_type module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.datastore_items_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.datastore\_primary\_key\_generation\_strategy module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.datastore_primary_key_generation_strategy + :members: + :show-inheritance: + datadog\_api\_client.v2.model.delete\_app\_response module ---------------------------------------------------------- @@ -5366,6 +5485,41 @@ datadog\_api\_client.v2.model.delete\_app\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.delete\_apps\_datastore\_item\_request module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.delete_apps_datastore_item_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.delete\_apps\_datastore\_item\_request\_data module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.delete_apps_datastore_item_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.delete\_apps\_datastore\_item\_request\_data\_attributes module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.delete_apps_datastore_item_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.delete\_apps\_datastore\_item\_response module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.delete_apps_datastore_item_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.delete\_apps\_datastore\_item\_response\_data module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.delete_apps_datastore_item_response_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.delete\_apps\_request module ---------------------------------------------------------- @@ -9853,6 +10007,69 @@ datadog\_api\_client.v2.model.issues\_search\_result\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.item\_api\_payload module +------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.item\_api\_payload\_array module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.item\_api\_payload\_data module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.item\_api\_payload\_data\_attributes module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.item\_api\_payload\_data\_attributes\_value module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload_data_attributes_value + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.item\_api\_payload\_meta module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.item\_api\_payload\_meta\_page module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload_meta_page + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.item\_api\_payload\_meta\_schema module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload_meta_schema + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.item\_api\_payload\_meta\_schema\_field module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload_meta_schema_field + :members: + :show-inheritance: + datadog\_api\_client.v2.model.jira\_integration\_metadata module ---------------------------------------------------------------- @@ -14963,6 +15180,20 @@ datadog\_api\_client.v2.model.publish\_app\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.put\_apps\_datastore\_item\_response\_array module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.put_apps_datastore_item_response_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.put\_apps\_datastore\_item\_response\_data module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.put_apps_datastore_item_response_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.put\_incident\_notification\_rule\_request module ------------------------------------------------------------------------------- @@ -20332,6 +20563,62 @@ datadog\_api\_client.v2.model.update\_app\_response\_data\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.update\_apps\_datastore\_item\_request module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_apps_datastore_item_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_apps\_datastore\_item\_request\_data module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_apps_datastore_item_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_apps\_datastore\_item\_request\_data\_attributes module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_apps\_datastore\_item\_request\_data\_attributes\_item\_changes module +------------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes_item_changes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_apps\_datastore\_item\_request\_data\_type module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_apps_datastore_item_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_apps\_datastore\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_apps_datastore_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_apps\_datastore\_request\_data module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_apps_datastore_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.update\_apps\_datastore\_request\_data\_attributes module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_apps_datastore_request_data_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.update\_custom\_framework\_request module ----------------------------------------------------------------------- diff --git a/examples/v2/actions-datastores/BulkWriteDatastoreItems.py b/examples/v2/actions-datastores/BulkWriteDatastoreItems.py new file mode 100644 index 0000000000..c4b5ccc061 --- /dev/null +++ b/examples/v2/actions-datastores/BulkWriteDatastoreItems.py @@ -0,0 +1,35 @@ +""" +Bulk write datastore items returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi +from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request import BulkPutAppsDatastoreItemsRequest +from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data import BulkPutAppsDatastoreItemsRequestData +from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data_attributes import ( + BulkPutAppsDatastoreItemsRequestDataAttributes, +) +from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + +# there is a valid "datastore" in the system +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +body = BulkPutAppsDatastoreItemsRequest( + data=BulkPutAppsDatastoreItemsRequestData( + attributes=BulkPutAppsDatastoreItemsRequestDataAttributes( + values=[ + dict([("id", "cust_3141"), ("name", "Johnathan")]), + dict([("id", "cust_3142"), ("name", "Mary")]), + ], + ), + type=DatastoreItemsDataType.ITEMS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.bulk_write_datastore_items(datastore_id=DATASTORE_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/actions-datastores/CreateDatastore.py b/examples/v2/actions-datastores/CreateDatastore.py new file mode 100644 index 0000000000..d2f312e9b0 --- /dev/null +++ b/examples/v2/actions-datastores/CreateDatastore.py @@ -0,0 +1,29 @@ +""" +Create datastore returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi +from datadog_api_client.v2.model.create_apps_datastore_request import CreateAppsDatastoreRequest +from datadog_api_client.v2.model.create_apps_datastore_request_data import CreateAppsDatastoreRequestData +from datadog_api_client.v2.model.create_apps_datastore_request_data_attributes import ( + CreateAppsDatastoreRequestDataAttributes, +) +from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType + +body = CreateAppsDatastoreRequest( + data=CreateAppsDatastoreRequestData( + attributes=CreateAppsDatastoreRequestDataAttributes( + name="datastore-name", + primary_column_name="primaryKey", + ), + type=DatastoreDataType.DATASTORES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.create_datastore(body=body) + + print(response) diff --git a/examples/v2/actions-datastores/DeleteDatastore.py b/examples/v2/actions-datastores/DeleteDatastore.py new file mode 100644 index 0000000000..efb270cb4c --- /dev/null +++ b/examples/v2/actions-datastores/DeleteDatastore.py @@ -0,0 +1,17 @@ +""" +Delete datastore returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi + +# there is a valid "datastore" in the system +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + api_instance.delete_datastore( + datastore_id=DATASTORE_DATA_ID, + ) diff --git a/examples/v2/actions-datastores/DeleteDatastoreItem.py b/examples/v2/actions-datastores/DeleteDatastoreItem.py new file mode 100644 index 0000000000..c29360aa09 --- /dev/null +++ b/examples/v2/actions-datastores/DeleteDatastoreItem.py @@ -0,0 +1,32 @@ +""" +Delete datastore item returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi +from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType +from datadog_api_client.v2.model.delete_apps_datastore_item_request import DeleteAppsDatastoreItemRequest +from datadog_api_client.v2.model.delete_apps_datastore_item_request_data import DeleteAppsDatastoreItemRequestData +from datadog_api_client.v2.model.delete_apps_datastore_item_request_data_attributes import ( + DeleteAppsDatastoreItemRequestDataAttributes, +) + +# there is a valid "datastore" in the system +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +body = DeleteAppsDatastoreItemRequest( + data=DeleteAppsDatastoreItemRequestData( + attributes=DeleteAppsDatastoreItemRequestDataAttributes( + item_key="test-key", + ), + type=DatastoreItemsDataType.ITEMS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.delete_datastore_item(datastore_id=DATASTORE_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/actions-datastores/GetDatastore.py b/examples/v2/actions-datastores/GetDatastore.py new file mode 100644 index 0000000000..1decc18a6f --- /dev/null +++ b/examples/v2/actions-datastores/GetDatastore.py @@ -0,0 +1,19 @@ +""" +Get datastore returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi + +# there is a valid "datastore" in the system +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.get_datastore( + datastore_id=DATASTORE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/actions-datastores/ListDatastoreItems.py b/examples/v2/actions-datastores/ListDatastoreItems.py new file mode 100644 index 0000000000..13db29467d --- /dev/null +++ b/examples/v2/actions-datastores/ListDatastoreItems.py @@ -0,0 +1,19 @@ +""" +List datastore items returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi + +# there is a valid "datastore" in the system +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.list_datastore_items( + datastore_id=DATASTORE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/actions-datastores/ListDatastores.py b/examples/v2/actions-datastores/ListDatastores.py new file mode 100644 index 0000000000..51338e44f5 --- /dev/null +++ b/examples/v2/actions-datastores/ListDatastores.py @@ -0,0 +1,13 @@ +""" +List datastores returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.list_datastores() + + print(response) diff --git a/examples/v2/actions-datastores/UpdateDatastore.py b/examples/v2/actions-datastores/UpdateDatastore.py new file mode 100644 index 0000000000..8da15cc84b --- /dev/null +++ b/examples/v2/actions-datastores/UpdateDatastore.py @@ -0,0 +1,33 @@ +""" +Update datastore returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi +from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType +from datadog_api_client.v2.model.update_apps_datastore_request import UpdateAppsDatastoreRequest +from datadog_api_client.v2.model.update_apps_datastore_request_data import UpdateAppsDatastoreRequestData +from datadog_api_client.v2.model.update_apps_datastore_request_data_attributes import ( + UpdateAppsDatastoreRequestDataAttributes, +) + +# there is a valid "datastore" in the system +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +body = UpdateAppsDatastoreRequest( + data=UpdateAppsDatastoreRequestData( + attributes=UpdateAppsDatastoreRequestDataAttributes( + name="updated name", + ), + type=DatastoreDataType.DATASTORES, + id=DATASTORE_DATA_ID, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.update_datastore(datastore_id=DATASTORE_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/actions-datastores/UpdateDatastoreItem.py b/examples/v2/actions-datastores/UpdateDatastoreItem.py new file mode 100644 index 0000000000..b1861027af --- /dev/null +++ b/examples/v2/actions-datastores/UpdateDatastoreItem.py @@ -0,0 +1,38 @@ +""" +Update datastore item returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi +from datadog_api_client.v2.model.update_apps_datastore_item_request import UpdateAppsDatastoreItemRequest +from datadog_api_client.v2.model.update_apps_datastore_item_request_data import UpdateAppsDatastoreItemRequestData +from datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes import ( + UpdateAppsDatastoreItemRequestDataAttributes, +) +from datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes_item_changes import ( + UpdateAppsDatastoreItemRequestDataAttributesItemChanges, +) +from datadog_api_client.v2.model.update_apps_datastore_item_request_data_type import ( + UpdateAppsDatastoreItemRequestDataType, +) + +# there is a valid "datastore" in the system +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +body = UpdateAppsDatastoreItemRequest( + data=UpdateAppsDatastoreItemRequestData( + attributes=UpdateAppsDatastoreItemRequestDataAttributes( + item_changes=UpdateAppsDatastoreItemRequestDataAttributesItemChanges(), + item_key="test-key", + ), + type=UpdateAppsDatastoreItemRequestDataType.ITEMS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.update_datastore_item(datastore_id=DATASTORE_DATA_ID, body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/actions_datastores_api.py b/src/datadog_api_client/v2/api/actions_datastores_api.py new file mode 100644 index 0000000000..3cfe1312ef --- /dev/null +++ b/src/datadog_api_client/v2/api/actions_datastores_api.py @@ -0,0 +1,472 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) +from datadog_api_client.v2.model.datastore_array import DatastoreArray +from datadog_api_client.v2.model.create_apps_datastore_response import CreateAppsDatastoreResponse +from datadog_api_client.v2.model.create_apps_datastore_request import CreateAppsDatastoreRequest +from datadog_api_client.v2.model.datastore import Datastore +from datadog_api_client.v2.model.update_apps_datastore_request import UpdateAppsDatastoreRequest +from datadog_api_client.v2.model.delete_apps_datastore_item_response import DeleteAppsDatastoreItemResponse +from datadog_api_client.v2.model.delete_apps_datastore_item_request import DeleteAppsDatastoreItemRequest +from datadog_api_client.v2.model.item_api_payload_array import ItemApiPayloadArray +from datadog_api_client.v2.model.item_api_payload import ItemApiPayload +from datadog_api_client.v2.model.update_apps_datastore_item_request import UpdateAppsDatastoreItemRequest +from datadog_api_client.v2.model.put_apps_datastore_item_response_array import PutAppsDatastoreItemResponseArray +from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request import BulkPutAppsDatastoreItemsRequest + + +class ActionsDatastoresApi: + """ + Leverage the Actions Datastore API to create, modify, and delete + items in datastores owned by your organization. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._bulk_write_datastore_items_endpoint = _Endpoint( + settings={ + "response_type": (PutAppsDatastoreItemResponseArray,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/{datastore_id}/items/bulk", + "operation_id": "bulk_write_datastore_items", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "datastore_id": { + "required": True, + "openapi_types": (str,), + "attribute": "datastore_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (BulkPutAppsDatastoreItemsRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_datastore_endpoint = _Endpoint( + settings={ + "response_type": (CreateAppsDatastoreResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores", + "operation_id": "create_datastore", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateAppsDatastoreRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_datastore_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/{datastore_id}", + "operation_id": "delete_datastore", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "datastore_id": { + "required": True, + "openapi_types": (str,), + "attribute": "datastore_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._delete_datastore_item_endpoint = _Endpoint( + settings={ + "response_type": (DeleteAppsDatastoreItemResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/{datastore_id}/items", + "operation_id": "delete_datastore_item", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "datastore_id": { + "required": True, + "openapi_types": (str,), + "attribute": "datastore_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (DeleteAppsDatastoreItemRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._get_datastore_endpoint = _Endpoint( + settings={ + "response_type": (Datastore,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/{datastore_id}", + "operation_id": "get_datastore", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "datastore_id": { + "required": True, + "openapi_types": (str,), + "attribute": "datastore_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_datastore_items_endpoint = _Endpoint( + settings={ + "response_type": (ItemApiPayloadArray,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/{datastore_id}/items", + "operation_id": "list_datastore_items", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "datastore_id": { + "required": True, + "openapi_types": (str,), + "attribute": "datastore_id", + "location": "path", + }, + "filter": { + "openapi_types": (str,), + "attribute": "filter", + "location": "query", + }, + "item_key": { + "validation": { + "max_length": 256, + }, + "openapi_types": (str,), + "attribute": "item_key", + "location": "query", + }, + "page_limit": { + "validation": { + "inclusive_maximum": 100, + "inclusive_minimum": 1, + }, + "openapi_types": (int,), + "attribute": "page[limit]", + "location": "query", + }, + "page_offset": { + "openapi_types": (int,), + "attribute": "page[offset]", + "location": "query", + }, + "sort": { + "openapi_types": (str,), + "attribute": "sort", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_datastores_endpoint = _Endpoint( + settings={ + "response_type": (DatastoreArray,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores", + "operation_id": "list_datastores", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_datastore_endpoint = _Endpoint( + settings={ + "response_type": (Datastore,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/{datastore_id}", + "operation_id": "update_datastore", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "datastore_id": { + "required": True, + "openapi_types": (str,), + "attribute": "datastore_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateAppsDatastoreRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_datastore_item_endpoint = _Endpoint( + settings={ + "response_type": (ItemApiPayload,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/{datastore_id}/items", + "operation_id": "update_datastore_item", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "datastore_id": { + "required": True, + "openapi_types": (str,), + "attribute": "datastore_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateAppsDatastoreItemRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def bulk_write_datastore_items( + self, + datastore_id: str, + body: BulkPutAppsDatastoreItemsRequest, + ) -> PutAppsDatastoreItemResponseArray: + """Bulk write datastore items. + + Creates or replaces multiple items in a datastore by their keys in a single operation. + + :param datastore_id: The unique identifier of the datastore to retrieve. + :type datastore_id: str + :type body: BulkPutAppsDatastoreItemsRequest + :rtype: PutAppsDatastoreItemResponseArray + """ + kwargs: Dict[str, Any] = {} + kwargs["datastore_id"] = datastore_id + + kwargs["body"] = body + + return self._bulk_write_datastore_items_endpoint.call_with_http_info(**kwargs) + + def create_datastore( + self, + body: CreateAppsDatastoreRequest, + ) -> CreateAppsDatastoreResponse: + """Create datastore. + + Creates a new datastore. + + :type body: CreateAppsDatastoreRequest + :rtype: CreateAppsDatastoreResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_datastore_endpoint.call_with_http_info(**kwargs) + + def delete_datastore( + self, + datastore_id: str, + ) -> None: + """Delete datastore. + + Deletes a datastore by its unique identifier. + + :param datastore_id: The unique identifier of the datastore to retrieve. + :type datastore_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["datastore_id"] = datastore_id + + return self._delete_datastore_endpoint.call_with_http_info(**kwargs) + + def delete_datastore_item( + self, + datastore_id: str, + body: DeleteAppsDatastoreItemRequest, + ) -> DeleteAppsDatastoreItemResponse: + """Delete datastore item. + + Deletes an item from a datastore by its key. + + :param datastore_id: The unique identifier of the datastore to retrieve. + :type datastore_id: str + :type body: DeleteAppsDatastoreItemRequest + :rtype: DeleteAppsDatastoreItemResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["datastore_id"] = datastore_id + + kwargs["body"] = body + + return self._delete_datastore_item_endpoint.call_with_http_info(**kwargs) + + def get_datastore( + self, + datastore_id: str, + ) -> Datastore: + """Get datastore. + + Retrieves a specific datastore by its ID. + + :param datastore_id: The unique identifier of the datastore to retrieve. + :type datastore_id: str + :rtype: Datastore + """ + kwargs: Dict[str, Any] = {} + kwargs["datastore_id"] = datastore_id + + return self._get_datastore_endpoint.call_with_http_info(**kwargs) + + def list_datastore_items( + self, + datastore_id: str, + *, + filter: Union[str, UnsetType] = unset, + item_key: Union[str, UnsetType] = unset, + page_limit: Union[int, UnsetType] = unset, + page_offset: Union[int, UnsetType] = unset, + sort: Union[str, UnsetType] = unset, + ) -> ItemApiPayloadArray: + """List datastore items. + + Lists items from a datastore. You can filter the results by specifying either an item key or a filter query parameter, but not both at the same time. Supports server-side pagination for large datasets. + + :param datastore_id: The unique identifier of the datastore to retrieve. + :type datastore_id: str + :param filter: Optional query filter to search items using the `logs search syntax `_. + :type filter: str, optional + :param item_key: Optional primary key value to retrieve a specific item. Cannot be used together with the filter parameter. + :type item_key: str, optional + :param page_limit: Optional field to limit the number of items to return per page for pagination. Up to 100 items can be returned per page. + :type page_limit: int, optional + :param page_offset: Optional field to offset the number of items to skip from the beginning of the result set for pagination. + :type page_offset: int, optional + :param sort: Optional field to sort results by. Prefix with '-' for descending order (e.g., '-created_at'). + :type sort: str, optional + :rtype: ItemApiPayloadArray + """ + kwargs: Dict[str, Any] = {} + kwargs["datastore_id"] = datastore_id + + if filter is not unset: + kwargs["filter"] = filter + + if item_key is not unset: + kwargs["item_key"] = item_key + + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if page_offset is not unset: + kwargs["page_offset"] = page_offset + + if sort is not unset: + kwargs["sort"] = sort + + return self._list_datastore_items_endpoint.call_with_http_info(**kwargs) + + def list_datastores( + self, + ) -> DatastoreArray: + """List datastores. + + Lists all datastores for the organization. + + :rtype: DatastoreArray + """ + kwargs: Dict[str, Any] = {} + return self._list_datastores_endpoint.call_with_http_info(**kwargs) + + def update_datastore( + self, + datastore_id: str, + body: UpdateAppsDatastoreRequest, + ) -> Datastore: + """Update datastore. + + Updates an existing datastore's attributes. + + :param datastore_id: The unique identifier of the datastore to retrieve. + :type datastore_id: str + :type body: UpdateAppsDatastoreRequest + :rtype: Datastore + """ + kwargs: Dict[str, Any] = {} + kwargs["datastore_id"] = datastore_id + + kwargs["body"] = body + + return self._update_datastore_endpoint.call_with_http_info(**kwargs) + + def update_datastore_item( + self, + datastore_id: str, + body: UpdateAppsDatastoreItemRequest, + ) -> ItemApiPayload: + """Update datastore item. + + Partially updates an item in a datastore by its key. + + :param datastore_id: The unique identifier of the datastore to retrieve. + :type datastore_id: str + :type body: UpdateAppsDatastoreItemRequest + :rtype: ItemApiPayload + """ + kwargs: Dict[str, Any] = {} + kwargs["datastore_id"] = datastore_id + + kwargs["body"] = body + + return self._update_datastore_item_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 2840d35b2f..4922c436af 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -3,6 +3,7 @@ from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi from datadog_api_client.v2.api.aws_logs_integration_api import AWSLogsIntegrationApi from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi +from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi from datadog_api_client.v2.api.agentless_scanning_api import AgentlessScanningApi from datadog_api_client.v2.api.app_builder_api import AppBuilderApi from datadog_api_client.v2.api.application_security_api import ApplicationSecurityApi @@ -80,6 +81,7 @@ "AWSIntegrationApi", "AWSLogsIntegrationApi", "ActionConnectionApi", + "ActionsDatastoresApi", "AgentlessScanningApi", "AppBuilderApi", "ApplicationSecurityApi", diff --git a/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request.py b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request.py new file mode 100644 index 0000000000..aee16fb46a --- /dev/null +++ b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data import ( + BulkPutAppsDatastoreItemsRequestData, + ) + + +class BulkPutAppsDatastoreItemsRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data import ( + BulkPutAppsDatastoreItemsRequestData, + ) + + return { + "data": (BulkPutAppsDatastoreItemsRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[BulkPutAppsDatastoreItemsRequestData, UnsetType] = unset, **kwargs): + """ + Request to insert multiple items into a datastore in a single operation. + + :param data: Data wrapper containing the items to insert and their configuration for the bulk insert operation. + :type data: BulkPutAppsDatastoreItemsRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request_data.py b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request_data.py new file mode 100644 index 0000000000..48e96ebfdf --- /dev/null +++ b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request_data.py @@ -0,0 +1,60 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data_attributes import ( + BulkPutAppsDatastoreItemsRequestDataAttributes, + ) + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + +class BulkPutAppsDatastoreItemsRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data_attributes import ( + BulkPutAppsDatastoreItemsRequestDataAttributes, + ) + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + return { + "attributes": (BulkPutAppsDatastoreItemsRequestDataAttributes,), + "type": (DatastoreItemsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: DatastoreItemsDataType, + attributes: Union[BulkPutAppsDatastoreItemsRequestDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Data wrapper containing the items to insert and their configuration for the bulk insert operation. + + :param attributes: Configuration for bulk inserting multiple items into a datastore. + :type attributes: BulkPutAppsDatastoreItemsRequestDataAttributes, optional + + :param type: The resource type for datastore items. + :type type: DatastoreItemsDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request_data_attributes.py b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request_data_attributes.py new file mode 100644 index 0000000000..3aeafa1806 --- /dev/null +++ b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request_data_attributes.py @@ -0,0 +1,81 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.datastore_item_conflict_mode import DatastoreItemConflictMode + + +class BulkPutAppsDatastoreItemsRequestDataAttributes(ModelNormal): + validations = { + "values": { + "max_items": 100, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.datastore_item_conflict_mode import DatastoreItemConflictMode + + return { + "conflict_mode": (DatastoreItemConflictMode,), + "values": ( + [ + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + } + ], + ), + } + + attribute_map = { + "conflict_mode": "conflict_mode", + "values": "values", + } + + def __init__( + self_, + values: List[Dict[str, Any]], + conflict_mode: Union[DatastoreItemConflictMode, UnsetType] = unset, + **kwargs, + ): + """ + Configuration for bulk inserting multiple items into a datastore. + + :param conflict_mode: How to handle conflicts when inserting items that already exist in the datastore. + :type conflict_mode: DatastoreItemConflictMode, optional + + :param values: An array of items to add to the datastore, where each item is a set of key-value pairs representing the item's data. Up to 100 items can be updated in a single request. + :type values: [{str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}] + """ + if conflict_mode is not unset: + kwargs["conflict_mode"] = conflict_mode + super().__init__(kwargs) + + self_.values = values diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_request.py b/src/datadog_api_client/v2/model/create_apps_datastore_request.py new file mode 100644 index 0000000000..cc50bcb808 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_request.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_apps_datastore_request_data import CreateAppsDatastoreRequestData + + +class CreateAppsDatastoreRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_request_data import CreateAppsDatastoreRequestData + + return { + "data": (CreateAppsDatastoreRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateAppsDatastoreRequestData, UnsetType] = unset, **kwargs): + """ + Request to create a new datastore with specified configuration and metadata. + + :param data: Data wrapper containing the configuration needed to create a new datastore. + :type data: CreateAppsDatastoreRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_request_data.py b/src/datadog_api_client/v2/model/create_apps_datastore_request_data.py new file mode 100644 index 0000000000..e19cb10772 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_request_data.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_apps_datastore_request_data_attributes import ( + CreateAppsDatastoreRequestDataAttributes, + ) + from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType + + +class CreateAppsDatastoreRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_request_data_attributes import ( + CreateAppsDatastoreRequestDataAttributes, + ) + from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType + + return { + "attributes": (CreateAppsDatastoreRequestDataAttributes,), + "id": (str,), + "type": (DatastoreDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: DatastoreDataType, + attributes: Union[CreateAppsDatastoreRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Data wrapper containing the configuration needed to create a new datastore. + + :param attributes: Configuration and metadata to create a new datastore. + :type attributes: CreateAppsDatastoreRequestDataAttributes, optional + + :param id: Optional ID for the new datastore. If not provided, one will be generated automatically. + :type id: str, optional + + :param type: The resource type for datastores. + :type type: DatastoreDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_request_data_attributes.py b/src/datadog_api_client/v2/model/create_apps_datastore_request_data_attributes.py new file mode 100644 index 0000000000..819bf0de32 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_request_data_attributes.py @@ -0,0 +1,96 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_apps_datastore_request_data_attributes_org_access import ( + CreateAppsDatastoreRequestDataAttributesOrgAccess, + ) + from datadog_api_client.v2.model.datastore_primary_key_generation_strategy import ( + DatastorePrimaryKeyGenerationStrategy, + ) + + +class CreateAppsDatastoreRequestDataAttributes(ModelNormal): + validations = { + "primary_column_name": { + "max_length": 63, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_request_data_attributes_org_access import ( + CreateAppsDatastoreRequestDataAttributesOrgAccess, + ) + from datadog_api_client.v2.model.datastore_primary_key_generation_strategy import ( + DatastorePrimaryKeyGenerationStrategy, + ) + + return { + "description": (str,), + "name": (str,), + "org_access": (CreateAppsDatastoreRequestDataAttributesOrgAccess,), + "primary_column_name": (str,), + "primary_key_generation_strategy": (DatastorePrimaryKeyGenerationStrategy,), + } + + attribute_map = { + "description": "description", + "name": "name", + "org_access": "org_access", + "primary_column_name": "primary_column_name", + "primary_key_generation_strategy": "primary_key_generation_strategy", + } + + def __init__( + self_, + name: str, + primary_column_name: str, + description: Union[str, UnsetType] = unset, + org_access: Union[CreateAppsDatastoreRequestDataAttributesOrgAccess, UnsetType] = unset, + primary_key_generation_strategy: Union[DatastorePrimaryKeyGenerationStrategy, UnsetType] = unset, + **kwargs, + ): + """ + Configuration and metadata to create a new datastore. + + :param description: A human-readable description about the datastore. + :type description: str, optional + + :param name: The display name for the new datastore. + :type name: str + + :param org_access: The organization access level for the datastore. For example, 'contributor'. + :type org_access: CreateAppsDatastoreRequestDataAttributesOrgAccess, optional + + :param primary_column_name: The name of the primary key column for this datastore. Primary column names: + + * Must abide by both `PostgreSQL naming conventions `_ + * Cannot exceed 63 characters + :type primary_column_name: str + + :param primary_key_generation_strategy: Can be set to ``uuid`` to automatically generate primary keys when new items are added. Default value is ``none`` , which requires you to supply a primary key for each new item. + :type primary_key_generation_strategy: DatastorePrimaryKeyGenerationStrategy, optional + """ + if description is not unset: + kwargs["description"] = description + if org_access is not unset: + kwargs["org_access"] = org_access + if primary_key_generation_strategy is not unset: + kwargs["primary_key_generation_strategy"] = primary_key_generation_strategy + super().__init__(kwargs) + + self_.name = name + self_.primary_column_name = primary_column_name diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_request_data_attributes_org_access.py b/src/datadog_api_client/v2/model/create_apps_datastore_request_data_attributes_org_access.py new file mode 100644 index 0000000000..beab3abf54 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_request_data_attributes_org_access.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CreateAppsDatastoreRequestDataAttributesOrgAccess(ModelSimple): + """ + The organization access level for the datastore. For example, 'contributor'. + + :param value: Must be one of ["contributor", "viewer", "manager"]. + :type value: str + """ + + allowed_values = { + "contributor", + "viewer", + "manager", + } + CONTRIBUTOR: ClassVar["CreateAppsDatastoreRequestDataAttributesOrgAccess"] + VIEWER: ClassVar["CreateAppsDatastoreRequestDataAttributesOrgAccess"] + MANAGER: ClassVar["CreateAppsDatastoreRequestDataAttributesOrgAccess"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CreateAppsDatastoreRequestDataAttributesOrgAccess.CONTRIBUTOR = CreateAppsDatastoreRequestDataAttributesOrgAccess( + "contributor" +) +CreateAppsDatastoreRequestDataAttributesOrgAccess.VIEWER = CreateAppsDatastoreRequestDataAttributesOrgAccess("viewer") +CreateAppsDatastoreRequestDataAttributesOrgAccess.MANAGER = CreateAppsDatastoreRequestDataAttributesOrgAccess("manager") diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_response.py b/src/datadog_api_client/v2/model/create_apps_datastore_response.py new file mode 100644 index 0000000000..44007bcb57 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_apps_datastore_response_data import CreateAppsDatastoreResponseData + + +class CreateAppsDatastoreResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_response_data import CreateAppsDatastoreResponseData + + return { + "data": (CreateAppsDatastoreResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateAppsDatastoreResponseData, UnsetType] = unset, **kwargs): + """ + Response after successfully creating a new datastore, containing the datastore's assigned ID. + + :param data: The newly created datastore's data. + :type data: CreateAppsDatastoreResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_response_data.py b/src/datadog_api_client/v2/model/create_apps_datastore_response_data.py new file mode 100644 index 0000000000..1302c03b26 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_response_data.py @@ -0,0 +1,49 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType + + +class CreateAppsDatastoreResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType + + return { + "id": (str,), + "type": (DatastoreDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, type: DatastoreDataType, id: Union[str, UnsetType] = unset, **kwargs): + """ + The newly created datastore's data. + + :param id: The unique identifier assigned to the newly created datastore. + :type id: str, optional + + :param type: The resource type for datastores. + :type type: DatastoreDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/datastore.py b/src/datadog_api_client/v2/model/datastore.py new file mode 100644 index 0000000000..0dc005f45b --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.datastore_data import DatastoreData + + +class Datastore(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.datastore_data import DatastoreData + + return { + "data": (DatastoreData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[DatastoreData, UnsetType] = unset, **kwargs): + """ + A datastore's complete configuration and metadata. + + :param data: Core information about a datastore, including its unique identifier and attributes. + :type data: DatastoreData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/datastore_array.py b/src/datadog_api_client/v2/model/datastore_array.py new file mode 100644 index 0000000000..5c2be33661 --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore_array.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.datastore_data import DatastoreData + + +class DatastoreArray(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.datastore_data import DatastoreData + + return { + "data": ([DatastoreData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[DatastoreData], **kwargs): + """ + A collection of datastores returned by list operations. + + :param data: An array of datastore objects containing their configurations and metadata. + :type data: [DatastoreData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/datastore_data.py b/src/datadog_api_client/v2/model/datastore_data.py new file mode 100644 index 0000000000..9e21849989 --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.datastore_data_attributes import DatastoreDataAttributes + from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType + + +class DatastoreData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.datastore_data_attributes import DatastoreDataAttributes + from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType + + return { + "attributes": (DatastoreDataAttributes,), + "id": (str,), + "type": (DatastoreDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: DatastoreDataType, + attributes: Union[DatastoreDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Core information about a datastore, including its unique identifier and attributes. + + :param attributes: Detailed information about a datastore. + :type attributes: DatastoreDataAttributes, optional + + :param id: The unique identifier of the datastore. + :type id: str, optional + + :param type: The resource type for datastores. + :type type: DatastoreDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/datastore_data_attributes.py b/src/datadog_api_client/v2/model/datastore_data_attributes.py new file mode 100644 index 0000000000..eb79080cd4 --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore_data_attributes.py @@ -0,0 +1,124 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.datastore_primary_key_generation_strategy import ( + DatastorePrimaryKeyGenerationStrategy, + ) + + +class DatastoreDataAttributes(ModelNormal): + validations = { + "primary_column_name": { + "max_length": 63, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.datastore_primary_key_generation_strategy import ( + DatastorePrimaryKeyGenerationStrategy, + ) + + return { + "created_at": (datetime,), + "creator_user_id": (int,), + "creator_user_uuid": (str,), + "description": (str,), + "modified_at": (datetime,), + "name": (str,), + "org_id": (int,), + "primary_column_name": (str,), + "primary_key_generation_strategy": (DatastorePrimaryKeyGenerationStrategy,), + } + + attribute_map = { + "created_at": "created_at", + "creator_user_id": "creator_user_id", + "creator_user_uuid": "creator_user_uuid", + "description": "description", + "modified_at": "modified_at", + "name": "name", + "org_id": "org_id", + "primary_column_name": "primary_column_name", + "primary_key_generation_strategy": "primary_key_generation_strategy", + } + + def __init__( + self_, + created_at: Union[datetime, UnsetType] = unset, + creator_user_id: Union[int, UnsetType] = unset, + creator_user_uuid: Union[str, UnsetType] = unset, + description: Union[str, UnsetType] = unset, + modified_at: Union[datetime, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + org_id: Union[int, UnsetType] = unset, + primary_column_name: Union[str, UnsetType] = unset, + primary_key_generation_strategy: Union[DatastorePrimaryKeyGenerationStrategy, UnsetType] = unset, + **kwargs, + ): + """ + Detailed information about a datastore. + + :param created_at: Timestamp when the datastore was created. + :type created_at: datetime, optional + + :param creator_user_id: The numeric ID of the user who created the datastore. + :type creator_user_id: int, optional + + :param creator_user_uuid: The UUID of the user who created the datastore. + :type creator_user_uuid: str, optional + + :param description: A human-readable description about the datastore. + :type description: str, optional + + :param modified_at: Timestamp when the datastore was last modified. + :type modified_at: datetime, optional + + :param name: The display name of the datastore. + :type name: str, optional + + :param org_id: The ID of the organization that owns this datastore. + :type org_id: int, optional + + :param primary_column_name: The name of the primary key column for this datastore. Primary column names: + + * Must abide by both `PostgreSQL naming conventions `_ + * Cannot exceed 63 characters + :type primary_column_name: str, optional + + :param primary_key_generation_strategy: Can be set to ``uuid`` to automatically generate primary keys when new items are added. Default value is ``none`` , which requires you to supply a primary key for each new item. + :type primary_key_generation_strategy: DatastorePrimaryKeyGenerationStrategy, optional + """ + if created_at is not unset: + kwargs["created_at"] = created_at + if creator_user_id is not unset: + kwargs["creator_user_id"] = creator_user_id + if creator_user_uuid is not unset: + kwargs["creator_user_uuid"] = creator_user_uuid + if description is not unset: + kwargs["description"] = description + if modified_at is not unset: + kwargs["modified_at"] = modified_at + if name is not unset: + kwargs["name"] = name + if org_id is not unset: + kwargs["org_id"] = org_id + if primary_column_name is not unset: + kwargs["primary_column_name"] = primary_column_name + if primary_key_generation_strategy is not unset: + kwargs["primary_key_generation_strategy"] = primary_key_generation_strategy + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/datastore_data_type.py b/src/datadog_api_client/v2/model/datastore_data_type.py new file mode 100644 index 0000000000..6b1df4eaae --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class DatastoreDataType(ModelSimple): + """ + The resource type for datastores. + + :param value: If omitted defaults to "datastores". Must be one of ["datastores"]. + :type value: str + """ + + allowed_values = { + "datastores", + } + DATASTORES: ClassVar["DatastoreDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DatastoreDataType.DATASTORES = DatastoreDataType("datastores") diff --git a/src/datadog_api_client/v2/model/datastore_item_conflict_mode.py b/src/datadog_api_client/v2/model/datastore_item_conflict_mode.py new file mode 100644 index 0000000000..55a8f40d84 --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore_item_conflict_mode.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class DatastoreItemConflictMode(ModelSimple): + """ + How to handle conflicts when inserting items that already exist in the datastore. + + :param value: Must be one of ["fail_on_conflict", "overwrite_on_conflict"]. + :type value: str + """ + + allowed_values = { + "fail_on_conflict", + "overwrite_on_conflict", + } + FAIL_ON_CONFLICT: ClassVar["DatastoreItemConflictMode"] + OVERWRITE_ON_CONFLICT: ClassVar["DatastoreItemConflictMode"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DatastoreItemConflictMode.FAIL_ON_CONFLICT = DatastoreItemConflictMode("fail_on_conflict") +DatastoreItemConflictMode.OVERWRITE_ON_CONFLICT = DatastoreItemConflictMode("overwrite_on_conflict") diff --git a/src/datadog_api_client/v2/model/datastore_items_data_type.py b/src/datadog_api_client/v2/model/datastore_items_data_type.py new file mode 100644 index 0000000000..b7bc325ad9 --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore_items_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class DatastoreItemsDataType(ModelSimple): + """ + The resource type for datastore items. + + :param value: If omitted defaults to "items". Must be one of ["items"]. + :type value: str + """ + + allowed_values = { + "items", + } + ITEMS: ClassVar["DatastoreItemsDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DatastoreItemsDataType.ITEMS = DatastoreItemsDataType("items") diff --git a/src/datadog_api_client/v2/model/datastore_primary_key_generation_strategy.py b/src/datadog_api_client/v2/model/datastore_primary_key_generation_strategy.py new file mode 100644 index 0000000000..2f38d0449c --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore_primary_key_generation_strategy.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class DatastorePrimaryKeyGenerationStrategy(ModelSimple): + """ + Can be set to `uuid` to automatically generate primary keys when new items are added. Default value is `none`, which requires you to supply a primary key for each new item. + + :param value: Must be one of ["none", "uuid"]. + :type value: str + """ + + allowed_values = { + "none", + "uuid", + } + NONE: ClassVar["DatastorePrimaryKeyGenerationStrategy"] + UUID: ClassVar["DatastorePrimaryKeyGenerationStrategy"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DatastorePrimaryKeyGenerationStrategy.NONE = DatastorePrimaryKeyGenerationStrategy("none") +DatastorePrimaryKeyGenerationStrategy.UUID = DatastorePrimaryKeyGenerationStrategy("uuid") diff --git a/src/datadog_api_client/v2/model/delete_apps_datastore_item_request.py b/src/datadog_api_client/v2/model/delete_apps_datastore_item_request.py new file mode 100644 index 0000000000..fcbf369d40 --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_apps_datastore_item_request.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.delete_apps_datastore_item_request_data import DeleteAppsDatastoreItemRequestData + + +class DeleteAppsDatastoreItemRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.delete_apps_datastore_item_request_data import ( + DeleteAppsDatastoreItemRequestData, + ) + + return { + "data": (DeleteAppsDatastoreItemRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[DeleteAppsDatastoreItemRequestData, UnsetType] = unset, **kwargs): + """ + Request to delete a specific item from a datastore by its primary key. + + :param data: Data wrapper containing the information needed to identify and delete a specific datastore item. + :type data: DeleteAppsDatastoreItemRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/delete_apps_datastore_item_request_data.py b/src/datadog_api_client/v2/model/delete_apps_datastore_item_request_data.py new file mode 100644 index 0000000000..9048b41401 --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_apps_datastore_item_request_data.py @@ -0,0 +1,60 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.delete_apps_datastore_item_request_data_attributes import ( + DeleteAppsDatastoreItemRequestDataAttributes, + ) + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + +class DeleteAppsDatastoreItemRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.delete_apps_datastore_item_request_data_attributes import ( + DeleteAppsDatastoreItemRequestDataAttributes, + ) + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + return { + "attributes": (DeleteAppsDatastoreItemRequestDataAttributes,), + "type": (DatastoreItemsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: DatastoreItemsDataType, + attributes: Union[DeleteAppsDatastoreItemRequestDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Data wrapper containing the information needed to identify and delete a specific datastore item. + + :param attributes: Attributes specifying which datastore item to delete by its primary key. + :type attributes: DeleteAppsDatastoreItemRequestDataAttributes, optional + + :param type: The resource type for datastore items. + :type type: DatastoreItemsDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/delete_apps_datastore_item_request_data_attributes.py b/src/datadog_api_client/v2/model/delete_apps_datastore_item_request_data_attributes.py new file mode 100644 index 0000000000..4db5349693 --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_apps_datastore_item_request_data_attributes.py @@ -0,0 +1,49 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class DeleteAppsDatastoreItemRequestDataAttributes(ModelNormal): + validations = { + "item_key": { + "max_length": 256, + }, + } + + @cached_property + def openapi_types(_): + return { + "id": (str,), + "item_key": (str,), + } + + attribute_map = { + "id": "id", + "item_key": "item_key", + } + + def __init__(self_, item_key: str, id: Union[str, UnsetType] = unset, **kwargs): + """ + Attributes specifying which datastore item to delete by its primary key. + + :param id: Optional unique identifier of the item to delete. + :type id: str, optional + + :param item_key: The primary key value that identifies the item to delete. Cannot exceed 256 characters. + :type item_key: str + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.item_key = item_key diff --git a/src/datadog_api_client/v2/model/delete_apps_datastore_item_response.py b/src/datadog_api_client/v2/model/delete_apps_datastore_item_response.py new file mode 100644 index 0000000000..91eec93a6a --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_apps_datastore_item_response.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.delete_apps_datastore_item_response_data import DeleteAppsDatastoreItemResponseData + + +class DeleteAppsDatastoreItemResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.delete_apps_datastore_item_response_data import ( + DeleteAppsDatastoreItemResponseData, + ) + + return { + "data": (DeleteAppsDatastoreItemResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[DeleteAppsDatastoreItemResponseData, UnsetType] = unset, **kwargs): + """ + Response from successfully deleting a datastore item. + + :param data: Data containing the identifier of the datastore item that was successfully deleted. + :type data: DeleteAppsDatastoreItemResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/delete_apps_datastore_item_response_data.py b/src/datadog_api_client/v2/model/delete_apps_datastore_item_response_data.py new file mode 100644 index 0000000000..a595d5892c --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_apps_datastore_item_response_data.py @@ -0,0 +1,49 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + +class DeleteAppsDatastoreItemResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + return { + "id": (str,), + "type": (DatastoreItemsDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, type: DatastoreItemsDataType, id: Union[str, UnsetType] = unset, **kwargs): + """ + Data containing the identifier of the datastore item that was successfully deleted. + + :param id: The unique identifier of the item that was deleted. + :type id: str, optional + + :param type: The resource type for datastore items. + :type type: DatastoreItemsDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/item_api_payload.py b/src/datadog_api_client/v2/model/item_api_payload.py new file mode 100644 index 0000000000..b83b97bed4 --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.item_api_payload_data import ItemApiPayloadData + + +class ItemApiPayload(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.item_api_payload_data import ItemApiPayloadData + + return { + "data": (ItemApiPayloadData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ItemApiPayloadData, UnsetType] = unset, **kwargs): + """ + A single datastore item with its content and metadata. + + :param data: Core data and metadata for a single datastore item. + :type data: ItemApiPayloadData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/item_api_payload_array.py b/src/datadog_api_client/v2/model/item_api_payload_array.py new file mode 100644 index 0000000000..6a48ba5368 --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_array.py @@ -0,0 +1,57 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.item_api_payload_data import ItemApiPayloadData + from datadog_api_client.v2.model.item_api_payload_meta import ItemApiPayloadMeta + + +class ItemApiPayloadArray(ModelNormal): + validations = { + "data": { + "max_items": 100, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.item_api_payload_data import ItemApiPayloadData + from datadog_api_client.v2.model.item_api_payload_meta import ItemApiPayloadMeta + + return { + "data": ([ItemApiPayloadData],), + "meta": (ItemApiPayloadMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__(self_, data: List[ItemApiPayloadData], meta: Union[ItemApiPayloadMeta, UnsetType] = unset, **kwargs): + """ + A collection of datastore items with pagination and schema metadata. + + :param data: An array of datastore items with their content and metadata. + :type data: [ItemApiPayloadData] + + :param meta: Additional metadata about a collection of datastore items, including pagination and schema information. + :type meta: ItemApiPayloadMeta, optional + """ + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/item_api_payload_data.py b/src/datadog_api_client/v2/model/item_api_payload_data.py new file mode 100644 index 0000000000..7106d9ee23 --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.item_api_payload_data_attributes import ItemApiPayloadDataAttributes + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + +class ItemApiPayloadData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.item_api_payload_data_attributes import ItemApiPayloadDataAttributes + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + return { + "attributes": (ItemApiPayloadDataAttributes,), + "id": (str,), + "type": (DatastoreItemsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: DatastoreItemsDataType, + attributes: Union[ItemApiPayloadDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Core data and metadata for a single datastore item. + + :param attributes: Metadata and content of a datastore item. + :type attributes: ItemApiPayloadDataAttributes, optional + + :param id: The unique identifier of the datastore. + :type id: str, optional + + :param type: The resource type for datastore items. + :type type: DatastoreItemsDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/item_api_payload_data_attributes.py b/src/datadog_api_client/v2/model/item_api_payload_data_attributes.py new file mode 100644 index 0000000000..6417b3e325 --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_data_attributes.py @@ -0,0 +1,104 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.item_api_payload_data_attributes_value import ItemApiPayloadDataAttributesValue + + +class ItemApiPayloadDataAttributes(ModelNormal): + validations = { + "primary_column_name": { + "max_length": 63, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.item_api_payload_data_attributes_value import ItemApiPayloadDataAttributesValue + + return { + "created_at": (datetime,), + "modified_at": (datetime,), + "org_id": (int,), + "primary_column_name": (str,), + "signature": (str,), + "store_id": (str,), + "value": (ItemApiPayloadDataAttributesValue,), + } + + attribute_map = { + "created_at": "created_at", + "modified_at": "modified_at", + "org_id": "org_id", + "primary_column_name": "primary_column_name", + "signature": "signature", + "store_id": "store_id", + "value": "value", + } + + def __init__( + self_, + created_at: Union[datetime, UnsetType] = unset, + modified_at: Union[datetime, UnsetType] = unset, + org_id: Union[int, UnsetType] = unset, + primary_column_name: Union[str, UnsetType] = unset, + signature: Union[str, UnsetType] = unset, + store_id: Union[str, UnsetType] = unset, + value: Union[ItemApiPayloadDataAttributesValue, UnsetType] = unset, + **kwargs, + ): + """ + Metadata and content of a datastore item. + + :param created_at: Timestamp when the item was first created. + :type created_at: datetime, optional + + :param modified_at: Timestamp when the item was last modified. + :type modified_at: datetime, optional + + :param org_id: The ID of the organization that owns this item. + :type org_id: int, optional + + :param primary_column_name: The name of the primary key column for this datastore. Primary column names: + + * Must abide by both `PostgreSQL naming conventions `_ + * Cannot exceed 63 characters + :type primary_column_name: str, optional + + :param signature: A unique signature identifying this item version. + :type signature: str, optional + + :param store_id: The unique identifier of the datastore containing this item. + :type store_id: str, optional + + :param value: The data content (as key-value pairs) of a datastore item. + :type value: ItemApiPayloadDataAttributesValue, optional + """ + if created_at is not unset: + kwargs["created_at"] = created_at + if modified_at is not unset: + kwargs["modified_at"] = modified_at + if org_id is not unset: + kwargs["org_id"] = org_id + if primary_column_name is not unset: + kwargs["primary_column_name"] = primary_column_name + if signature is not unset: + kwargs["signature"] = signature + if store_id is not unset: + kwargs["store_id"] = store_id + if value is not unset: + kwargs["value"] = value + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/item_api_payload_data_attributes_value.py b/src/datadog_api_client/v2/model/item_api_payload_data_attributes_value.py new file mode 100644 index 0000000000..3ad7a36874 --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_data_attributes_value.py @@ -0,0 +1,17 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, +) + + +class ItemApiPayloadDataAttributesValue(ModelNormal): + def __init__(self_, **kwargs): + """ + The data content (as key-value pairs) of a datastore item. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/item_api_payload_meta.py b/src/datadog_api_client/v2/model/item_api_payload_meta.py new file mode 100644 index 0000000000..018d7ef0fd --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_meta.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.item_api_payload_meta_page import ItemApiPayloadMetaPage + from datadog_api_client.v2.model.item_api_payload_meta_schema import ItemApiPayloadMetaSchema + + +class ItemApiPayloadMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.item_api_payload_meta_page import ItemApiPayloadMetaPage + from datadog_api_client.v2.model.item_api_payload_meta_schema import ItemApiPayloadMetaSchema + + return { + "page": (ItemApiPayloadMetaPage,), + "schema": (ItemApiPayloadMetaSchema,), + } + + attribute_map = { + "page": "page", + "schema": "schema", + } + + def __init__( + self_, + page: Union[ItemApiPayloadMetaPage, UnsetType] = unset, + schema: Union[ItemApiPayloadMetaSchema, UnsetType] = unset, + **kwargs, + ): + """ + Additional metadata about a collection of datastore items, including pagination and schema information. + + :param page: Pagination information for a collection of datastore items. + :type page: ItemApiPayloadMetaPage, optional + + :param schema: Schema information about the datastore, including its primary key and field definitions. + :type schema: ItemApiPayloadMetaSchema, optional + """ + if page is not unset: + kwargs["page"] = page + if schema is not unset: + kwargs["schema"] = schema + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/item_api_payload_meta_page.py b/src/datadog_api_client/v2/model/item_api_payload_meta_page.py new file mode 100644 index 0000000000..ec60d37dd2 --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_meta_page.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ItemApiPayloadMetaPage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "has_more": (bool,), + "total_count": (int,), + "total_filtered_count": (int,), + } + + attribute_map = { + "has_more": "hasMore", + "total_count": "totalCount", + "total_filtered_count": "totalFilteredCount", + } + + def __init__( + self_, + has_more: Union[bool, UnsetType] = unset, + total_count: Union[int, UnsetType] = unset, + total_filtered_count: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Pagination information for a collection of datastore items. + + :param has_more: Whether there are additional pages of items beyond the current page. + :type has_more: bool, optional + + :param total_count: The total number of items in the datastore, ignoring any filters. + :type total_count: int, optional + + :param total_filtered_count: The total number of items that match the current filter criteria. + :type total_filtered_count: int, optional + """ + if has_more is not unset: + kwargs["has_more"] = has_more + if total_count is not unset: + kwargs["total_count"] = total_count + if total_filtered_count is not unset: + kwargs["total_filtered_count"] = total_filtered_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/item_api_payload_meta_schema.py b/src/datadog_api_client/v2/model/item_api_payload_meta_schema.py new file mode 100644 index 0000000000..67362b1c98 --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_meta_schema.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.item_api_payload_meta_schema_field import ItemApiPayloadMetaSchemaField + + +class ItemApiPayloadMetaSchema(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.item_api_payload_meta_schema_field import ItemApiPayloadMetaSchemaField + + return { + "fields": ([ItemApiPayloadMetaSchemaField],), + "primary_key": (str,), + } + + attribute_map = { + "fields": "fields", + "primary_key": "primary_key", + } + + def __init__( + self_, + fields: Union[List[ItemApiPayloadMetaSchemaField], UnsetType] = unset, + primary_key: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Schema information about the datastore, including its primary key and field definitions. + + :param fields: An array describing the columns available in this datastore. + :type fields: [ItemApiPayloadMetaSchemaField], optional + + :param primary_key: The name of the primary key column for this datastore. + :type primary_key: str, optional + """ + if fields is not unset: + kwargs["fields"] = fields + if primary_key is not unset: + kwargs["primary_key"] = primary_key + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/item_api_payload_meta_schema_field.py b/src/datadog_api_client/v2/model/item_api_payload_meta_schema_field.py new file mode 100644 index 0000000000..58ccd2145f --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_meta_schema_field.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ItemApiPayloadMetaSchemaField(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "type": (str,), + } + + attribute_map = { + "name": "name", + "type": "type", + } + + def __init__(self_, name: str, type: str, **kwargs): + """ + Information about a specific column in the datastore schema. + + :param name: The name of this column in the datastore. + :type name: str + + :param type: The data type of this column. For example, 'string', 'number', or 'boolean'. + :type type: str + """ + super().__init__(kwargs) + + self_.name = name + self_.type = type diff --git a/src/datadog_api_client/v2/model/put_apps_datastore_item_response_array.py b/src/datadog_api_client/v2/model/put_apps_datastore_item_response_array.py new file mode 100644 index 0000000000..0b3e4cf89c --- /dev/null +++ b/src/datadog_api_client/v2/model/put_apps_datastore_item_response_array.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.put_apps_datastore_item_response_data import PutAppsDatastoreItemResponseData + + +class PutAppsDatastoreItemResponseArray(ModelNormal): + validations = { + "data": { + "max_items": 100, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.put_apps_datastore_item_response_data import PutAppsDatastoreItemResponseData + + return { + "data": ([PutAppsDatastoreItemResponseData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[PutAppsDatastoreItemResponseData], **kwargs): + """ + Response after successfully inserting multiple items into a datastore, containing the identifiers of the created items. + + :param data: An array of data objects containing the identifiers of the successfully inserted items. + :type data: [PutAppsDatastoreItemResponseData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/put_apps_datastore_item_response_data.py b/src/datadog_api_client/v2/model/put_apps_datastore_item_response_data.py new file mode 100644 index 0000000000..e994bb0270 --- /dev/null +++ b/src/datadog_api_client/v2/model/put_apps_datastore_item_response_data.py @@ -0,0 +1,49 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + +class PutAppsDatastoreItemResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType + + return { + "id": (str,), + "type": (DatastoreItemsDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, type: DatastoreItemsDataType, id: Union[str, UnsetType] = unset, **kwargs): + """ + Data containing the identifier of a single item that was successfully inserted into the datastore. + + :param id: The unique identifier assigned to the inserted item. + :type id: str, optional + + :param type: The resource type for datastore items. + :type type: DatastoreItemsDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/update_apps_datastore_item_request.py b/src/datadog_api_client/v2/model/update_apps_datastore_item_request.py new file mode 100644 index 0000000000..69d42f2552 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_item_request.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_apps_datastore_item_request_data import UpdateAppsDatastoreItemRequestData + + +class UpdateAppsDatastoreItemRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_apps_datastore_item_request_data import ( + UpdateAppsDatastoreItemRequestData, + ) + + return { + "data": (UpdateAppsDatastoreItemRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[UpdateAppsDatastoreItemRequestData, UnsetType] = unset, **kwargs): + """ + Request to update specific fields on an existing datastore item. + + :param data: Data wrapper containing the item identifier and the changes to apply during the update operation. + :type data: UpdateAppsDatastoreItemRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data.py b/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data.py new file mode 100644 index 0000000000..adf545692e --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes import ( + UpdateAppsDatastoreItemRequestDataAttributes, + ) + from datadog_api_client.v2.model.update_apps_datastore_item_request_data_type import ( + UpdateAppsDatastoreItemRequestDataType, + ) + + +class UpdateAppsDatastoreItemRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes import ( + UpdateAppsDatastoreItemRequestDataAttributes, + ) + from datadog_api_client.v2.model.update_apps_datastore_item_request_data_type import ( + UpdateAppsDatastoreItemRequestDataType, + ) + + return { + "attributes": (UpdateAppsDatastoreItemRequestDataAttributes,), + "id": (str,), + "type": (UpdateAppsDatastoreItemRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: UpdateAppsDatastoreItemRequestDataType, + attributes: Union[UpdateAppsDatastoreItemRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Data wrapper containing the item identifier and the changes to apply during the update operation. + + :param attributes: Attributes for updating a datastore item, including the item key and changes to apply. + :type attributes: UpdateAppsDatastoreItemRequestDataAttributes, optional + + :param id: The unique identifier of the datastore item. + :type id: str, optional + + :param type: The resource type for datastore items. + :type type: UpdateAppsDatastoreItemRequestDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data_attributes.py b/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data_attributes.py new file mode 100644 index 0000000000..e219fafec1 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data_attributes.py @@ -0,0 +1,71 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes_item_changes import ( + UpdateAppsDatastoreItemRequestDataAttributesItemChanges, + ) + + +class UpdateAppsDatastoreItemRequestDataAttributes(ModelNormal): + validations = { + "item_key": { + "max_length": 256, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes_item_changes import ( + UpdateAppsDatastoreItemRequestDataAttributesItemChanges, + ) + + return { + "id": (str,), + "item_changes": (UpdateAppsDatastoreItemRequestDataAttributesItemChanges,), + "item_key": (str,), + } + + attribute_map = { + "id": "id", + "item_changes": "item_changes", + "item_key": "item_key", + } + + def __init__( + self_, + item_changes: UpdateAppsDatastoreItemRequestDataAttributesItemChanges, + item_key: str, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for updating a datastore item, including the item key and changes to apply. + + :param id: The unique identifier of the item being updated. + :type id: str, optional + + :param item_changes: Changes to apply to a datastore item using set operations. + :type item_changes: UpdateAppsDatastoreItemRequestDataAttributesItemChanges + + :param item_key: The primary key that identifies the item to update. Cannot exceed 256 characters. + :type item_key: str + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.item_changes = item_changes + self_.item_key = item_key diff --git a/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data_attributes_item_changes.py b/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data_attributes_item_changes.py new file mode 100644 index 0000000000..fcc995019c --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data_attributes_item_changes.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +class UpdateAppsDatastoreItemRequestDataAttributesItemChanges(ModelNormal): + @cached_property + def openapi_types(_): + return { + "ops_set": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + } + + attribute_map = { + "ops_set": "ops_set", + } + + def __init__(self_, ops_set: Union[Dict[str, Any], UnsetType] = unset, **kwargs): + """ + Changes to apply to a datastore item using set operations. + + :param ops_set: Set operation that contains key-value pairs to set on the datastore item. + :type ops_set: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional + """ + if ops_set is not unset: + kwargs["ops_set"] = ops_set + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data_type.py b/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data_type.py new file mode 100644 index 0000000000..651091e496 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_item_request_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UpdateAppsDatastoreItemRequestDataType(ModelSimple): + """ + The resource type for datastore items. + + :param value: If omitted defaults to "items". Must be one of ["items"]. + :type value: str + """ + + allowed_values = { + "items", + } + ITEMS: ClassVar["UpdateAppsDatastoreItemRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UpdateAppsDatastoreItemRequestDataType.ITEMS = UpdateAppsDatastoreItemRequestDataType("items") diff --git a/src/datadog_api_client/v2/model/update_apps_datastore_request.py b/src/datadog_api_client/v2/model/update_apps_datastore_request.py new file mode 100644 index 0000000000..65a9481370 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_request.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_apps_datastore_request_data import UpdateAppsDatastoreRequestData + + +class UpdateAppsDatastoreRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_apps_datastore_request_data import UpdateAppsDatastoreRequestData + + return { + "data": (UpdateAppsDatastoreRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[UpdateAppsDatastoreRequestData, UnsetType] = unset, **kwargs): + """ + Request to update a datastore's configuration such as its name or description. + + :param data: Data wrapper containing the datastore identifier and the attributes to update. + :type data: UpdateAppsDatastoreRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/update_apps_datastore_request_data.py b/src/datadog_api_client/v2/model/update_apps_datastore_request_data.py new file mode 100644 index 0000000000..21fbd33fd0 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_request_data.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.update_apps_datastore_request_data_attributes import ( + UpdateAppsDatastoreRequestDataAttributes, + ) + from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType + + +class UpdateAppsDatastoreRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_apps_datastore_request_data_attributes import ( + UpdateAppsDatastoreRequestDataAttributes, + ) + from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType + + return { + "attributes": (UpdateAppsDatastoreRequestDataAttributes,), + "id": (str,), + "type": (DatastoreDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: DatastoreDataType, + attributes: Union[UpdateAppsDatastoreRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Data wrapper containing the datastore identifier and the attributes to update. + + :param attributes: Attributes that can be updated on a datastore. + :type attributes: UpdateAppsDatastoreRequestDataAttributes, optional + + :param id: The unique identifier of the datastore to update. + :type id: str, optional + + :param type: The resource type for datastores. + :type type: DatastoreDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/update_apps_datastore_request_data_attributes.py b/src/datadog_api_client/v2/model/update_apps_datastore_request_data_attributes.py new file mode 100644 index 0000000000..ecf4f38806 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_request_data_attributes.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class UpdateAppsDatastoreRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "description": (str,), + "name": (str,), + } + + attribute_map = { + "description": "description", + "name": "name", + } + + def __init__(self_, description: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs): + """ + Attributes that can be updated on a datastore. + + :param description: A human-readable description about the datastore. + :type description: str, optional + + :param name: The display name of the datastore. + :type name: str, optional + """ + if description is not unset: + kwargs["description"] = description + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 537242737b..e5ba828e5c 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -401,6 +401,11 @@ from datadog_api_client.v2.model.bulk_mute_findings_request_properties import BulkMuteFindingsRequestProperties from datadog_api_client.v2.model.bulk_mute_findings_response import BulkMuteFindingsResponse from datadog_api_client.v2.model.bulk_mute_findings_response_data import BulkMuteFindingsResponseData +from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request import BulkPutAppsDatastoreItemsRequest +from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data import BulkPutAppsDatastoreItemsRequestData +from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data_attributes import ( + BulkPutAppsDatastoreItemsRequestDataAttributes, +) from datadog_api_client.v2.model.ci_app_aggregate_bucket_value import CIAppAggregateBucketValue from datadog_api_client.v2.model.ci_app_aggregate_bucket_value_timeseries import CIAppAggregateBucketValueTimeseries from datadog_api_client.v2.model.ci_app_aggregate_bucket_value_timeseries_point import ( @@ -792,6 +797,16 @@ from datadog_api_client.v2.model.create_app_request_data_attributes import CreateAppRequestDataAttributes from datadog_api_client.v2.model.create_app_response import CreateAppResponse from datadog_api_client.v2.model.create_app_response_data import CreateAppResponseData +from datadog_api_client.v2.model.create_apps_datastore_request import CreateAppsDatastoreRequest +from datadog_api_client.v2.model.create_apps_datastore_request_data import CreateAppsDatastoreRequestData +from datadog_api_client.v2.model.create_apps_datastore_request_data_attributes import ( + CreateAppsDatastoreRequestDataAttributes, +) +from datadog_api_client.v2.model.create_apps_datastore_request_data_attributes_org_access import ( + CreateAppsDatastoreRequestDataAttributesOrgAccess, +) +from datadog_api_client.v2.model.create_apps_datastore_response import CreateAppsDatastoreResponse +from datadog_api_client.v2.model.create_apps_datastore_response_data import CreateAppsDatastoreResponseData from datadog_api_client.v2.model.create_custom_framework_request import CreateCustomFrameworkRequest from datadog_api_client.v2.model.create_custom_framework_response import CreateCustomFrameworkResponse from datadog_api_client.v2.model.create_data_deletion_request_body import CreateDataDeletionRequestBody @@ -1056,8 +1071,23 @@ from datadog_api_client.v2.model.dataset_response_single import DatasetResponseSingle from datadog_api_client.v2.model.dataset_type import DatasetType from datadog_api_client.v2.model.dataset_update_request import DatasetUpdateRequest +from datadog_api_client.v2.model.datastore import Datastore +from datadog_api_client.v2.model.datastore_array import DatastoreArray +from datadog_api_client.v2.model.datastore_data import DatastoreData +from datadog_api_client.v2.model.datastore_data_attributes import DatastoreDataAttributes +from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType +from datadog_api_client.v2.model.datastore_item_conflict_mode import DatastoreItemConflictMode +from datadog_api_client.v2.model.datastore_items_data_type import DatastoreItemsDataType +from datadog_api_client.v2.model.datastore_primary_key_generation_strategy import DatastorePrimaryKeyGenerationStrategy from datadog_api_client.v2.model.delete_app_response import DeleteAppResponse from datadog_api_client.v2.model.delete_app_response_data import DeleteAppResponseData +from datadog_api_client.v2.model.delete_apps_datastore_item_request import DeleteAppsDatastoreItemRequest +from datadog_api_client.v2.model.delete_apps_datastore_item_request_data import DeleteAppsDatastoreItemRequestData +from datadog_api_client.v2.model.delete_apps_datastore_item_request_data_attributes import ( + DeleteAppsDatastoreItemRequestDataAttributes, +) +from datadog_api_client.v2.model.delete_apps_datastore_item_response import DeleteAppsDatastoreItemResponse +from datadog_api_client.v2.model.delete_apps_datastore_item_response_data import DeleteAppsDatastoreItemResponseData from datadog_api_client.v2.model.delete_apps_request import DeleteAppsRequest from datadog_api_client.v2.model.delete_apps_request_data_items import DeleteAppsRequestDataItems from datadog_api_client.v2.model.delete_apps_response import DeleteAppsResponse @@ -1802,6 +1832,15 @@ from datadog_api_client.v2.model.issues_search_result_issue_relationship import IssuesSearchResultIssueRelationship from datadog_api_client.v2.model.issues_search_result_relationships import IssuesSearchResultRelationships from datadog_api_client.v2.model.issues_search_result_type import IssuesSearchResultType +from datadog_api_client.v2.model.item_api_payload import ItemApiPayload +from datadog_api_client.v2.model.item_api_payload_array import ItemApiPayloadArray +from datadog_api_client.v2.model.item_api_payload_data import ItemApiPayloadData +from datadog_api_client.v2.model.item_api_payload_data_attributes import ItemApiPayloadDataAttributes +from datadog_api_client.v2.model.item_api_payload_data_attributes_value import ItemApiPayloadDataAttributesValue +from datadog_api_client.v2.model.item_api_payload_meta import ItemApiPayloadMeta +from datadog_api_client.v2.model.item_api_payload_meta_page import ItemApiPayloadMetaPage +from datadog_api_client.v2.model.item_api_payload_meta_schema import ItemApiPayloadMetaSchema +from datadog_api_client.v2.model.item_api_payload_meta_schema_field import ItemApiPayloadMetaSchemaField from datadog_api_client.v2.model.jsonapi_error_item import JSONAPIErrorItem from datadog_api_client.v2.model.jsonapi_error_item_source import JSONAPIErrorItemSource from datadog_api_client.v2.model.jsonapi_error_response import JSONAPIErrorResponse @@ -2987,6 +3026,8 @@ from datadog_api_client.v2.model.projected_cost_type import ProjectedCostType from datadog_api_client.v2.model.projects_response import ProjectsResponse from datadog_api_client.v2.model.publish_app_response import PublishAppResponse +from datadog_api_client.v2.model.put_apps_datastore_item_response_array import PutAppsDatastoreItemResponseArray +from datadog_api_client.v2.model.put_apps_datastore_item_response_data import PutAppsDatastoreItemResponseData from datadog_api_client.v2.model.put_incident_notification_rule_request import PutIncidentNotificationRuleRequest from datadog_api_client.v2.model.query import Query from datadog_api_client.v2.model.query_formula import QueryFormula @@ -3961,6 +4002,22 @@ from datadog_api_client.v2.model.update_app_response import UpdateAppResponse from datadog_api_client.v2.model.update_app_response_data import UpdateAppResponseData from datadog_api_client.v2.model.update_app_response_data_attributes import UpdateAppResponseDataAttributes +from datadog_api_client.v2.model.update_apps_datastore_item_request import UpdateAppsDatastoreItemRequest +from datadog_api_client.v2.model.update_apps_datastore_item_request_data import UpdateAppsDatastoreItemRequestData +from datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes import ( + UpdateAppsDatastoreItemRequestDataAttributes, +) +from datadog_api_client.v2.model.update_apps_datastore_item_request_data_attributes_item_changes import ( + UpdateAppsDatastoreItemRequestDataAttributesItemChanges, +) +from datadog_api_client.v2.model.update_apps_datastore_item_request_data_type import ( + UpdateAppsDatastoreItemRequestDataType, +) +from datadog_api_client.v2.model.update_apps_datastore_request import UpdateAppsDatastoreRequest +from datadog_api_client.v2.model.update_apps_datastore_request_data import UpdateAppsDatastoreRequestData +from datadog_api_client.v2.model.update_apps_datastore_request_data_attributes import ( + UpdateAppsDatastoreRequestDataAttributes, +) from datadog_api_client.v2.model.update_custom_framework_request import UpdateCustomFrameworkRequest from datadog_api_client.v2.model.update_custom_framework_response import UpdateCustomFrameworkResponse from datadog_api_client.v2.model.update_open_api_response import UpdateOpenAPIResponse @@ -4431,6 +4488,9 @@ "BulkMuteFindingsRequestProperties", "BulkMuteFindingsResponse", "BulkMuteFindingsResponseData", + "BulkPutAppsDatastoreItemsRequest", + "BulkPutAppsDatastoreItemsRequestData", + "BulkPutAppsDatastoreItemsRequestDataAttributes", "CIAppAggregateBucketValue", "CIAppAggregateBucketValueTimeseries", "CIAppAggregateBucketValueTimeseriesPoint", @@ -4732,6 +4792,12 @@ "CreateAppRequestDataAttributes", "CreateAppResponse", "CreateAppResponseData", + "CreateAppsDatastoreRequest", + "CreateAppsDatastoreRequestData", + "CreateAppsDatastoreRequestDataAttributes", + "CreateAppsDatastoreRequestDataAttributesOrgAccess", + "CreateAppsDatastoreResponse", + "CreateAppsDatastoreResponseData", "CreateCustomFrameworkRequest", "CreateCustomFrameworkResponse", "CreateDataDeletionRequestBody", @@ -4906,8 +4972,21 @@ "DatasetResponseSingle", "DatasetType", "DatasetUpdateRequest", + "Datastore", + "DatastoreArray", + "DatastoreData", + "DatastoreDataAttributes", + "DatastoreDataType", + "DatastoreItemConflictMode", + "DatastoreItemsDataType", + "DatastorePrimaryKeyGenerationStrategy", "DeleteAppResponse", "DeleteAppResponseData", + "DeleteAppsDatastoreItemRequest", + "DeleteAppsDatastoreItemRequestData", + "DeleteAppsDatastoreItemRequestDataAttributes", + "DeleteAppsDatastoreItemResponse", + "DeleteAppsDatastoreItemResponseData", "DeleteAppsRequest", "DeleteAppsRequestDataItems", "DeleteAppsResponse", @@ -5526,6 +5605,15 @@ "IssuesSearchResultIssueRelationship", "IssuesSearchResultRelationships", "IssuesSearchResultType", + "ItemApiPayload", + "ItemApiPayloadArray", + "ItemApiPayloadData", + "ItemApiPayloadDataAttributes", + "ItemApiPayloadDataAttributesValue", + "ItemApiPayloadMeta", + "ItemApiPayloadMetaPage", + "ItemApiPayloadMetaSchema", + "ItemApiPayloadMetaSchemaField", "JSONAPIErrorItem", "JSONAPIErrorItemSource", "JSONAPIErrorResponse", @@ -6257,6 +6345,8 @@ "ProjectedCostType", "ProjectsResponse", "PublishAppResponse", + "PutAppsDatastoreItemResponseArray", + "PutAppsDatastoreItemResponseData", "PutIncidentNotificationRuleRequest", "Query", "QueryFormula", @@ -7029,6 +7119,14 @@ "UpdateAppResponse", "UpdateAppResponseData", "UpdateAppResponseDataAttributes", + "UpdateAppsDatastoreItemRequest", + "UpdateAppsDatastoreItemRequestData", + "UpdateAppsDatastoreItemRequestDataAttributes", + "UpdateAppsDatastoreItemRequestDataAttributesItemChanges", + "UpdateAppsDatastoreItemRequestDataType", + "UpdateAppsDatastoreRequest", + "UpdateAppsDatastoreRequestData", + "UpdateAppsDatastoreRequestDataAttributes", "UpdateCustomFrameworkRequest", "UpdateCustomFrameworkResponse", "UpdateOpenAPIResponse", diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_bad_request_response.frozen new file mode 100644 index 0000000000..91fb9c71db --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-09-06T19:02:39.774Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_bad_request_response.yaml new file mode 100644 index 0000000000..d962bdcf98 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_bad_request_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":{"id":"226df00a-c52e-41cd-9067-2b8c2b18649d","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"values":[{"id":"cust_3141","name":"Johnathan"},{"badPrimaryKey":"key2","name":"Johnathan"}]},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/226df00a-c52e-41cd-9067-2b8c2b18649d/items/bulk + response: + body: + string: '{"errors":[{"status":"400","id":"b6f27ea4-0a0b-43fa-92ef-b023f8e06e2c","title":"item + key missing or invalid","detail":"primary column \"id\" is missing"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/226df00a-c52e-41cd-9067-2b8c2b18649d + response: + body: + string: '{"data":{"id":"226df00a-c52e-41cd-9067-2b8c2b18649d","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_not_found_response.frozen new file mode 100644 index 0000000000..468bf22ec4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-09-06T19:02:54.153Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_not_found_response.yaml new file mode 100644 index 0000000000..2fb5240efc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"values":[{"id":"cust_3141","name":"Johnathan"},{"id":"cust_3142","name":"Mary"}]},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/70b87c26-886f-497a-bd9d-09f53bc9b40c/items/bulk + response: + body: + string: '{"errors":[{"status":"404","id":"b799bd68-cfb7-4c3d-8026-e0e00c27252f","title":"datastore + not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_ok_response.frozen new file mode 100644 index 0000000000..315b978b48 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:06.486Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_ok_response.yaml new file mode 100644 index 0000000000..bc37a5642d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_write_datastore_items_returns_ok_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":{"id":"6c0dbbfd-a905-4f79-9c2f-16cb4d9a56a7","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"values":[{"id":"cust_3141","name":"Johnathan"},{"id":"cust_3142","name":"Mary"}]},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/6c0dbbfd-a905-4f79-9c2f-16cb4d9a56a7/items/bulk + response: + body: + string: '{"data":[{"id":"8c6bba37-01d4-4b49-9d90-4ac909aa8c9f","type":"items"},{"id":"285244c6-b07f-4502-928b-2444c1de31e7","type":"items"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/6c0dbbfd-a905-4f79-9c2f-16cb4d9a56a7 + response: + body: + string: '{"data":{"id":"6c0dbbfd-a905-4f79-9c2f-16cb4d9a56a7","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_bad_request_response.frozen new file mode 100644 index 0000000000..bc7536ef1f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:06.982Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_bad_request_response.yaml new file mode 100644 index 0000000000..0b33843d1b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_bad_request_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"datastore-name","primary_column_name":"0invalid_key"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"errors":[{"status":"400","id":"78cd887f-1a77-421f-915d-4bfebb3784c0","title":"datastore + configuration invalid","detail":"column name ''0invalid_key'' does not start + with a letter or an underscore"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_ok_response.frozen new file mode 100644 index 0000000000..6833aae650 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:07.136Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_ok_response.yaml new file mode 100644 index 0000000000..827a611302 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_ok_response.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"datastore-name","primary_column_name":"primaryKey"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":{"id":"040e45f8-b354-4817-8c01-e5d2bb8aa55d","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/040e45f8-b354-4817-8c01-e5d2bb8aa55d + response: + body: + string: '{"data":{"id":"040e45f8-b354-4817-8c01-e5d2bb8aa55d","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_bad_request_response.frozen new file mode 100644 index 0000000000..0bfb558f91 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-09-06T19:03:07.134Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_bad_request_response.yaml new file mode 100644 index 0000000000..9bae35f434 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"item_key":"primaryKey"},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/invalid-uuid/items + response: + body: + string: '{"errors":[{"status":"400","id":"5adc82ee-f920-4fe9-aafc-10cabac28b68","title":"invalid + path parameter","detail":"invalid datastoreId format in path","source":{"parameter":"datastoreId"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_not_found_response.frozen new file mode 100644 index 0000000000..2636c1d2bf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-09-06T19:03:18.396Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_not_found_response.yaml new file mode 100644 index 0000000000..41e6b0b3ee --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"item_key":"primaryKey"},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/70b87c26-886f-497a-bd9d-09f53bc9b40c/items + response: + body: + string: '{"errors":[{"status":"404","id":"38b88198-bd74-4494-8571-f689b21cd216","title":"datastore + not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_ok_response.frozen new file mode 100644 index 0000000000..c639a010e9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:07.743Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_ok_response.yaml new file mode 100644 index 0000000000..0e790faa51 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_ok_response.yaml @@ -0,0 +1,72 @@ +interactions: +- request: + body: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":{"id":"ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"conflict_mode":"fail_on_conflict","values":[{"data":"test-value","id":"test-key"}]},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8/items/bulk + response: + body: + string: '{"data":[{"id":"8eee511f-e1bc-4a02-8805-1770bbdc4d2e","type":"items"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"item_key":"test-key"},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8/items + response: + body: + string: '{"data":{"id":"8eee511f-e1bc-4a02-8805-1770bbdc4d2e","type":"items"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8 + response: + body: + string: '{"data":{"id":"ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_bad_request_response.frozen new file mode 100644 index 0000000000..a262f922c4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:08.448Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_bad_request_response.yaml new file mode 100644 index 0000000000..f997d65776 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/invalid-uuid + response: + body: + string: '{"errors":[{"status":"400","id":"ee853859-fef5-4771-98bd-1af309286bc0","title":"invalid + path parameter","detail":"invalid datastoreId format in path","source":{"parameter":"datastoreId"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_ok_response.frozen new file mode 100644 index 0000000000..b46a8c75f2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:08.615Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_ok_response.yaml new file mode 100644 index 0000000000..0d410d0ae6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_ok_response.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":{"id":"8185f4a4-6cf6-4fde-a705-e248effe50fc","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/8185f4a4-6cf6-4fde-a705-e248effe50fc + response: + body: + string: '{"data":{"id":"8185f4a4-6cf6-4fde-a705-e248effe50fc","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/8185f4a4-6cf6-4fde-a705-e248effe50fc + response: + body: + string: '' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_bad_request_response.frozen new file mode 100644 index 0000000000..17f435beab --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:09.096Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_bad_request_response.yaml new file mode 100644 index 0000000000..4ce598cfee --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions-datastores/invalid-uuid + response: + body: + string: '{"errors":[{"status":"400","id":"51295683-ce69-48d6-8efb-4d877ff7e1b2","title":"invalid + path parameter","detail":"invalid datastoreId format in path","source":{"parameter":"datastoreId"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_not_found_response.frozen new file mode 100644 index 0000000000..ae156efd1c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:09.218Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_not_found_response.yaml new file mode 100644 index 0000000000..fdb26caf25 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions-datastores/5bf53b3f-b230-4b35-ab1a-b39f2633eb22 + response: + body: + string: '{"errors":[{"status":"404","id":"d4aab06a-e0f9-4aff-9af4-bc99e2938ec3","title":"datastore + not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_ok_response.frozen new file mode 100644 index 0000000000..34a4f2a77c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:09.394Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_ok_response.yaml new file mode 100644 index 0000000000..afe8397ab8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_ok_response.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":{"id":"b06309e7-b4e9-4edb-a494-e5dd27d9525f","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions-datastores/b06309e7-b4e9-4edb-a494-e5dd27d9525f + response: + body: + string: '{"data":{"id":"b06309e7-b4e9-4edb-a494-e5dd27d9525f","type":"datastores","attributes":{"created_at":"2025-09-05T22:54:09.545626Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-09-05T22:54:09.545626Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/b06309e7-b4e9-4edb-a494-e5dd27d9525f + response: + body: + string: '{"data":{"id":"b06309e7-b4e9-4edb-a494-e5dd27d9525f","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_bad_request_response.frozen new file mode 100644 index 0000000000..b7c9ce7b39 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:09.863Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_bad_request_response.yaml new file mode 100644 index 0000000000..9b02e78583 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions-datastores/invalid-uuid/items + response: + body: + string: '{"errors":[{"status":"400","id":"d41a11e1-5db7-47bf-a542-b469768194dd","title":"invalid + path parameter","detail":"invalid datastoreId format in path","source":{"parameter":"datastoreId"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_not_found_response.frozen new file mode 100644 index 0000000000..0f045f4f81 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:10.018Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_not_found_response.yaml new file mode 100644 index 0000000000..8990da9a93 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions-datastores/3cfdd0b8-c490-4969-8d51-69add64a70ea/items + response: + body: + string: '{"errors":[{"status":"404","id":"1fe0de3f-9e9c-475b-8cb4-6ea831aa167f","title":"datastore + not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_ok_response.frozen new file mode 100644 index 0000000000..87a934a1bf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:10.195Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_ok_response.yaml new file mode 100644 index 0000000000..afc0d419d8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_ok_response.yaml @@ -0,0 +1,70 @@ +interactions: +- request: + body: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":{"id":"edfe7784-570c-4984-a4ae-883642b561d8","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"conflict_mode":"fail_on_conflict","values":[{"data":"test-value","id":"test-key"}]},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/edfe7784-570c-4984-a4ae-883642b561d8/items/bulk + response: + body: + string: '{"data":[{"id":"b20fe87b-f383-4afc-91ee-8fbc178942a2","type":"items"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions-datastores/edfe7784-570c-4984-a4ae-883642b561d8/items + response: + body: + string: '{"data":[{"id":"b20fe87b-f383-4afc-91ee-8fbc178942a2","type":"items","attributes":{"created_at":"2025-09-05T22:54:10.544424Z","modified_at":"2025-09-05T22:54:10.544424Z","org_id":321813,"primary_column_name":"id","signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"voTcDho3mVIVzY8m98GyVfIib84TgbZoHSWzVQ09TFU=\\\",\\\"timestamp\\\":1757112850,\\\"proof\\\":\\\"MGUCMDX1ijfjUxZK9hVzaMIxU+DociQUkZpkz7FD7tAiykeviU/66p2j1sDf4fYGK3agCwIxALarzvBhasIVGC46VgJuoC0MIkb5WyVWZKh50ist9OfVCQbbe4ZTKKvrW3pVQN34rg==\\\"}\",\"version\":1}","store_id":"edfe7784-570c-4984-a4ae-883642b561d8","value":{"data":"test-value","id":"test-key"}}}],"meta":{"page":{"totalCount":1,"totalFilteredCount":1,"hasMore":false},"schema":{"primary_key":"id","fields":[{"name":"id","type":"STRING"},{"name":"data","type":"JSON"}]}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/edfe7784-570c-4984-a4ae-883642b561d8 + response: + body: + string: '{"data":{"id":"edfe7784-570c-4984-a4ae-883642b561d8","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_datastores_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_datastores_returns_ok_response.frozen new file mode 100644 index 0000000000..34ec023d7a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastores_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:10.870Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_datastores_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_datastores_returns_ok_response.yaml new file mode 100644 index 0000000000..9033c688af --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastores_returns_ok_response.yaml @@ -0,0 +1,59 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":[{"id":"0ff20856-6af3-4b8a-bfa6-26ffd7f61551","type":"datastores","attributes":{"created_at":"2025-08-08T13:45:48.532915Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:45:48.532915Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"1c60feb8-f9ea-4b81-9f7d-b0ae97b10cc7","type":"datastores","attributes":{"created_at":"2025-08-11T21:33:38.587401Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T21:33:38.587401Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"1d38b58d-d7ac-4a47-be37-6457cea49630","type":"datastores","attributes":{"created_at":"2025-08-08T17:42:31.923013Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T17:42:31.923013Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"1d6f1853-eb64-43a3-a85b-b187853393c7","type":"datastores","attributes":{"created_at":"2025-08-08T13:41:27.399846Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:41:27.399846Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"236e7736-44d9-40d0-985f-1ab73f25ad09","type":"datastores","attributes":{"created_at":"2025-08-08T18:02:29.490155Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T18:02:29.490155Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"2b0704ce-1efd-4485-976b-f272ea39a9b9","type":"datastores","attributes":{"created_at":"2025-08-08T14:02:11.360529Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T14:02:11.360529Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"2bccd24d-715d-473f-8771-eff9370d14b9","type":"datastores","attributes":{"created_at":"2025-08-11T22:19:07.258146Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T22:19:07.258146Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"31af63e6-8363-45a4-ad6b-d92ec256b005","type":"datastores","attributes":{"created_at":"2025-08-08T03:27:41.246238Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T03:27:41.246238Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"3d4f33dd-41af-4b4e-94e0-a142cd47f83d","type":"datastores","attributes":{"created_at":"2025-08-08T17:58:55.363703Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T17:58:55.363703Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"44f23b41-3925-4620-b5ad-641c0cac57b9","type":"datastores","attributes":{"created_at":"2025-08-08T17:30:39.520162Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T17:30:39.520162Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"457cae9c-32ad-4598-9ac0-489c7d4fc20b","type":"datastores","attributes":{"created_at":"2025-08-08T03:07:54.05107Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T03:07:54.05107Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"55a92f3e-6804-4f45-9ecf-7c09cef155ed","type":"datastores","attributes":{"created_at":"2025-08-08T13:33:42.534986Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:33:42.534987Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"5b3664f0-faaa-4f1b-b067-f521aa156516","type":"datastores","attributes":{"created_at":"2025-08-08T13:35:02.776449Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:35:02.776449Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"7059cb1d-20f6-44e6-a5ee-8eeb19b799e2","type":"datastores","attributes":{"created_at":"2025-08-08T17:24:03.907384Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T17:24:03.907384Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"7ef9ca96-be6d-435c-b452-9e562beedb4a","type":"datastores","attributes":{"created_at":"2025-08-08T17:27:38.411129Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T17:27:38.411129Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"8204dff8-7335-4e33-a28b-8f8a0dd47ad0","type":"datastores","attributes":{"created_at":"2025-08-08T14:08:19.382083Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T14:08:19.382083Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"84e4ca89-9266-4fb3-a552-e6da080abc3f","type":"datastores","attributes":{"created_at":"2025-08-08T18:11:58.405584Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T18:11:58.405584Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"858032d2-1c2f-4ac1-a434-de5773fc14c2","type":"datastores","attributes":{"created_at":"2025-08-08T02:55:43.831724Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T02:55:43.831724Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"89c95311-d63a-4535-be9d-92a3912ec074","type":"datastores","attributes":{"created_at":"2025-08-11T21:24:28.298273Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T21:24:28.298273Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"8b0fb519-c55f-45d5-b532-1645bed41a92","type":"datastores","attributes":{"created_at":"2025-08-08T13:54:02.27972Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:54:02.27972Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"99366571-d1de-4a6f-9213-5c77a5468de9","type":"datastores","attributes":{"created_at":"2025-08-08T13:50:10.748216Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:50:10.748217Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"9d9d7162-cfd2-40f1-b413-d2df89a5eba9","type":"datastores","attributes":{"created_at":"2025-08-08T03:28:50.178882Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T03:28:50.178882Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"a751bca4-54eb-4739-a4a3-4779650f9fad","type":"datastores","attributes":{"created_at":"2025-08-08T03:45:28.881437Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T03:45:28.881437Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"a78fe3e0-4325-459f-aca4-69c084ab818d","type":"datastores","attributes":{"created_at":"2025-08-08T13:22:37.043971Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:22:37.043972Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"aec831f3-cbc3-411f-8ef0-23fdb834d549","type":"datastores","attributes":{"created_at":"2025-08-08T17:36:12.428171Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T17:36:12.428171Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"b55b6d33-da75-4432-85fc-e0f0a28b4826","type":"datastores","attributes":{"created_at":"2025-08-08T13:38:13.641577Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:38:13.641578Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"bd5e4649-674b-444f-850c-74625b0be9ab","type":"datastores","attributes":{"created_at":"2025-08-08T18:03:00.425892Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T18:03:00.425892Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"be6825fd-82d5-4d9d-8db5-cc674404b710","type":"datastores","attributes":{"created_at":"2025-08-08T03:01:57.110842Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T03:01:57.110843Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"c412c4b3-7d3d-4ac3-ace6-99abfc0a8567","type":"datastores","attributes":{"created_at":"2025-08-08T02:57:09.998039Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T02:57:09.998039Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"c698d221-5dc9-44d3-ae61-a6a422d204ab","type":"datastores","attributes":{"created_at":"2025-08-08T03:18:11.876246Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T03:18:11.876246Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"cd915e84-87b1-495d-a868-9c24578696e3","type":"datastores","attributes":{"created_at":"2025-08-08T13:36:53.994588Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:36:53.994588Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"cfadef50-963b-45fa-8334-f33094ca6d76","type":"datastores","attributes":{"created_at":"2025-08-08T14:29:33.425183Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T14:29:33.425183Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"d018730c-26cb-47af-ba93-3604d8a8ad74","type":"datastores","attributes":{"created_at":"2025-08-08T17:35:23.034496Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T17:35:23.034496Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"d14f84a9-9a26-4b0d-bd6d-f7baf8c9a9ae","type":"datastores","attributes":{"created_at":"2025-08-08T17:30:07.452804Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T17:30:07.452804Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"d3dedf8d-6620-4dec-bb8b-b0fa53b19135","type":"datastores","attributes":{"created_at":"2025-08-08T13:45:16.371907Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:45:16.371907Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"d8cdfbae-8ec9-4c50-8459-5d55a7b5a945","type":"datastores","attributes":{"created_at":"2025-08-08T17:27:01.039091Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T17:27:01.039091Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"de765300-fca1-4ab2-a441-a6633cd7f976","type":"datastores","attributes":{"created_at":"2025-08-08T14:11:34.405607Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T14:11:34.405607Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"e174ff20-eff7-40b9-a472-b8ce2a8492d8","type":"datastores","attributes":{"created_at":"2025-08-11T20:40:08.137413Z","creator_user_id":2320499,"creator_user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","description":"","modified_at":"2025-08-11T20:40:08.137413Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"ea68e1d7-6e4d-40d2-a67f-f5c3c54aab2b","type":"datastores","attributes":{"created_at":"2025-08-08T03:03:21.673996Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T03:03:21.673996Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"ee56b789-56b6-481c-851b-d0c14a7228d4","type":"datastores","attributes":{"created_at":"2025-08-08T13:44:50.073893Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T13:44:50.073894Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}},{"id":"f5a8ac6e-0cfb-44ad-b71d-28fd40a210a6","type":"datastores","attributes":{"created_at":"2025-08-08T03:36:29.121686Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-08T03:36:29.121686Z","name":"Test + Datastore","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_bad_request_response.frozen new file mode 100644 index 0000000000..184d2c8e92 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:11.057Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_bad_request_response.yaml new file mode 100644 index 0000000000..ca4539a409 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"item_changes":{},"item_key":""},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions-datastores/invalid-uuid/items + response: + body: + string: '{"errors":[{"status":"400","id":"f88d0b88-0d55-482b-9a90-3556ef7d6b4a","title":"invalid + path parameter","detail":"invalid datastoreId format in path","source":{"parameter":"datastoreId"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_not_found_response.frozen new file mode 100644 index 0000000000..d3523bfc49 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:11.195Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_not_found_response.yaml new file mode 100644 index 0000000000..cad88f0dec --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"item_changes":{},"item_key":"itemKey"},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions-datastores/3cfdd0b8-c490-4969-8d51-69add64a70ea/items + response: + body: + string: '{"errors":[{"status":"404","id":"d0d6adeb-c5cf-4dce-98d9-532cbc386b09","title":"datastore + not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_ok_response.frozen new file mode 100644 index 0000000000..27714e5ed3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:11.331Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_ok_response.yaml new file mode 100644 index 0000000000..0b7675996b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_item_returns_ok_response.yaml @@ -0,0 +1,72 @@ +interactions: +- request: + body: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":{"id":"6d5556c8-04d7-45dc-9a08-cd671c4e519a","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"conflict_mode":"fail_on_conflict","values":[{"data":"test-value","id":"test-key"}]},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/6d5556c8-04d7-45dc-9a08-cd671c4e519a/items/bulk + response: + body: + string: '{"data":[{"id":"94c791a3-9cc2-44be-857e-95c11eb1eefd","type":"items"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"item_changes":{},"item_key":"test-key"},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions-datastores/6d5556c8-04d7-45dc-9a08-cd671c4e519a/items + response: + body: + string: '{"data":{"id":"94c791a3-9cc2-44be-857e-95c11eb1eefd","type":"items","attributes":{"created_at":"2025-09-05T22:54:11.652289Z","modified_at":"2025-09-05T22:54:11.793763Z","org_id":321813,"primary_column_name":"id","signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"voTcDho3mVIVzY8m98GyVfIib84TgbZoHSWzVQ09TFU=\\\",\\\"timestamp\\\":1757112851,\\\"proof\\\":\\\"MGQCMGTEegXzPFeiOMj3tizwKvIXhJ2jLwzZW240N+HDLsvK2QIs1PD+6n/b15rdnABaigIwKYLG3PRtBKd8hV7eF4r9X5vM9fJvCyMPPi05K86m3lm22oxWEsDvLdgx0PxrojuT\\\"}\",\"version\":1}","store_id":"6d5556c8-04d7-45dc-9a08-cd671c4e519a","value":{"data":"test-value","id":"test-key"}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/6d5556c8-04d7-45dc-9a08-cd671c4e519a + response: + body: + string: '{"data":{"id":"6d5556c8-04d7-45dc-9a08-cd671c4e519a","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_bad_request_response.frozen new file mode 100644 index 0000000000..46b1d9ed35 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:11.950Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_bad_request_response.yaml new file mode 100644 index 0000000000..ab315f0efa --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{},"id":"invalid-uuid","type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions-datastores/invalid-uuid + response: + body: + string: '{"errors":[{"status":"400","id":"22fc6f64-67c9-44ad-b6e0-094dd77c7690","title":"invalid + path parameter","detail":"invalid datastoreId format in path","source":{"parameter":"datastoreId"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_not_found_response.frozen new file mode 100644 index 0000000000..cd4a108daf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:12.100Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_not_found_response.yaml new file mode 100644 index 0000000000..32d07f5758 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"updated name"},"id":"c1eb5bb8-726a-4e59-9a61-ccbb26f95329","type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions-datastores/c1eb5bb8-726a-4e59-9a61-ccbb26f95329 + response: + body: + string: '{"errors":[{"status":"404","id":"9738106a-d613-4be1-ad98-88760c9e0e9f","title":"datastore + not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_ok_response.frozen new file mode 100644 index 0000000000..b667a5007b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-09-05T22:54:12.245Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_ok_response.yaml new file mode 100644 index 0000000000..571bc20c60 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_ok_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":{"id":"785f6031-19e8-4dda-8ccc-f4e700ae5c99","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"name":"updated name"},"id":"785f6031-19e8-4dda-8ccc-f4e700ae5c99","type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions-datastores/785f6031-19e8-4dda-8ccc-f4e700ae5c99 + response: + body: + string: '{"data":{"id":"785f6031-19e8-4dda-8ccc-f4e700ae5c99","type":"datastores","attributes":{"created_at":"2025-09-05T22:54:12.386695Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-09-05T22:54:12.575024Z","name":"updated + name","org_id":321813,"primary_column_name":"id","primary_key_generation_strategy":"none"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/785f6031-19e8-4dda-8ccc-f4e700ae5c99 + response: + body: + string: '{"data":{"id":"785f6031-19e8-4dda-8ccc-f4e700ae5c99","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/actions_datastores.feature b/tests/v2/features/actions_datastores.feature new file mode 100644 index 0000000000..ed19da3aec --- /dev/null +++ b/tests/v2/features/actions_datastores.feature @@ -0,0 +1,220 @@ +@endpoint(actions-datastores) @endpoint(actions-datastores-v2) +Feature: Actions Datastores + Leverage the Actions Datastore API to create, modify, and delete items in + datastores owned by your organization. + + Background: + Given an instance of "ActionsDatastores" API + And a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + + @team:DataDog/app-builder-backend + Scenario: Bulk write datastore items returns "Bad Request" response + Given new "BulkWriteDatastoreItems" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"values": [{"id": "cust_3141", "name": "Johnathan"}, {"badPrimaryKey": "key2", "name": "Johnathan"}]}, "type": "items"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "item key missing or invalid" + + @team:DataDog/app-builder-backend + Scenario: Bulk write datastore items returns "Not Found" response + Given new "BulkWriteDatastoreItems" request + And request contains "datastore_id" parameter with value "70b87c26-886f-497a-bd9d-09f53bc9b40c" + And body with value {"data": {"attributes": {"values": [{"id": "cust_3141", "name": "Johnathan"}, {"id": "cust_3142", "name": "Mary"}]}, "type": "items"}} + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @team:DataDog/app-builder-backend + Scenario: Bulk write datastore items returns "OK" response + Given new "BulkWriteDatastoreItems" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"values": [{"id": "cust_3141", "name": "Johnathan"}, {"id": "cust_3142", "name": "Mary"}]}, "type": "items"}} + When the request is sent + Then the response status is 200 OK + And the response "data" has length 2 + + @team:DataDog/app-builder-backend + Scenario: Create datastore returns "Bad Request" response + Given new "CreateDatastore" request + And body with value {"data": {"attributes": {"name": "datastore-name", "primary_column_name": "0invalid_key"}, "type": "datastores"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore configuration invalid" + + @team:DataDog/app-builder-backend + Scenario: Create datastore returns "OK" response + Given new "CreateDatastore" request + And body with value {"data": {"attributes": {"name": "datastore-name", "primary_column_name": "primaryKey"}, "type": "datastores"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Delete datastore item returns "Bad Request" response + Given new "DeleteDatastoreItem" request + And request contains "datastore_id" parameter with value "invalid-uuid" + And body with value {"data": {"attributes": {"item_key": "primaryKey"}, "type": "items"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @team:DataDog/app-builder-backend + Scenario: Delete datastore item returns "Not Found" response + Given new "DeleteDatastoreItem" request + And request contains "datastore_id" parameter with value "70b87c26-886f-497a-bd9d-09f53bc9b40c" + And body with value {"data": {"attributes": {"item_key": "primaryKey"}, "type": "items"}} + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete datastore item returns "OK" response + Given new "DeleteDatastoreItem" request + And there is a valid "datastore" in the system + And there is a valid "datastore_item" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"item_key": "test-key"}, "type": "items" }} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Delete datastore returns "Bad Request" response + Given new "DeleteDatastore" request + And request contains "datastore_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @skip-typescript @skip-validation @team:DataDog/app-builder-backend + Scenario: Delete datastore returns "OK" response + Given new "DeleteDatastore" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Get datastore returns "Bad Request" response + Given new "GetDatastore" request + And request contains "datastore_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @team:DataDog/app-builder-backend + Scenario: Get datastore returns "Not Found" response + Given new "GetDatastore" request + And request contains "datastore_id" parameter with value "5bf53b3f-b230-4b35-ab1a-b39f2633eb22" + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @team:DataDog/app-builder-backend + Scenario: Get datastore returns "OK" response + Given new "GetDatastore" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{datastore.data.id}}" + + @team:DataDog/app-builder-backend + Scenario: List datastore items returns "Bad Request" response + Given new "ListDatastoreItems" request + And request contains "datastore_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @team:DataDog/app-builder-backend + Scenario: List datastore items returns "Not Found" response + Given new "ListDatastoreItems" request + And request contains "datastore_id" parameter with value "3cfdd0b8-c490-4969-8d51-69add64a70ea" + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: List datastore items returns "OK" response + Given new "ListDatastoreItems" request + And there is a valid "datastore" in the system + And there is a valid "datastore_item" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + + @team:DataDog/app-builder-backend + Scenario: List datastores returns "OK" response + Given new "ListDatastores" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Update datastore item returns "Bad Request" response + Given new "UpdateDatastoreItem" request + And request contains "datastore_id" parameter with value "invalid-uuid" + And body with value {"data": {"attributes": {"item_changes": {}, "item_key": ""}, "type": "items"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/app-builder-backend + Scenario: Update datastore item returns "Not Found" response + Given new "UpdateDatastoreItem" request + And request contains "datastore_id" parameter with value "3cfdd0b8-c490-4969-8d51-69add64a70ea" + And body with value {"data": {"attributes": {"item_changes": {}, "item_key": "itemKey"}, "type": "items"}} + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update datastore item returns "OK" response + Given new "UpdateDatastoreItem" request + And there is a valid "datastore" in the system + And there is a valid "datastore_item" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"item_changes": {}, "item_key": "test-key"}, "type": "items"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Update datastore returns "Bad Request" response + Given new "UpdateDatastore" request + And request contains "datastore_id" parameter with value "invalid-uuid" + And body with value {"data": {"attributes": {}, "type": "datastores", "id": "invalid-uuid"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @team:DataDog/app-builder-backend + Scenario: Update datastore returns "Not Found" response + Given new "UpdateDatastore" request + And request contains "datastore_id" parameter with value "c1eb5bb8-726a-4e59-9a61-ccbb26f95329" + And body with value {"data": {"attributes": {"name": "updated name"}, "type": "datastores", "id": "c1eb5bb8-726a-4e59-9a61-ccbb26f95329"}} + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @team:DataDog/app-builder-backend + Scenario: Update datastore returns "OK" response + Given new "UpdateDatastore" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"name": "updated name"}, "type": "datastores", "id": "{{datastore.data.id}}"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "updated name" diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 4e0610f2f8..a4872ca4d5 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -1,4 +1,32 @@ [ + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"datastores\",\n \"attributes\": {\n \"name\": \"Test Datastore\",\n \"primary_column_name\": \"id\",\n \"primary_key_generation_strategy\": \"none\",\n \"description\": \"\",\n \"org_access\": \"contributor\"\n }\n }\n}" + } + ], + "step": "there is a valid \"datastore\" in the system", + "key": "datastore", + "tag": "Actions Datastores", + "operationId": "CreateDatastore" + }, + { + "parameters": [ + { + "name": "datastore_id", + "source": "datastore.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"items\",\n \"attributes\": {\n \"conflict_mode\": \"fail_on_conflict\",\n \"values\": [\n {\n \"id\": \"test-key\",\n \"data\": \"test-value\"\n }\n ]\n }\n }\n}" + } + ], + "step": "there is a valid \"datastore_item\" in the system", + "key": "datastore_item", + "tag": "Actions Datastores", + "operationId": "BulkWriteDatastoreItems" + }, { "parameters": [ { diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index f9424d938f..9aa936bc99 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1,4 +1,65 @@ { + "ListDatastores": { + "tag": "Actions Datastores", + "undo": { + "type": "safe" + } + }, + "CreateDatastore": { + "tag": "Actions Datastores", + "undo": { + "operationId": "DeleteDatastore", + "parameters": [ + { + "name": "datastore_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteDatastore": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, + "GetDatastore": { + "tag": "Actions Datastores", + "undo": { + "type": "safe" + } + }, + "UpdateDatastore": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, + "DeleteDatastoreItem": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, + "ListDatastoreItems": { + "tag": "Actions Datastores", + "undo": { + "type": "safe" + } + }, + "UpdateDatastoreItem": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, + "BulkWriteDatastoreItems": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, "ListAppKeyRegistrations": { "tag": "Action Connection", "undo": {