diff --git a/.generated-info b/.generated-info index c0aee112f2..3cc3684af8 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "8001cbb", - "generated": "2025-08-13 20:27:33.480" + "spec_repo_commit": "7029440", + "generated": "2025-08-15 03:44:13.113" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5ab5923ba8..b16005c865 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5650,6 +5650,46 @@ components: type: $ref: '#/components/schemas/FindingType' type: object + BulkPutAppsDatastoreItemsRequest: + description: The definition of `BulkPutAppsDatastoreItemsRequest` object. + properties: + data: + $ref: '#/components/schemas/BulkPutAppsDatastoreItemsRequestData' + type: object + BulkPutAppsDatastoreItemsRequestData: + description: The definition of `BulkPutAppsDatastoreItemsRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/BulkPutAppsDatastoreItemsRequestDataAttributes' + id: + description: The `BulkPutAppsDatastoreItemsRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/BulkPutAppsDatastoreItemsRequestDataType' + required: + - type + type: object + BulkPutAppsDatastoreItemsRequestDataAttributes: + description: The definition of `BulkPutAppsDatastoreItemsRequestDataAttributes` + object. + properties: + conflict_mode: + description: The `attributes` `conflict_mode`. + type: string + values: + $ref: '#/components/schemas/DatastoreItemValues' + required: + - values + type: object + BulkPutAppsDatastoreItemsRequestDataType: + default: items + description: Items resource type. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS CIAppAggregateBucketValue: description: A bucket value, can either be a timeseries or a single value. oneOf: @@ -10609,6 +10649,185 @@ components: - id - type type: object + CreateAppsDatastoreFromImportRequest: + description: The definition of `CreateAppsDatastoreFromImportRequest` object. + properties: + data: + $ref: '#/components/schemas/CreateAppsDatastoreFromImportRequestData' + type: object + CreateAppsDatastoreFromImportRequestData: + description: The definition of `CreateAppsDatastoreFromImportRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/CreateAppsDatastoreFromImportRequestDataAttributes' + id: + description: The `CreateAppsDatastoreFromImportRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/CreateAppsDatastoreFromImportRequestDataType' + required: + - type + type: object + CreateAppsDatastoreFromImportRequestDataAttributes: + description: The definition of `CreateAppsDatastoreFromImportRequestDataAttributes` + object. + properties: + description: + description: The `attributes` `description`. + type: string + name: + description: The `attributes` `name`. + example: datastore-name + type: string + org_access: + description: The `attributes` `org_access`. + type: string + primary_column_name: + description: The `attributes` `primary_column_name`. + example: primaryKey + type: string + primary_key_generation_strategy: + $ref: '#/components/schemas/CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy' + values: + $ref: '#/components/schemas/DatastoreItemValues' + required: + - name + - primary_column_name + - values + type: object + CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy: + description: The `attributes` `primary_key_generation_strategy`. + enum: + - none + - uuid + type: string + x-enum-varnames: + - NONE + - UUID + CreateAppsDatastoreFromImportRequestDataType: + default: datastores + description: Datastores resource type. + enum: + - datastores + example: datastores + type: string + x-enum-varnames: + - DATASTORES + CreateAppsDatastoreFromImportResponse: + description: The definition of `CreateAppsDatastoreFromImportResponse` object. + properties: + data: + $ref: '#/components/schemas/CreateAppsDatastoreFromImportResponseData' + type: object + CreateAppsDatastoreFromImportResponseData: + description: The definition of `CreateAppsDatastoreFromImportResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/CreateAppsDatastoreFromImportResponseDataAttributes' + id: + description: The `CreateAppsDatastoreFromImportResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/CreateAppsDatastoreFromImportResponseDataType' + required: + - type + type: object + CreateAppsDatastoreFromImportResponseDataAttributes: + description: The definition of `CreateAppsDatastoreFromImportResponseDataAttributes` + object. + properties: + item_count: + description: The `attributes` `item_count`. + format: int64 + type: integer + type: object + CreateAppsDatastoreFromImportResponseDataType: + default: datastores + description: Datastores resource type. + enum: + - datastores + example: datastores + type: string + x-enum-varnames: + - DATASTORES + CreateAppsDatastoreRequest: + description: The definition of `CreateAppsDatastoreRequest` object. + properties: + data: + $ref: '#/components/schemas/CreateAppsDatastoreRequestData' + type: object + CreateAppsDatastoreRequestData: + description: The definition of `CreateAppsDatastoreRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/CreateAppsDatastoreRequestDataAttributes' + id: + description: The `CreateAppsDatastoreRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/CreateAppsDatastoreRequestDataType' + required: + - type + type: object + CreateAppsDatastoreRequestDataAttributes: + description: The definition of `CreateAppsDatastoreRequestDataAttributes` object. + properties: + description: + description: The `attributes` `description`. + type: string + name: + description: The `attributes` `name`. + example: datastore-name + type: string + org_access: + description: The `attributes` `org_access`. + type: string + primary_column_name: + description: The `attributes` `primary_column_name`. + example: primaryKey + type: string + primary_key_generation_strategy: + description: The `attributes` `primary_key_generation_strategy`. + type: string + required: + - name + - primary_column_name + type: object + CreateAppsDatastoreRequestDataType: + default: datastores + description: Datastores resource type. + enum: + - datastores + example: datastores + type: string + x-enum-varnames: + - DATASTORES + CreateAppsDatastoreResponse: + description: The definition of `CreateAppsDatastoreResponse` object. + properties: + data: + $ref: '#/components/schemas/CreateAppsDatastoreResponseData' + type: object + CreateAppsDatastoreResponseData: + description: The definition of `CreateAppsDatastoreResponseData` object. + properties: + id: + description: The `CreateAppsDatastoreResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/CreateAppsDatastoreResponseDataType' + required: + - type + type: object + CreateAppsDatastoreResponseDataType: + default: datastores + description: Datastores resource type. + enum: + - datastores + example: datastores + type: string + x-enum-varnames: + - DATASTORES CreateCustomFrameworkRequest: description: Request object to create a custom framework. properties: @@ -13315,6 +13534,100 @@ components: required: - data type: object + Datastore: + description: The definition of `Datastore` object. + properties: + data: + $ref: '#/components/schemas/DatastoreData' + type: object + DatastoreArray: + description: The definition of `DatastoreArray` object. + properties: + data: + description: The `DatastoreArray` `data`. + items: + $ref: '#/components/schemas/DatastoreData' + type: array + required: + - data + type: object + DatastoreData: + description: The definition of `DatastoreData` object. + properties: + attributes: + $ref: '#/components/schemas/DatastoreDataAttributes' + id: + description: The `DatastoreData` `id`. + type: string + type: + $ref: '#/components/schemas/DatastoreDataType' + required: + - type + type: object + DatastoreDataAttributes: + description: The definition of `DatastoreDataAttributes` object. + properties: + created_at: + description: The `attributes` `created_at`. + format: date-time + type: string + creator_user_id: + description: The `attributes` `creator_user_id`. + format: int64 + type: integer + creator_user_uuid: + description: The `attributes` `creator_user_uuid`. + type: string + description: + description: The `attributes` `description`. + type: string + modified_at: + description: The `attributes` `modified_at`. + format: date-time + type: string + name: + description: The `attributes` `name`. + type: string + org_id: + description: The `attributes` `org_id`. + format: int64 + type: integer + primary_column_name: + description: The `attributes` `primary_column_name`. + type: string + primary_key_generation_strategy: + $ref: '#/components/schemas/DatastoreDataAttributesPrimaryKeyGenerationStrategy' + type: object + DatastoreDataAttributesPrimaryKeyGenerationStrategy: + description: The `attributes` `primary_key_generation_strategy`. + enum: + - none + - uuid + type: string + x-enum-varnames: + - NONE + - UUID + DatastoreDataType: + default: datastores + description: Datastores resource type. + enum: + - datastores + example: datastores + type: string + x-enum-varnames: + - DATASTORES + DatastoreItemValues: + description: The `attributes` `values`. + example: + - data: example data + key: value + - data: example data2 + key: value2 + items: + additionalProperties: {} + description: Item values to add to the datastore. + type: object + type: array Date: description: Date as Unix timestamp in milliseconds. example: 1722439510282 @@ -13340,6 +13653,101 @@ components: - id - type type: object + DeleteAppsDatastoreItemRequest: + description: The definition of `DeleteAppsDatastoreItemRequest` object. + properties: + data: + $ref: '#/components/schemas/DeleteAppsDatastoreItemRequestData' + type: object + DeleteAppsDatastoreItemRequestData: + description: The definition of `DeleteAppsDatastoreItemRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/DeleteAppsDatastoreItemRequestDataAttributes' + id: + description: The `DeleteAppsDatastoreItemRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/DeleteAppsDatastoreItemRequestDataType' + required: + - type + type: object + DeleteAppsDatastoreItemRequestDataAttributes: + description: The definition of `DeleteAppsDatastoreItemRequestDataAttributes` + object. + properties: + id: + description: The `item` `id`. + example: a7656bcc-51d4-4884-adf7-4d0d9a3e0633 + type: string + item_key: + description: The `attributes` `item_key`. + example: primaryKey + type: string + required: + - item_key + type: object + DeleteAppsDatastoreItemRequestDataType: + default: items + description: Items resource type. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS + DeleteAppsDatastoreItemResponse: + description: The definition of `DeleteAppsDatastoreItemResponse` object. + properties: + data: + $ref: '#/components/schemas/DeleteAppsDatastoreItemResponseData' + type: object + DeleteAppsDatastoreItemResponseData: + description: The definition of `DeleteAppsDatastoreItemResponseData` object. + properties: + id: + description: The `DeleteAppsDatastoreItemResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/DeleteAppsDatastoreItemResponseDataType' + required: + - type + type: object + DeleteAppsDatastoreItemResponseDataType: + default: items + description: Items resource type. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS + DeleteAppsDatastoreResponse: + description: The definition of `DeleteAppsDatastoreResponse` object. + properties: + data: + $ref: '#/components/schemas/DeleteAppsDatastoreResponseData' + type: object + DeleteAppsDatastoreResponseData: + description: The definition of `DeleteAppsDatastoreResponseData` object. + properties: + id: + description: The `DeleteAppsDatastoreResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/DeleteAppsDatastoreResponseDataType' + required: + - type + type: object + DeleteAppsDatastoreResponseDataType: + default: datastores + description: Datastores resource type. + enum: + - datastores + example: datastores + type: string + x-enum-varnames: + - DATASTORES DeleteAppsRequest: description: A request object for deleting multiple apps by ID. example: @@ -21321,6 +21729,133 @@ components: - DOWN - WARNING - 'OFF' + ItemApiPayloadArray: + description: The definition of `ItemApiPayloadArray` object. + properties: + data: + description: The `ItemApiPayloadArray` `data`. + items: + $ref: '#/components/schemas/ItemApiPayloadData' + type: array + meta: + $ref: '#/components/schemas/ItemApiPayloadMeta' + description: Metadata about the `ItemApiPayloadArray`. + required: + - data + type: object + ItemApiPayloadData: + description: The definition of `ItemApiPayloadData` object. + properties: + attributes: + $ref: '#/components/schemas/ItemApiPayloadDataAttributes' + id: + description: The `ItemApiPayloadData` `id`. + type: string + type: + $ref: '#/components/schemas/ItemApiPayloadDataType' + required: + - type + type: object + ItemApiPayloadDataAttributes: + description: The definition of `ItemApiPayloadDataAttributes` object. + properties: + created_at: + description: The `attributes` `created_at`. + format: date-time + type: string + modified_at: + description: The `attributes` `modified_at`. + format: date-time + type: string + org_id: + description: The `attributes` `org_id`. + format: int64 + type: integer + primary_column_name: + description: The `attributes` `primary_column_name`. + type: string + signature: + description: The `attributes` `signature`. + type: string + store_id: + description: The `attributes` `store_id`. + type: string + value: + $ref: '#/components/schemas/ItemApiPayloadDataAttributesValue' + type: object + ItemApiPayloadDataAttributesValue: + additionalProperties: {} + description: The `attributes` `value`. + type: object + ItemApiPayloadDataType: + default: items + description: Items resource type. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS + ItemApiPayloadMeta: + description: The definition of `ItemApiPayloadMeta` object. + properties: + page: + $ref: '#/components/schemas/ItemApiPayloadMetaPage' + schema: + $ref: '#/components/schemas/ItemApiPayloadMetaSchema' + type: object + ItemApiPayloadMetaPage: + description: The definition of `ItemApiPayloadMetaPage` object. + properties: + hasMore: + description: The `ItemApiPayloadMeta` `hasMore`. + type: boolean + totalCount: + description: The `ItemApiPayloadMeta` `totalCount`. + format: int64 + type: integer + totalFilteredCount: + description: The `ItemApiPayloadMeta` `totalFilteredCount`. + format: int64 + type: integer + type: object + ItemApiPayloadMetaSchema: + description: The definition of `ItemApiPayloadMetaSchema` object. + properties: + fields: + description: The `ItemApiPayloadMetaSchema` `fields`. + items: + $ref: '#/components/schemas/ItemApiPayloadMetaSchemaField' + type: array + primary_key: + description: The `ItemApiPayloadMetaSchema` `primary_key`. + type: string + type: object + ItemApiPayloadMetaSchemaField: + description: The definition of `ItemApiPayloadMetaSchemaField` object. + properties: + name: + description: The `ItemApiPayloadMetaSchemaField` `name`. + example: '' + type: string + type: + description: The `ItemApiPayloadMetaSchemaField` `type`. + example: '' + type: string + required: + - name + - type + type: object + ItemApiPayloadMetaSchemaItem: + description: The definition of `ItemApiPayloadMetaSchemaItem` object. + properties: + name: + description: The `ItemApiPayloadMetaSchemaItem` `name`. + type: string + type: + description: The `ItemApiPayloadMetaSchemaItem` `type`. + type: string + type: object JSONAPIErrorItem: description: API error response body properties: @@ -31947,6 +32482,84 @@ components: data: $ref: '#/components/schemas/Deployment' type: object + PutAppsDatastoreItemRequest: + description: The definition of `PutAppsDatastoreItemRequest` object. + properties: + data: + $ref: '#/components/schemas/PutAppsDatastoreItemRequestData' + type: object + PutAppsDatastoreItemRequestData: + description: The definition of `PutAppsDatastoreItemRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/PutAppsDatastoreItemRequestDataAttributes' + id: + description: The `PutAppsDatastoreItemRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/PutAppsDatastoreItemRequestDataType' + required: + - type + type: object + PutAppsDatastoreItemRequestDataAttributes: + description: The definition of `PutAppsDatastoreItemRequestDataAttributes` object. + properties: + value: + additionalProperties: {} + description: The `attributes` `value`. + example: + data: example data + key: value + type: object + required: + - value + type: object + PutAppsDatastoreItemRequestDataType: + default: items + description: Items resource type. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS + PutAppsDatastoreItemResponse: + description: The definition of `PutAppsDatastoreItemResponse` object. + properties: + data: + $ref: '#/components/schemas/PutAppsDatastoreItemResponseData' + type: object + PutAppsDatastoreItemResponseArray: + description: The definition of `PutAppsDatastoreItemResponseArray` object. + properties: + data: + description: The `PutAppsDatastoreItemResponseArray` `data`. + items: + $ref: '#/components/schemas/PutAppsDatastoreItemResponseData' + type: array + required: + - data + type: object + PutAppsDatastoreItemResponseData: + description: The definition of `PutAppsDatastoreItemResponseData` object. + properties: + id: + description: The `PutAppsDatastoreItemResponseData` `id`. + type: string + type: + $ref: '#/components/schemas/PutAppsDatastoreItemResponseDataType' + required: + - type + type: object + PutAppsDatastoreItemResponseDataType: + default: items + description: Items resource type. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS Query: description: A data query used by an app. This can take the form of an external action, a data transformation, or a state variable. @@ -43552,6 +44165,44 @@ components: type: string type: array type: object + UpdateAppsDatastoreRequest: + description: The definition of `UpdateAppsDatastoreRequest` object. + properties: + data: + $ref: '#/components/schemas/UpdateAppsDatastoreRequestData' + type: object + UpdateAppsDatastoreRequestData: + description: The definition of `UpdateAppsDatastoreRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/UpdateAppsDatastoreRequestDataAttributes' + id: + description: The `UpdateAppsDatastoreRequestData` `id`. + type: string + type: + $ref: '#/components/schemas/UpdateAppsDatastoreRequestDataType' + required: + - type + type: object + UpdateAppsDatastoreRequestDataAttributes: + description: The definition of `UpdateAppsDatastoreRequestDataAttributes` object. + properties: + description: + description: The `attributes` `description`. + type: string + name: + description: The `attributes` `name`. + type: string + type: object + UpdateAppsDatastoreRequestDataType: + default: datastores + description: Datastores resource type. + enum: + - datastores + example: datastores + type: string + x-enum-varnames: + - DATASTORES UpdateCustomFrameworkRequest: description: Request object to update a custom framework. properties: @@ -45493,6 +46144,499 @@ 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' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + 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' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create datastore + tags: + - Actions Datastores + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - apps_datastore_manage + /api/v2/actions-datastores/import: + post: + description: Creates a new datastore and populates it with items from the provided + data. + operationId: CreateDatastoreFromImport + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAppsDatastoreFromImportRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAppsDatastoreFromImportResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create datastore from import + tags: + - Actions Datastores + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - apps_datastore_manage + - apps_datastore_write + /api/v2/actions-datastores/{datastore_id}: + delete: + description: Deletes a datastore by its ID. + operationId: DeleteDatastore + parameters: + - description: The ID of the datastore. + 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 + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: 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 ID of the datastore. + 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' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + 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 ID of the datastore. + 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' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update datastore + tags: + - Actions Datastores + x-codegen-request-body-name: body + 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 ID of the datastore. + 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' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete datastore item + tags: + - Actions Datastores + x-codegen-request-body-name: body + 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. + operationId: ListDatastoreItems + parameters: + - description: The ID of the datastore. + in: path + name: datastore_id + required: true + schema: + type: string + - description: Optional filter to filter the list of items. + in: query + name: filter + schema: + type: string + - description: Optional item key to filter the list of items. + in: query + name: item_key + schema: + type: string + - description: Optional limit to limit the number of items in the list. + in: query + name: page[limit] + schema: + format: int64 + type: integer + - description: Optional offset to offset the list of items. + in: query + name: page[offset] + schema: + format: int64 + type: integer + - description: Optional sort to sort the list of items. + 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' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List datastore items + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_read + post: + description: Creates or replaces an item in a datastore by its key. + operationId: PutDatastoreItem + parameters: + - description: The ID of the datastore. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PutAppsDatastoreItemRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PutAppsDatastoreItemResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Put datastore item + tags: + - Actions Datastores + x-codegen-request-body-name: body + 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: BulkPutDatastoreItems + parameters: + - description: The ID of the datastore. + 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' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Bulk put datastore items + tags: + - Actions Datastores + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - apps_datastore_write /api/v2/actions/app_key_registrations: get: description: List App Key Registrations @@ -68464,6 +69608,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 474d361052..f8730e16bc 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 babda6e4f0..be82b18624 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -2202,6 +2202,34 @@ 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.bulk\_put\_apps\_datastore\_items\_request\_data\_type module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.calculated\_field module ------------------------------------------------------ @@ -4274,6 +4302,118 @@ datadog\_api\_client.v2.model.create\_app\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_apps\_datastore\_from\_import\_request module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_from_import_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_from\_import\_request\_data module +----------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_from_import_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_from\_import\_request\_data\_attributes module +----------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_from\_import\_request\_data\_attributes\_primary\_key\_generation\_strategy module +----------------------------------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_attributes_primary_key_generation_strategy + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_from\_import\_request\_data\_type module +----------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_from\_import\_response module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_from_import_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_from\_import\_response\_data module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_from_import_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_from\_import\_response\_data\_attributes module +------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_from_import_response_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_apps\_datastore\_from\_import\_response\_data\_type module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_from_import_response_data_type + :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\_type module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_request_data_type + :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\_apps\_datastore\_response\_data\_type module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_apps_datastore_response_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_custom\_framework\_request module ----------------------------------------------------------------------- @@ -5317,6 +5457,48 @@ 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\_attributes\_primary\_key\_generation\_strategy module +---------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.datastore_data_attributes_primary_key_generation_strategy + :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.delete\_app\_response module ---------------------------------------------------------- @@ -5331,6 +5513,55 @@ 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\_request\_data\_type module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.delete_apps_datastore_item_request_data_type + :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\_datastore\_item\_response\_data\_type module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.delete_apps_datastore_item_response_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.delete\_apps\_request module ---------------------------------------------------------- @@ -9202,6 +9433,69 @@ datadog\_api\_client.v2.model.ip\_allowlist\_update\_request module :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\_data\_type module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.item_api_payload_data_type + :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 ---------------------------------------------------------------- @@ -14137,6 +14431,62 @@ datadog\_api\_client.v2.model.publish\_app\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.put\_apps\_datastore\_item\_request module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.put_apps_datastore_item_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.put\_apps\_datastore\_item\_request\_data module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.put_apps_datastore_item_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.put\_apps\_datastore\_item\_request\_data\_attributes module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.put_apps_datastore_item_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.put\_apps\_datastore\_item\_request\_data\_type module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.put_apps_datastore_item_request_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.put\_apps\_datastore\_item\_response module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.put_apps_datastore_item_response + :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\_apps\_datastore\_item\_response\_data\_type module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.put_apps_datastore_item_response_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.query module ------------------------------------------ @@ -19359,6 +19709,34 @@ datadog\_api\_client.v2.model.update\_app\_response\_data\_attributes module :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\_apps\_datastore\_request\_data\_type module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.update_apps_datastore_request_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.update\_custom\_framework\_request module ----------------------------------------------------------------------- diff --git a/examples/v2/actions-datastores/BulkPutDatastoreItems.py b/examples/v2/actions-datastores/BulkPutDatastoreItems.py new file mode 100644 index 0000000000..72f850f4d8 --- /dev/null +++ b/examples/v2/actions-datastores/BulkPutDatastoreItems.py @@ -0,0 +1,48 @@ +""" +Bulk put 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.bulk_put_apps_datastore_items_request_data_type import ( + BulkPutAppsDatastoreItemsRequestDataType, +) + +# there is a valid "datastore" in the system +DATASTORE_DATA_ATTRIBUTES_PRIMARY_COLUMN_NAME = environ["DATASTORE_DATA_ATTRIBUTES_PRIMARY_COLUMN_NAME"] +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +body = BulkPutAppsDatastoreItemsRequest( + data=BulkPutAppsDatastoreItemsRequestData( + attributes=BulkPutAppsDatastoreItemsRequestDataAttributes( + values=[ + dict( + [ + ("28173b88-1a0e-001e-28c0-7664b6410518", "key1"), + ("value", "{'data': 'example data 1', 'key': 'value'}"), + ] + ), + dict( + [ + ("28173b88-1a0e-001e-28c0-7664b6410518", "key2"), + ("value", "{'data': 'example data 2', 'key': 'value'}"), + ] + ), + ], + ), + type=BulkPutAppsDatastoreItemsRequestDataType.ITEMS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.bulk_put_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..84b71bf13a --- /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.create_apps_datastore_request_data_type import CreateAppsDatastoreRequestDataType + +body = CreateAppsDatastoreRequest( + data=CreateAppsDatastoreRequestData( + attributes=CreateAppsDatastoreRequestDataAttributes( + name="datastore-name", + primary_column_name="primaryKey", + ), + type=CreateAppsDatastoreRequestDataType.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/CreateDatastoreFromImport.py b/examples/v2/actions-datastores/CreateDatastoreFromImport.py new file mode 100644 index 0000000000..ccf2860377 --- /dev/null +++ b/examples/v2/actions-datastores/CreateDatastoreFromImport.py @@ -0,0 +1,37 @@ +""" +Create datastore from import 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_from_import_request import CreateAppsDatastoreFromImportRequest +from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data import ( + CreateAppsDatastoreFromImportRequestData, +) +from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_attributes import ( + CreateAppsDatastoreFromImportRequestDataAttributes, +) +from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_type import ( + CreateAppsDatastoreFromImportRequestDataType, +) + +body = CreateAppsDatastoreFromImportRequest( + data=CreateAppsDatastoreFromImportRequestData( + attributes=CreateAppsDatastoreFromImportRequestDataAttributes( + name="datastore-name", + primary_column_name="primaryKey", + values=[ + dict([("primaryKey", "key1"), ("value", "{'data': 'example data 1', 'key': 'value'}")]), + dict([("primaryKey", "key2"), ("value", "{'data': 'example data 2', 'key': 'value'}")]), + ], + ), + type=CreateAppsDatastoreFromImportRequestDataType.DATASTORES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.create_datastore_from_import(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..c597f4b48c --- /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 + +# a "datastore" is created in the system +CREATED_DATASTORE_DATA_ID = environ["CREATED_DATASTORE_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + api_instance.delete_datastore( + datastore_id=CREATED_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..5d206f3621 --- /dev/null +++ b/examples/v2/actions-datastores/DeleteDatastoreItem.py @@ -0,0 +1,39 @@ +""" +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.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_request_data_type import ( + DeleteAppsDatastoreItemRequestDataType, +) + +# there is a valid "datastore" in the system +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +# there are valid "datastore items" in the system +DATASTORE_ITEMS_DATA_0_ID = environ["DATASTORE_ITEMS_DATA_0_ID"] + +body = DeleteAppsDatastoreItemRequest( + data=DeleteAppsDatastoreItemRequestData( + attributes=DeleteAppsDatastoreItemRequestDataAttributes( + id=DATASTORE_ITEMS_DATA_0_ID, + item_key="test-key", + ), + type=DeleteAppsDatastoreItemRequestDataType.ITEMS, + id=DATASTORE_DATA_ID, + ), +) + +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..5ce71a0db1 --- /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 + +# a "datastore" is created in the system +CREATED_DATASTORE_DATA_ID = environ["CREATED_DATASTORE_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.get_datastore( + datastore_id=CREATED_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/PutDatastoreItem.py b/examples/v2/actions-datastores/PutDatastoreItem.py new file mode 100644 index 0000000000..e12ffded2e --- /dev/null +++ b/examples/v2/actions-datastores/PutDatastoreItem.py @@ -0,0 +1,36 @@ +""" +Put 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.put_apps_datastore_item_request import PutAppsDatastoreItemRequest +from datadog_api_client.v2.model.put_apps_datastore_item_request_data import PutAppsDatastoreItemRequestData +from datadog_api_client.v2.model.put_apps_datastore_item_request_data_attributes import ( + PutAppsDatastoreItemRequestDataAttributes, +) +from datadog_api_client.v2.model.put_apps_datastore_item_request_data_type import PutAppsDatastoreItemRequestDataType + +# there is a valid "datastore" in the system +DATASTORE_DATA_ATTRIBUTES_PRIMARY_COLUMN_NAME = environ["DATASTORE_DATA_ATTRIBUTES_PRIMARY_COLUMN_NAME"] +DATASTORE_DATA_ID = environ["DATASTORE_DATA_ID"] + +body = PutAppsDatastoreItemRequest( + data=PutAppsDatastoreItemRequestData( + attributes=PutAppsDatastoreItemRequestDataAttributes( + value=dict( + [("28173b88-1a0e-001e-28c0-7664b6410518", "new-item-key"), ("data", "example data"), ("key", "value")] + ), + ), + type=PutAppsDatastoreItemRequestDataType.ITEMS, + id="e7e64418-b60c-4789-9612-895ac8423207", + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionsDatastoresApi(api_client) + response = api_instance.put_datastore_item(datastore_id=DATASTORE_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/actions-datastores/UpdateDatastore.py b/examples/v2/actions-datastores/UpdateDatastore.py new file mode 100644 index 0000000000..06f62b22d5 --- /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.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_apps_datastore_request_data_type import UpdateAppsDatastoreRequestDataType + +# 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=UpdateAppsDatastoreRequestDataType.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/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..7bedeb7d8d --- /dev/null +++ b/src/datadog_api_client/v2/api/actions_datastores_api.py @@ -0,0 +1,503 @@ +# 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.create_apps_datastore_from_import_response import CreateAppsDatastoreFromImportResponse +from datadog_api_client.v2.model.create_apps_datastore_from_import_request import CreateAppsDatastoreFromImportRequest +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.put_apps_datastore_item_response import PutAppsDatastoreItemResponse +from datadog_api_client.v2.model.put_apps_datastore_item_request import PutAppsDatastoreItemRequest +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_put_datastore_items_endpoint = _Endpoint( + settings={ + "response_type": (PutAppsDatastoreItemResponseArray,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/{datastore_id}/items/bulk", + "operation_id": "bulk_put_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._create_datastore_from_import_endpoint = _Endpoint( + settings={ + "response_type": (CreateAppsDatastoreFromImportResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/import", + "operation_id": "create_datastore_from_import", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (CreateAppsDatastoreFromImportRequest,), + "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": { + "openapi_types": (str,), + "attribute": "item_key", + "location": "query", + }, + "page_limit": { + "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._put_datastore_item_endpoint = _Endpoint( + settings={ + "response_type": (PutAppsDatastoreItemResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions-datastores/{datastore_id}/items", + "operation_id": "put_datastore_item", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "datastore_id": { + "required": True, + "openapi_types": (str,), + "attribute": "datastore_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (PutAppsDatastoreItemRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["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, + ) + + def bulk_put_datastore_items( + self, + datastore_id: str, + body: BulkPutAppsDatastoreItemsRequest, + ) -> PutAppsDatastoreItemResponseArray: + """Bulk put datastore items. + + Creates or replaces multiple items in a datastore by their keys in a single operation. + + :param datastore_id: The ID of the datastore. + :type datastore_id: str + :type body: BulkPutAppsDatastoreItemsRequest + :rtype: PutAppsDatastoreItemResponseArray + """ + kwargs: Dict[str, Any] = {} + kwargs["datastore_id"] = datastore_id + + kwargs["body"] = body + + return self._bulk_put_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 create_datastore_from_import( + self, + body: CreateAppsDatastoreFromImportRequest, + ) -> CreateAppsDatastoreFromImportResponse: + """Create datastore from import. + + Creates a new datastore and populates it with items from the provided data. + + :type body: CreateAppsDatastoreFromImportRequest + :rtype: CreateAppsDatastoreFromImportResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_datastore_from_import_endpoint.call_with_http_info(**kwargs) + + def delete_datastore( + self, + datastore_id: str, + ) -> None: + """Delete datastore. + + Deletes a datastore by its ID. + + :param datastore_id: The ID of the datastore. + :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 ID of the datastore. + :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 ID of the datastore. + :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. + + :param datastore_id: The ID of the datastore. + :type datastore_id: str + :param filter: Optional filter to filter the list of items. + :type filter: str, optional + :param item_key: Optional item key to filter the list of items. + :type item_key: str, optional + :param page_limit: Optional limit to limit the number of items in the list. + :type page_limit: int, optional + :param page_offset: Optional offset to offset the list of items. + :type page_offset: int, optional + :param sort: Optional sort to sort the list of items. + :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 put_datastore_item( + self, + datastore_id: str, + body: PutAppsDatastoreItemRequest, + ) -> PutAppsDatastoreItemResponse: + """Put datastore item. + + Creates or replaces an item in a datastore by its key. + + :param datastore_id: The ID of the datastore. + :type datastore_id: str + :type body: PutAppsDatastoreItemRequest + :rtype: PutAppsDatastoreItemResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["datastore_id"] = datastore_id + + kwargs["body"] = body + + return self._put_datastore_item_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 ID of the datastore. + :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) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 8848a8692e..9a1602d0c8 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 @@ -77,6 +78,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..2ff570ed89 --- /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): + """ + The definition of ``BulkPutAppsDatastoreItemsRequest`` object. + + :param data: The definition of ``BulkPutAppsDatastoreItemsRequestData`` object. + :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..3348505a3a --- /dev/null +++ b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_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.bulk_put_apps_datastore_items_request_data_attributes import ( + BulkPutAppsDatastoreItemsRequestDataAttributes, + ) + from datadog_api_client.v2.model.bulk_put_apps_datastore_items_request_data_type import ( + BulkPutAppsDatastoreItemsRequestDataType, + ) + + +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.bulk_put_apps_datastore_items_request_data_type import ( + BulkPutAppsDatastoreItemsRequestDataType, + ) + + return { + "attributes": (BulkPutAppsDatastoreItemsRequestDataAttributes,), + "id": (str,), + "type": (BulkPutAppsDatastoreItemsRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: BulkPutAppsDatastoreItemsRequestDataType, + attributes: Union[BulkPutAppsDatastoreItemsRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``BulkPutAppsDatastoreItemsRequestData`` object. + + :param attributes: The definition of ``BulkPutAppsDatastoreItemsRequestDataAttributes`` object. + :type attributes: BulkPutAppsDatastoreItemsRequestDataAttributes, optional + + :param id: The ``BulkPutAppsDatastoreItemsRequestData`` ``id``. + :type id: str, optional + + :param type: Items resource type. + :type type: BulkPutAppsDatastoreItemsRequestDataType + """ + 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/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..de5118a86b --- /dev/null +++ b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request_data_attributes.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 Any, Dict, List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +class BulkPutAppsDatastoreItemsRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "conflict_mode": (str,), + "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[str, UnsetType] = unset, **kwargs): + """ + The definition of ``BulkPutAppsDatastoreItemsRequestDataAttributes`` object. + + :param conflict_mode: The ``attributes`` ``conflict_mode``. + :type conflict_mode: str, optional + + :param values: The ``attributes`` ``values``. + :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/bulk_put_apps_datastore_items_request_data_type.py b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_request_data_type.py new file mode 100644 index 0000000000..12275fd17c --- /dev/null +++ b/src/datadog_api_client/v2/model/bulk_put_apps_datastore_items_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 BulkPutAppsDatastoreItemsRequestDataType(ModelSimple): + """ + Items resource type. + + :param value: If omitted defaults to "items". Must be one of ["items"]. + :type value: str + """ + + allowed_values = { + "items", + } + ITEMS: ClassVar["BulkPutAppsDatastoreItemsRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +BulkPutAppsDatastoreItemsRequestDataType.ITEMS = BulkPutAppsDatastoreItemsRequestDataType("items") diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request.py b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request.py new file mode 100644 index 0000000000..fd6e275f6d --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_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.create_apps_datastore_from_import_request_data import ( + CreateAppsDatastoreFromImportRequestData, + ) + + +class CreateAppsDatastoreFromImportRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data import ( + CreateAppsDatastoreFromImportRequestData, + ) + + return { + "data": (CreateAppsDatastoreFromImportRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateAppsDatastoreFromImportRequestData, UnsetType] = unset, **kwargs): + """ + The definition of ``CreateAppsDatastoreFromImportRequest`` object. + + :param data: The definition of ``CreateAppsDatastoreFromImportRequestData`` object. + :type data: CreateAppsDatastoreFromImportRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request_data.py b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request_data.py new file mode 100644 index 0000000000..c1a29b1570 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_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.create_apps_datastore_from_import_request_data_attributes import ( + CreateAppsDatastoreFromImportRequestDataAttributes, + ) + from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_type import ( + CreateAppsDatastoreFromImportRequestDataType, + ) + + +class CreateAppsDatastoreFromImportRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_attributes import ( + CreateAppsDatastoreFromImportRequestDataAttributes, + ) + from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_type import ( + CreateAppsDatastoreFromImportRequestDataType, + ) + + return { + "attributes": (CreateAppsDatastoreFromImportRequestDataAttributes,), + "id": (str,), + "type": (CreateAppsDatastoreFromImportRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: CreateAppsDatastoreFromImportRequestDataType, + attributes: Union[CreateAppsDatastoreFromImportRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``CreateAppsDatastoreFromImportRequestData`` object. + + :param attributes: The definition of ``CreateAppsDatastoreFromImportRequestDataAttributes`` object. + :type attributes: CreateAppsDatastoreFromImportRequestDataAttributes, optional + + :param id: The ``CreateAppsDatastoreFromImportRequestData`` ``id``. + :type id: str, optional + + :param type: Datastores resource type. + :type type: CreateAppsDatastoreFromImportRequestDataType + """ + 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_from_import_request_data_attributes.py b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request_data_attributes.py new file mode 100644 index 0000000000..e71e75d8f8 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request_data_attributes.py @@ -0,0 +1,113 @@ +# 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.create_apps_datastore_from_import_request_data_attributes_primary_key_generation_strategy import ( + CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy, + ) + + +class CreateAppsDatastoreFromImportRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_attributes_primary_key_generation_strategy import ( + CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy, + ) + + return { + "description": (str,), + "name": (str,), + "org_access": (str,), + "primary_column_name": (str,), + "primary_key_generation_strategy": ( + CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy, + ), + "values": ( + [ + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + } + ], + ), + } + + attribute_map = { + "description": "description", + "name": "name", + "org_access": "org_access", + "primary_column_name": "primary_column_name", + "primary_key_generation_strategy": "primary_key_generation_strategy", + "values": "values", + } + + def __init__( + self_, + name: str, + primary_column_name: str, + values: List[Dict[str, Any]], + description: Union[str, UnsetType] = unset, + org_access: Union[str, UnsetType] = unset, + primary_key_generation_strategy: Union[ + CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy, UnsetType + ] = unset, + **kwargs, + ): + """ + The definition of ``CreateAppsDatastoreFromImportRequestDataAttributes`` object. + + :param description: The ``attributes`` ``description``. + :type description: str, optional + + :param name: The ``attributes`` ``name``. + :type name: str + + :param org_access: The ``attributes`` ``org_access``. + :type org_access: str, optional + + :param primary_column_name: The ``attributes`` ``primary_column_name``. + :type primary_column_name: str + + :param primary_key_generation_strategy: The ``attributes`` ``primary_key_generation_strategy``. + :type primary_key_generation_strategy: CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy, optional + + :param values: The ``attributes`` ``values``. + :type values: [{str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}] + """ + 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 + self_.values = values diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request_data_attributes_primary_key_generation_strategy.py b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request_data_attributes_primary_key_generation_strategy.py new file mode 100644 index 0000000000..290a632d31 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request_data_attributes_primary_key_generation_strategy.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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy(ModelSimple): + """ + The `attributes` `primary_key_generation_strategy`. + + :param value: Must be one of ["none", "uuid"]. + :type value: str + """ + + allowed_values = { + "none", + "uuid", + } + NONE: ClassVar["CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy"] + UUID: ClassVar["CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy.NONE = ( + CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy("none") +) +CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy.UUID = ( + CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy("uuid") +) diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request_data_type.py b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_request_data_type.py new file mode 100644 index 0000000000..92bc6c193d --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_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 CreateAppsDatastoreFromImportRequestDataType(ModelSimple): + """ + Datastores resource type. + + :param value: If omitted defaults to "datastores". Must be one of ["datastores"]. + :type value: str + """ + + allowed_values = { + "datastores", + } + DATASTORES: ClassVar["CreateAppsDatastoreFromImportRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CreateAppsDatastoreFromImportRequestDataType.DATASTORES = CreateAppsDatastoreFromImportRequestDataType("datastores") diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response.py b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response.py new file mode 100644 index 0000000000..ce8dc9de9c --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response.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.create_apps_datastore_from_import_response_data import ( + CreateAppsDatastoreFromImportResponseData, + ) + + +class CreateAppsDatastoreFromImportResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_from_import_response_data import ( + CreateAppsDatastoreFromImportResponseData, + ) + + return { + "data": (CreateAppsDatastoreFromImportResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateAppsDatastoreFromImportResponseData, UnsetType] = unset, **kwargs): + """ + The definition of ``CreateAppsDatastoreFromImportResponse`` object. + + :param data: The definition of ``CreateAppsDatastoreFromImportResponseData`` object. + :type data: CreateAppsDatastoreFromImportResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response_data.py b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response_data.py new file mode 100644 index 0000000000..9c8bf59135 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response_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.create_apps_datastore_from_import_response_data_attributes import ( + CreateAppsDatastoreFromImportResponseDataAttributes, + ) + from datadog_api_client.v2.model.create_apps_datastore_from_import_response_data_type import ( + CreateAppsDatastoreFromImportResponseDataType, + ) + + +class CreateAppsDatastoreFromImportResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_from_import_response_data_attributes import ( + CreateAppsDatastoreFromImportResponseDataAttributes, + ) + from datadog_api_client.v2.model.create_apps_datastore_from_import_response_data_type import ( + CreateAppsDatastoreFromImportResponseDataType, + ) + + return { + "attributes": (CreateAppsDatastoreFromImportResponseDataAttributes,), + "id": (str,), + "type": (CreateAppsDatastoreFromImportResponseDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: CreateAppsDatastoreFromImportResponseDataType, + attributes: Union[CreateAppsDatastoreFromImportResponseDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``CreateAppsDatastoreFromImportResponseData`` object. + + :param attributes: The definition of ``CreateAppsDatastoreFromImportResponseDataAttributes`` object. + :type attributes: CreateAppsDatastoreFromImportResponseDataAttributes, optional + + :param id: The ``CreateAppsDatastoreFromImportResponseData`` ``id``. + :type id: str, optional + + :param type: Datastores resource type. + :type type: CreateAppsDatastoreFromImportResponseDataType + """ + 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_from_import_response_data_attributes.py b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response_data_attributes.py new file mode 100644 index 0000000000..6b2f78ea85 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response_data_attributes.py @@ -0,0 +1,36 @@ +# 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 CreateAppsDatastoreFromImportResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "item_count": (int,), + } + + attribute_map = { + "item_count": "item_count", + } + + def __init__(self_, item_count: Union[int, UnsetType] = unset, **kwargs): + """ + The definition of ``CreateAppsDatastoreFromImportResponseDataAttributes`` object. + + :param item_count: The ``attributes`` ``item_count``. + :type item_count: int, optional + """ + if item_count is not unset: + kwargs["item_count"] = item_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response_data_type.py b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response_data_type.py new file mode 100644 index 0000000000..a139def98d --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_from_import_response_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 CreateAppsDatastoreFromImportResponseDataType(ModelSimple): + """ + Datastores resource type. + + :param value: If omitted defaults to "datastores". Must be one of ["datastores"]. + :type value: str + """ + + allowed_values = { + "datastores", + } + DATASTORES: ClassVar["CreateAppsDatastoreFromImportResponseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CreateAppsDatastoreFromImportResponseDataType.DATASTORES = CreateAppsDatastoreFromImportResponseDataType("datastores") 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..187579a090 --- /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): + """ + The definition of ``CreateAppsDatastoreRequest`` object. + + :param data: The definition of ``CreateAppsDatastoreRequestData`` object. + :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..8ead470832 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_request_data.py @@ -0,0 +1,70 @@ +# 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.create_apps_datastore_request_data_type import CreateAppsDatastoreRequestDataType + + +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.create_apps_datastore_request_data_type import ( + CreateAppsDatastoreRequestDataType, + ) + + return { + "attributes": (CreateAppsDatastoreRequestDataAttributes,), + "id": (str,), + "type": (CreateAppsDatastoreRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: CreateAppsDatastoreRequestDataType, + attributes: Union[CreateAppsDatastoreRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``CreateAppsDatastoreRequestData`` object. + + :param attributes: The definition of ``CreateAppsDatastoreRequestDataAttributes`` object. + :type attributes: CreateAppsDatastoreRequestDataAttributes, optional + + :param id: The ``CreateAppsDatastoreRequestData`` ``id``. + :type id: str, optional + + :param type: Datastores resource type. + :type type: CreateAppsDatastoreRequestDataType + """ + 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..8ac6a97447 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CreateAppsDatastoreRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "description": (str,), + "name": (str,), + "org_access": (str,), + "primary_column_name": (str,), + "primary_key_generation_strategy": (str,), + } + + 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[str, UnsetType] = unset, + primary_key_generation_strategy: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``CreateAppsDatastoreRequestDataAttributes`` object. + + :param description: The ``attributes`` ``description``. + :type description: str, optional + + :param name: The ``attributes`` ``name``. + :type name: str + + :param org_access: The ``attributes`` ``org_access``. + :type org_access: str, optional + + :param primary_column_name: The ``attributes`` ``primary_column_name``. + :type primary_column_name: str + + :param primary_key_generation_strategy: The ``attributes`` ``primary_key_generation_strategy``. + :type primary_key_generation_strategy: str, 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_type.py b/src/datadog_api_client/v2/model/create_apps_datastore_request_data_type.py new file mode 100644 index 0000000000..805f156322 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_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 CreateAppsDatastoreRequestDataType(ModelSimple): + """ + Datastores resource type. + + :param value: If omitted defaults to "datastores". Must be one of ["datastores"]. + :type value: str + """ + + allowed_values = { + "datastores", + } + DATASTORES: ClassVar["CreateAppsDatastoreRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CreateAppsDatastoreRequestDataType.DATASTORES = CreateAppsDatastoreRequestDataType("datastores") 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..21bffd60ce --- /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): + """ + The definition of ``CreateAppsDatastoreResponse`` object. + + :param data: The definition of ``CreateAppsDatastoreResponseData`` object. + :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..bab7b9d6a9 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_response_data.py @@ -0,0 +1,51 @@ +# 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_type import CreateAppsDatastoreResponseDataType + + +class CreateAppsDatastoreResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_apps_datastore_response_data_type import ( + CreateAppsDatastoreResponseDataType, + ) + + return { + "id": (str,), + "type": (CreateAppsDatastoreResponseDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, type: CreateAppsDatastoreResponseDataType, id: Union[str, UnsetType] = unset, **kwargs): + """ + The definition of ``CreateAppsDatastoreResponseData`` object. + + :param id: The ``CreateAppsDatastoreResponseData`` ``id``. + :type id: str, optional + + :param type: Datastores resource type. + :type type: CreateAppsDatastoreResponseDataType + """ + 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_response_data_type.py b/src/datadog_api_client/v2/model/create_apps_datastore_response_data_type.py new file mode 100644 index 0000000000..d91a1e29e8 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_apps_datastore_response_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 CreateAppsDatastoreResponseDataType(ModelSimple): + """ + Datastores resource type. + + :param value: If omitted defaults to "datastores". Must be one of ["datastores"]. + :type value: str + """ + + allowed_values = { + "datastores", + } + DATASTORES: ClassVar["CreateAppsDatastoreResponseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CreateAppsDatastoreResponseDataType.DATASTORES = CreateAppsDatastoreResponseDataType("datastores") 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..f93b9678fe --- /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): + """ + The definition of ``Datastore`` object. + + :param data: The definition of ``DatastoreData`` object. + :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..39c1a677bb --- /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): + """ + The definition of ``DatastoreArray`` object. + + :param data: The ``DatastoreArray`` ``data``. + :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..b8435a1d15 --- /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, + ): + """ + The definition of ``DatastoreData`` object. + + :param attributes: The definition of ``DatastoreDataAttributes`` object. + :type attributes: DatastoreDataAttributes, optional + + :param id: The ``DatastoreData`` ``id``. + :type id: str, optional + + :param type: Datastores resource type. + :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..ae12ccd432 --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore_data_attributes.py @@ -0,0 +1,115 @@ +# 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_data_attributes_primary_key_generation_strategy import ( + DatastoreDataAttributesPrimaryKeyGenerationStrategy, + ) + + +class DatastoreDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.datastore_data_attributes_primary_key_generation_strategy import ( + DatastoreDataAttributesPrimaryKeyGenerationStrategy, + ) + + 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": (DatastoreDataAttributesPrimaryKeyGenerationStrategy,), + } + + 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[DatastoreDataAttributesPrimaryKeyGenerationStrategy, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``DatastoreDataAttributes`` object. + + :param created_at: The ``attributes`` ``created_at``. + :type created_at: datetime, optional + + :param creator_user_id: The ``attributes`` ``creator_user_id``. + :type creator_user_id: int, optional + + :param creator_user_uuid: The ``attributes`` ``creator_user_uuid``. + :type creator_user_uuid: str, optional + + :param description: The ``attributes`` ``description``. + :type description: str, optional + + :param modified_at: The ``attributes`` ``modified_at``. + :type modified_at: datetime, optional + + :param name: The ``attributes`` ``name``. + :type name: str, optional + + :param org_id: The ``attributes`` ``org_id``. + :type org_id: int, optional + + :param primary_column_name: The ``attributes`` ``primary_column_name``. + :type primary_column_name: str, optional + + :param primary_key_generation_strategy: The ``attributes`` ``primary_key_generation_strategy``. + :type primary_key_generation_strategy: DatastoreDataAttributesPrimaryKeyGenerationStrategy, 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_attributes_primary_key_generation_strategy.py b/src/datadog_api_client/v2/model/datastore_data_attributes_primary_key_generation_strategy.py new file mode 100644 index 0000000000..6672d396c9 --- /dev/null +++ b/src/datadog_api_client/v2/model/datastore_data_attributes_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 DatastoreDataAttributesPrimaryKeyGenerationStrategy(ModelSimple): + """ + The `attributes` `primary_key_generation_strategy`. + + :param value: Must be one of ["none", "uuid"]. + :type value: str + """ + + allowed_values = { + "none", + "uuid", + } + NONE: ClassVar["DatastoreDataAttributesPrimaryKeyGenerationStrategy"] + UUID: ClassVar["DatastoreDataAttributesPrimaryKeyGenerationStrategy"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DatastoreDataAttributesPrimaryKeyGenerationStrategy.NONE = DatastoreDataAttributesPrimaryKeyGenerationStrategy("none") +DatastoreDataAttributesPrimaryKeyGenerationStrategy.UUID = DatastoreDataAttributesPrimaryKeyGenerationStrategy("uuid") 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..0760780bb8 --- /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): + """ + Datastores resource type. + + :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/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..c34dd7c212 --- /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): + """ + The definition of ``DeleteAppsDatastoreItemRequest`` object. + + :param data: The definition of ``DeleteAppsDatastoreItemRequestData`` object. + :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..723681e3b9 --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_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.delete_apps_datastore_item_request_data_attributes import ( + DeleteAppsDatastoreItemRequestDataAttributes, + ) + from datadog_api_client.v2.model.delete_apps_datastore_item_request_data_type import ( + DeleteAppsDatastoreItemRequestDataType, + ) + + +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.delete_apps_datastore_item_request_data_type import ( + DeleteAppsDatastoreItemRequestDataType, + ) + + return { + "attributes": (DeleteAppsDatastoreItemRequestDataAttributes,), + "id": (str,), + "type": (DeleteAppsDatastoreItemRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: DeleteAppsDatastoreItemRequestDataType, + attributes: Union[DeleteAppsDatastoreItemRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``DeleteAppsDatastoreItemRequestData`` object. + + :param attributes: The definition of ``DeleteAppsDatastoreItemRequestDataAttributes`` object. + :type attributes: DeleteAppsDatastoreItemRequestDataAttributes, optional + + :param id: The ``DeleteAppsDatastoreItemRequestData`` ``id``. + :type id: str, optional + + :param type: Items resource type. + :type type: DeleteAppsDatastoreItemRequestDataType + """ + 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/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..300e49d617 --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_apps_datastore_item_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 DeleteAppsDatastoreItemRequestDataAttributes(ModelNormal): + @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): + """ + The definition of ``DeleteAppsDatastoreItemRequestDataAttributes`` object. + + :param id: The ``item`` ``id``. + :type id: str, optional + + :param item_key: The ``attributes`` ``item_key``. + :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_request_data_type.py b/src/datadog_api_client/v2/model/delete_apps_datastore_item_request_data_type.py new file mode 100644 index 0000000000..bcff31427f --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_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 DeleteAppsDatastoreItemRequestDataType(ModelSimple): + """ + Items resource type. + + :param value: If omitted defaults to "items". Must be one of ["items"]. + :type value: str + """ + + allowed_values = { + "items", + } + ITEMS: ClassVar["DeleteAppsDatastoreItemRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeleteAppsDatastoreItemRequestDataType.ITEMS = DeleteAppsDatastoreItemRequestDataType("items") 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..d9b6695ff8 --- /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): + """ + The definition of ``DeleteAppsDatastoreItemResponse`` object. + + :param data: The definition of ``DeleteAppsDatastoreItemResponseData`` object. + :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..e4efaa8e04 --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_apps_datastore_item_response_data.py @@ -0,0 +1,53 @@ +# 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_type import ( + DeleteAppsDatastoreItemResponseDataType, + ) + + +class DeleteAppsDatastoreItemResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.delete_apps_datastore_item_response_data_type import ( + DeleteAppsDatastoreItemResponseDataType, + ) + + return { + "id": (str,), + "type": (DeleteAppsDatastoreItemResponseDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, type: DeleteAppsDatastoreItemResponseDataType, id: Union[str, UnsetType] = unset, **kwargs): + """ + The definition of ``DeleteAppsDatastoreItemResponseData`` object. + + :param id: The ``DeleteAppsDatastoreItemResponseData`` ``id``. + :type id: str, optional + + :param type: Items resource type. + :type type: DeleteAppsDatastoreItemResponseDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/delete_apps_datastore_item_response_data_type.py b/src/datadog_api_client/v2/model/delete_apps_datastore_item_response_data_type.py new file mode 100644 index 0000000000..635324571b --- /dev/null +++ b/src/datadog_api_client/v2/model/delete_apps_datastore_item_response_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 DeleteAppsDatastoreItemResponseDataType(ModelSimple): + """ + Items resource type. + + :param value: If omitted defaults to "items". Must be one of ["items"]. + :type value: str + """ + + allowed_values = { + "items", + } + ITEMS: ClassVar["DeleteAppsDatastoreItemResponseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeleteAppsDatastoreItemResponseDataType.ITEMS = DeleteAppsDatastoreItemResponseDataType("items") 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..0813fb87e8 --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_array.py @@ -0,0 +1,51 @@ +# 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): + @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): + """ + The definition of ``ItemApiPayloadArray`` object. + + :param data: The ``ItemApiPayloadArray`` ``data``. + :type data: [ItemApiPayloadData] + + :param meta: The definition of ``ItemApiPayloadMeta`` object. + :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..062b57bf5f --- /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.item_api_payload_data_type import ItemApiPayloadDataType + + +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.item_api_payload_data_type import ItemApiPayloadDataType + + return { + "attributes": (ItemApiPayloadDataAttributes,), + "id": (str,), + "type": (ItemApiPayloadDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: ItemApiPayloadDataType, + attributes: Union[ItemApiPayloadDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``ItemApiPayloadData`` object. + + :param attributes: The definition of ``ItemApiPayloadDataAttributes`` object. + :type attributes: ItemApiPayloadDataAttributes, optional + + :param id: The ``ItemApiPayloadData`` ``id``. + :type id: str, optional + + :param type: Items resource type. + :type type: ItemApiPayloadDataType + """ + 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..c8de78ae8d --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_data_attributes.py @@ -0,0 +1,95 @@ +# 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): + @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, + ): + """ + The definition of ``ItemApiPayloadDataAttributes`` object. + + :param created_at: The ``attributes`` ``created_at``. + :type created_at: datetime, optional + + :param modified_at: The ``attributes`` ``modified_at``. + :type modified_at: datetime, optional + + :param org_id: The ``attributes`` ``org_id``. + :type org_id: int, optional + + :param primary_column_name: The ``attributes`` ``primary_column_name``. + :type primary_column_name: str, optional + + :param signature: The ``attributes`` ``signature``. + :type signature: str, optional + + :param store_id: The ``attributes`` ``store_id``. + :type store_id: str, optional + + :param value: The ``attributes`` ``value``. + :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..c3cb17adfa --- /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 ``attributes`` ``value``. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/item_api_payload_data_type.py b/src/datadog_api_client/v2/model/item_api_payload_data_type.py new file mode 100644 index 0000000000..e46764cfa5 --- /dev/null +++ b/src/datadog_api_client/v2/model/item_api_payload_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 ItemApiPayloadDataType(ModelSimple): + """ + Items resource type. + + :param value: If omitted defaults to "items". Must be one of ["items"]. + :type value: str + """ + + allowed_values = { + "items", + } + ITEMS: ClassVar["ItemApiPayloadDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ItemApiPayloadDataType.ITEMS = ItemApiPayloadDataType("items") 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..13b160fc0e --- /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, + ): + """ + The definition of ``ItemApiPayloadMeta`` object. + + :param page: The definition of ``ItemApiPayloadMetaPage`` object. + :type page: ItemApiPayloadMetaPage, optional + + :param schema: The definition of ``ItemApiPayloadMetaSchema`` object. + :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..17f9988083 --- /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, + ): + """ + The definition of ``ItemApiPayloadMetaPage`` object. + + :param has_more: The ``ItemApiPayloadMeta`` ``hasMore``. + :type has_more: bool, optional + + :param total_count: The ``ItemApiPayloadMeta`` ``totalCount``. + :type total_count: int, optional + + :param total_filtered_count: The ``ItemApiPayloadMeta`` ``totalFilteredCount``. + :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..67c2a332ac --- /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, + ): + """ + The definition of ``ItemApiPayloadMetaSchema`` object. + + :param fields: The ``ItemApiPayloadMetaSchema`` ``fields``. + :type fields: [ItemApiPayloadMetaSchemaField], optional + + :param primary_key: The ``ItemApiPayloadMetaSchema`` ``primary_key``. + :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..546e870511 --- /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): + """ + The definition of ``ItemApiPayloadMetaSchemaField`` object. + + :param name: The ``ItemApiPayloadMetaSchemaField`` ``name``. + :type name: str + + :param type: The ``ItemApiPayloadMetaSchemaField`` ``type``. + :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_request.py b/src/datadog_api_client/v2/model/put_apps_datastore_item_request.py new file mode 100644 index 0000000000..661f3c197e --- /dev/null +++ b/src/datadog_api_client/v2/model/put_apps_datastore_item_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.put_apps_datastore_item_request_data import PutAppsDatastoreItemRequestData + + +class PutAppsDatastoreItemRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.put_apps_datastore_item_request_data import PutAppsDatastoreItemRequestData + + return { + "data": (PutAppsDatastoreItemRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[PutAppsDatastoreItemRequestData, UnsetType] = unset, **kwargs): + """ + The definition of ``PutAppsDatastoreItemRequest`` object. + + :param data: The definition of ``PutAppsDatastoreItemRequestData`` object. + :type data: PutAppsDatastoreItemRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/put_apps_datastore_item_request_data.py b/src/datadog_api_client/v2/model/put_apps_datastore_item_request_data.py new file mode 100644 index 0000000000..f6138986bf --- /dev/null +++ b/src/datadog_api_client/v2/model/put_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.put_apps_datastore_item_request_data_attributes import ( + PutAppsDatastoreItemRequestDataAttributes, + ) + from datadog_api_client.v2.model.put_apps_datastore_item_request_data_type import ( + PutAppsDatastoreItemRequestDataType, + ) + + +class PutAppsDatastoreItemRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.put_apps_datastore_item_request_data_attributes import ( + PutAppsDatastoreItemRequestDataAttributes, + ) + from datadog_api_client.v2.model.put_apps_datastore_item_request_data_type import ( + PutAppsDatastoreItemRequestDataType, + ) + + return { + "attributes": (PutAppsDatastoreItemRequestDataAttributes,), + "id": (str,), + "type": (PutAppsDatastoreItemRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: PutAppsDatastoreItemRequestDataType, + attributes: Union[PutAppsDatastoreItemRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``PutAppsDatastoreItemRequestData`` object. + + :param attributes: The definition of ``PutAppsDatastoreItemRequestDataAttributes`` object. + :type attributes: PutAppsDatastoreItemRequestDataAttributes, optional + + :param id: The ``PutAppsDatastoreItemRequestData`` ``id``. + :type id: str, optional + + :param type: Items resource type. + :type type: PutAppsDatastoreItemRequestDataType + """ + 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/put_apps_datastore_item_request_data_attributes.py b/src/datadog_api_client/v2/model/put_apps_datastore_item_request_data_attributes.py new file mode 100644 index 0000000000..ab5b6af443 --- /dev/null +++ b/src/datadog_api_client/v2/model/put_apps_datastore_item_request_data_attributes.py @@ -0,0 +1,53 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + UUID, +) + + +class PutAppsDatastoreItemRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "value": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + } + + attribute_map = { + "value": "value", + } + + def __init__(self_, value: Dict[str, Any], **kwargs): + """ + The definition of ``PutAppsDatastoreItemRequestDataAttributes`` object. + + :param value: The ``attributes`` ``value``. + :type value: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)} + """ + super().__init__(kwargs) + + self_.value = value diff --git a/src/datadog_api_client/v2/model/put_apps_datastore_item_request_data_type.py b/src/datadog_api_client/v2/model/put_apps_datastore_item_request_data_type.py new file mode 100644 index 0000000000..d219b01bf1 --- /dev/null +++ b/src/datadog_api_client/v2/model/put_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 PutAppsDatastoreItemRequestDataType(ModelSimple): + """ + Items resource type. + + :param value: If omitted defaults to "items". Must be one of ["items"]. + :type value: str + """ + + allowed_values = { + "items", + } + ITEMS: ClassVar["PutAppsDatastoreItemRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PutAppsDatastoreItemRequestDataType.ITEMS = PutAppsDatastoreItemRequestDataType("items") diff --git a/src/datadog_api_client/v2/model/put_apps_datastore_item_response.py b/src/datadog_api_client/v2/model/put_apps_datastore_item_response.py new file mode 100644 index 0000000000..7deba328ec --- /dev/null +++ b/src/datadog_api_client/v2/model/put_apps_datastore_item_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.put_apps_datastore_item_response_data import PutAppsDatastoreItemResponseData + + +class PutAppsDatastoreItemResponse(ModelNormal): + @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: Union[PutAppsDatastoreItemResponseData, UnsetType] = unset, **kwargs): + """ + The definition of ``PutAppsDatastoreItemResponse`` object. + + :param data: The definition of ``PutAppsDatastoreItemResponseData`` object. + :type data: PutAppsDatastoreItemResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) 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..dc7e02d5dc --- /dev/null +++ b/src/datadog_api_client/v2/model/put_apps_datastore_item_response_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.put_apps_datastore_item_response_data import PutAppsDatastoreItemResponseData + + +class PutAppsDatastoreItemResponseArray(ModelNormal): + @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): + """ + The definition of ``PutAppsDatastoreItemResponseArray`` object. + + :param data: The ``PutAppsDatastoreItemResponseArray`` ``data``. + :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..2f08b324fd --- /dev/null +++ b/src/datadog_api_client/v2/model/put_apps_datastore_item_response_data.py @@ -0,0 +1,53 @@ +# 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.put_apps_datastore_item_response_data_type import ( + PutAppsDatastoreItemResponseDataType, + ) + + +class PutAppsDatastoreItemResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.put_apps_datastore_item_response_data_type import ( + PutAppsDatastoreItemResponseDataType, + ) + + return { + "id": (str,), + "type": (PutAppsDatastoreItemResponseDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, type: PutAppsDatastoreItemResponseDataType, id: Union[str, UnsetType] = unset, **kwargs): + """ + The definition of ``PutAppsDatastoreItemResponseData`` object. + + :param id: The ``PutAppsDatastoreItemResponseData`` ``id``. + :type id: str, optional + + :param type: Items resource type. + :type type: PutAppsDatastoreItemResponseDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/put_apps_datastore_item_response_data_type.py b/src/datadog_api_client/v2/model/put_apps_datastore_item_response_data_type.py new file mode 100644 index 0000000000..45865a7742 --- /dev/null +++ b/src/datadog_api_client/v2/model/put_apps_datastore_item_response_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 PutAppsDatastoreItemResponseDataType(ModelSimple): + """ + Items resource type. + + :param value: If omitted defaults to "items". Must be one of ["items"]. + :type value: str + """ + + allowed_values = { + "items", + } + ITEMS: ClassVar["PutAppsDatastoreItemResponseDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PutAppsDatastoreItemResponseDataType.ITEMS = PutAppsDatastoreItemResponseDataType("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..54a9c872aa --- /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): + """ + The definition of ``UpdateAppsDatastoreRequest`` object. + + :param data: The definition of ``UpdateAppsDatastoreRequestData`` object. + :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..24afe21adb --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_request_data.py @@ -0,0 +1,70 @@ +# 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.update_apps_datastore_request_data_type import UpdateAppsDatastoreRequestDataType + + +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.update_apps_datastore_request_data_type import ( + UpdateAppsDatastoreRequestDataType, + ) + + return { + "attributes": (UpdateAppsDatastoreRequestDataAttributes,), + "id": (str,), + "type": (UpdateAppsDatastoreRequestDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: UpdateAppsDatastoreRequestDataType, + attributes: Union[UpdateAppsDatastoreRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``UpdateAppsDatastoreRequestData`` object. + + :param attributes: The definition of ``UpdateAppsDatastoreRequestDataAttributes`` object. + :type attributes: UpdateAppsDatastoreRequestDataAttributes, optional + + :param id: The ``UpdateAppsDatastoreRequestData`` ``id``. + :type id: str, optional + + :param type: Datastores resource type. + :type type: UpdateAppsDatastoreRequestDataType + """ + 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..bb07cdeb7c --- /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): + """ + The definition of ``UpdateAppsDatastoreRequestDataAttributes`` object. + + :param description: The ``attributes`` ``description``. + :type description: str, optional + + :param name: The ``attributes`` ``name``. + :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/model/update_apps_datastore_request_data_type.py b/src/datadog_api_client/v2/model/update_apps_datastore_request_data_type.py new file mode 100644 index 0000000000..99a10505a7 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_apps_datastore_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 UpdateAppsDatastoreRequestDataType(ModelSimple): + """ + Datastores resource type. + + :param value: If omitted defaults to "datastores". Must be one of ["datastores"]. + :type value: str + """ + + allowed_values = { + "datastores", + } + DATASTORES: ClassVar["UpdateAppsDatastoreRequestDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UpdateAppsDatastoreRequestDataType.DATASTORES = UpdateAppsDatastoreRequestDataType("datastores") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 1a7fb45edf..93f34d2d9f 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -401,6 +401,14 @@ 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.bulk_put_apps_datastore_items_request_data_type import ( + BulkPutAppsDatastoreItemsRequestDataType, +) 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 ( @@ -790,6 +798,38 @@ 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_from_import_request import CreateAppsDatastoreFromImportRequest +from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data import ( + CreateAppsDatastoreFromImportRequestData, +) +from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_attributes import ( + CreateAppsDatastoreFromImportRequestDataAttributes, +) +from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_attributes_primary_key_generation_strategy import ( + CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy, +) +from datadog_api_client.v2.model.create_apps_datastore_from_import_request_data_type import ( + CreateAppsDatastoreFromImportRequestDataType, +) +from datadog_api_client.v2.model.create_apps_datastore_from_import_response import CreateAppsDatastoreFromImportResponse +from datadog_api_client.v2.model.create_apps_datastore_from_import_response_data import ( + CreateAppsDatastoreFromImportResponseData, +) +from datadog_api_client.v2.model.create_apps_datastore_from_import_response_data_attributes import ( + CreateAppsDatastoreFromImportResponseDataAttributes, +) +from datadog_api_client.v2.model.create_apps_datastore_from_import_response_data_type import ( + CreateAppsDatastoreFromImportResponseDataType, +) +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_type import CreateAppsDatastoreRequestDataType +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_apps_datastore_response_data_type import CreateAppsDatastoreResponseDataType 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 @@ -1049,8 +1089,29 @@ from datadog_api_client.v2.model.dataset_response_multi import DatasetResponseMulti from datadog_api_client.v2.model.dataset_response_single import DatasetResponseSingle 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_attributes_primary_key_generation_strategy import ( + DatastoreDataAttributesPrimaryKeyGenerationStrategy, +) +from datadog_api_client.v2.model.datastore_data_type import DatastoreDataType 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_request_data_type import ( + DeleteAppsDatastoreItemRequestDataType, +) +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_datastore_item_response_data_type import ( + DeleteAppsDatastoreItemResponseDataType, +) 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 @@ -1673,6 +1734,15 @@ from datadog_api_client.v2.model.intake_payload_accepted import IntakePayloadAccepted from datadog_api_client.v2.model.interface_attributes import InterfaceAttributes from datadog_api_client.v2.model.interface_attributes_status import InterfaceAttributesStatus +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_data_type import ItemApiPayloadDataType +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 @@ -2829,6 +2899,16 @@ 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_request import PutAppsDatastoreItemRequest +from datadog_api_client.v2.model.put_apps_datastore_item_request_data import PutAppsDatastoreItemRequestData +from datadog_api_client.v2.model.put_apps_datastore_item_request_data_attributes import ( + PutAppsDatastoreItemRequestDataAttributes, +) +from datadog_api_client.v2.model.put_apps_datastore_item_request_data_type import PutAppsDatastoreItemRequestDataType +from datadog_api_client.v2.model.put_apps_datastore_item_response import PutAppsDatastoreItemResponse +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_apps_datastore_item_response_data_type import PutAppsDatastoreItemResponseDataType from datadog_api_client.v2.model.query import Query from datadog_api_client.v2.model.query_formula import QueryFormula from datadog_api_client.v2.model.query_sort_order import QuerySortOrder @@ -3778,6 +3858,12 @@ 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_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_apps_datastore_request_data_type import UpdateAppsDatastoreRequestDataType 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 @@ -4241,6 +4327,10 @@ "BulkMuteFindingsRequestProperties", "BulkMuteFindingsResponse", "BulkMuteFindingsResponseData", + "BulkPutAppsDatastoreItemsRequest", + "BulkPutAppsDatastoreItemsRequestData", + "BulkPutAppsDatastoreItemsRequestDataAttributes", + "BulkPutAppsDatastoreItemsRequestDataType", "CIAppAggregateBucketValue", "CIAppAggregateBucketValueTimeseries", "CIAppAggregateBucketValueTimeseriesPoint", @@ -4540,6 +4630,22 @@ "CreateAppRequestDataAttributes", "CreateAppResponse", "CreateAppResponseData", + "CreateAppsDatastoreFromImportRequest", + "CreateAppsDatastoreFromImportRequestData", + "CreateAppsDatastoreFromImportRequestDataAttributes", + "CreateAppsDatastoreFromImportRequestDataAttributesPrimaryKeyGenerationStrategy", + "CreateAppsDatastoreFromImportRequestDataType", + "CreateAppsDatastoreFromImportResponse", + "CreateAppsDatastoreFromImportResponseData", + "CreateAppsDatastoreFromImportResponseDataAttributes", + "CreateAppsDatastoreFromImportResponseDataType", + "CreateAppsDatastoreRequest", + "CreateAppsDatastoreRequestData", + "CreateAppsDatastoreRequestDataAttributes", + "CreateAppsDatastoreRequestDataType", + "CreateAppsDatastoreResponse", + "CreateAppsDatastoreResponseData", + "CreateAppsDatastoreResponseDataType", "CreateCustomFrameworkRequest", "CreateCustomFrameworkResponse", "CreateDataDeletionRequestBody", @@ -4711,8 +4817,21 @@ "DatasetResponseMulti", "DatasetResponseSingle", "DatasetUpdateRequest", + "Datastore", + "DatastoreArray", + "DatastoreData", + "DatastoreDataAttributes", + "DatastoreDataAttributesPrimaryKeyGenerationStrategy", + "DatastoreDataType", "DeleteAppResponse", "DeleteAppResponseData", + "DeleteAppsDatastoreItemRequest", + "DeleteAppsDatastoreItemRequestData", + "DeleteAppsDatastoreItemRequestDataAttributes", + "DeleteAppsDatastoreItemRequestDataType", + "DeleteAppsDatastoreItemResponse", + "DeleteAppsDatastoreItemResponseData", + "DeleteAppsDatastoreItemResponseDataType", "DeleteAppsRequest", "DeleteAppsRequestDataItems", "DeleteAppsResponse", @@ -5243,6 +5362,15 @@ "IntakePayloadAccepted", "InterfaceAttributes", "InterfaceAttributesStatus", + "ItemApiPayloadArray", + "ItemApiPayloadData", + "ItemApiPayloadDataAttributes", + "ItemApiPayloadDataAttributesValue", + "ItemApiPayloadDataType", + "ItemApiPayloadMeta", + "ItemApiPayloadMetaPage", + "ItemApiPayloadMetaSchema", + "ItemApiPayloadMetaSchemaField", "JSONAPIErrorItem", "JSONAPIErrorItemSource", "JSONAPIErrorResponse", @@ -5949,6 +6077,14 @@ "ProjectedCostType", "ProjectsResponse", "PublishAppResponse", + "PutAppsDatastoreItemRequest", + "PutAppsDatastoreItemRequestData", + "PutAppsDatastoreItemRequestDataAttributes", + "PutAppsDatastoreItemRequestDataType", + "PutAppsDatastoreItemResponse", + "PutAppsDatastoreItemResponseArray", + "PutAppsDatastoreItemResponseData", + "PutAppsDatastoreItemResponseDataType", "Query", "QueryFormula", "QuerySortOrder", @@ -6700,6 +6836,10 @@ "UpdateAppResponse", "UpdateAppResponseData", "UpdateAppResponseDataAttributes", + "UpdateAppsDatastoreRequest", + "UpdateAppsDatastoreRequestData", + "UpdateAppsDatastoreRequestDataAttributes", + "UpdateAppsDatastoreRequestDataType", "UpdateCustomFrameworkRequest", "UpdateCustomFrameworkResponse", "UpdateOpenAPIResponse", diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_bad_request_response.frozen new file mode 100644 index 0000000000..ff32017a5e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:18:59.568Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_bad_request_response.yaml new file mode 100644 index 0000000000..9b94eae328 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_bad_request_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":"2311c2ef-1448-4dad-a67a-53cb3ea678be","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/2311c2ef-1448-4dad-a67a-53cb3ea678be + response: + body: + string: '{"data":{"id":"2311c2ef-1448-4dad-a67a-53cb3ea678be","type":"datastores","attributes":{"created_at":"2025-08-11T22:18:59.68687Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T22:18:59.68687Z","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: '{"data":{"attributes":{"values":[{"id":"key1","value":{"data":"example + data 1","key":"value"}},{"badPrimaryKey":"key2","value":{"data":"example data + 2","key":"value"}}]},"id":"2311c2ef-1448-4dad-a67a-53cb3ea678be","type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/2311c2ef-1448-4dad-a67a-53cb3ea678be/items/bulk + response: + body: + string: '{"errors":[{"title":"item key missing or invalid","detail":"item at + index 1: 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/2311c2ef-1448-4dad-a67a-53cb3ea678be + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_not_found_response.frozen new file mode 100644 index 0000000000..3e8630a51e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:00.202Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_not_found_response.yaml new file mode 100644 index 0000000000..c9b28c88bf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"values":[{"primaryKey":"key1","value":{"data":"example + data 1","key":"value"}},{"primaryKey":"key2","value":{"data":"example data 2","key":"value"}}]},"id":"70b87c26-886f-497a-bd9d-09f53bc9b40c","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":[{"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_put_datastore_items_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_ok_response.frozen new file mode 100644 index 0000000000..c4603f77e3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:00.383Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_bulk_put_datastore_items_returns_ok_response.yaml new file mode 100644 index 0000000000..228333f347 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_bulk_put_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":"d0b1264c-fc7f-4b8c-855e-ef7c433efe6f","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/d0b1264c-fc7f-4b8c-855e-ef7c433efe6f + response: + body: + string: '{"data":{"id":"d0b1264c-fc7f-4b8c-855e-ef7c433efe6f","type":"datastores","attributes":{"created_at":"2025-08-11T22:19:00.513238Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T22:19:00.513238Z","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: '{"data":{"attributes":{"values":[{"id":"key1","value":{"data":"example + data 1","key":"value"}},{"id":"key2","value":{"data":"example data 2","key":"value"}}]},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/d0b1264c-fc7f-4b8c-855e-ef7c433efe6f/items/bulk + response: + body: + string: '{"data":[{"id":"a74b5936-79bf-43b4-b319-1f28357e72df","type":"items"},{"id":"cc12cffb-d035-4241-979a-e7ad9fe6b148","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/d0b1264c-fc7f-4b8c-855e-ef7c433efe6f + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_bad_request_response.frozen new file mode 100644 index 0000000000..68db3d09f9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:00.998Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_bad_request_response.yaml new file mode 100644 index 0000000000..af74b5ec17 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_bad_request_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"datastore-name","primary_column_name":"0invalid_name","values":[{"primaryKey":"key1","value":{"data":"example + data 1","key":"value"}},{"primaryKey":"key2","value":{"data":"example data 2","key":"value"}}]},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/import + response: + body: + string: '{"errors":[{"title":"invalid column name","detail":"column name ''0invalid_name'' + does not start with a letter or an underscore","source":{"pointer":"/data/attributes/primary_column_name"}}]}' + 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_from_import_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_ok_response.frozen new file mode 100644 index 0000000000..cbd8bbb1f9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:01.153Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_ok_response.yaml new file mode 100644 index 0000000000..6659304518 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_from_import_returns_ok_response.yaml @@ -0,0 +1,35 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"datastore-name","primary_column_name":"primaryKey","values":[{"primaryKey":"key1","value":{"data":"example + data 1","key":"value"}},{"primaryKey":"key2","value":{"data":"example data 2","key":"value"}}]},"type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/import + response: + body: + string: '{"data":{"id":"cd30ef44-0088-43ac-925b-01f13f55b5ed","type":"datastores","attributes":{"item_count":2}}}' + 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/cd30ef44-0088-43ac-925b-01f13f55b5ed + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +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..13136b6d0d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:01.482Z \ 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..18d7011797 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +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":[{"title":"invalid column name","detail":"column name ''0invalid_key'' + does not start with a letter or an underscore","source":{"pointer":"/data/attributes/primary_column_name"}}]}' + 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..eb481cb130 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:01.620Z \ 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..ef96d76d04 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_datastore_returns_ok_response.yaml @@ -0,0 +1,34 @@ +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":"d57621df-a245-47e0-af1c-fb5aa84b113c","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/d57621df-a245-47e0-af1c-fb5aa84b113c + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +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..852d842645 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:01.936Z \ 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..02af7f1ada --- /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"},"id":"invalid-uuid","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":[{"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..3cf5d0bc6b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:02.086Z \ 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..6709be0ed9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_not_found_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"attributes":{"item_key":"primaryKey"},"id":"70b87c26-886f-497a-bd9d-09f53bc9b40c","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":[{"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..c0df22f8d9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:02.248Z \ 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..d909004a65 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_item_returns_ok_response.yaml @@ -0,0 +1,103 @@ +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":"74103e72-83a1-483a-82a0-ece193df3352","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/74103e72-83a1-483a-82a0-ece193df3352 + response: + body: + string: '{"data":{"id":"74103e72-83a1-483a-82a0-ece193df3352","type":"datastores","attributes":{"created_at":"2025-08-11T22:19:02.37855Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T22:19:02.37855Z","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: '{"data":{"attributes":{"value":{"data":"test-value","id":"test-key"}},"id":"74103e72-83a1-483a-82a0-ece193df3352","type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/74103e72-83a1-483a-82a0-ece193df3352/items + response: + body: + string: '{"data":{"id":"48241ef8-650f-494e-93f5-da1414376efe","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/74103e72-83a1-483a-82a0-ece193df3352/items + response: + body: + string: '{"data":[{"id":"48241ef8-650f-494e-93f5-da1414376efe","type":"items","attributes":{"created_at":"2025-08-11T22:19:02.680284Z","modified_at":"2025-08-11T22:19:02.680284Z","org_id":321813,"primary_column_name":"id","signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"3Sh//jFQJZ+uhUOwvHL8krXnbOjEFxMZrYnngo8J/AY=\\\",\\\"timestamp\\\":1754950742,\\\"proof\\\":\\\"MGYCMQC5kVpFCj7klWkFz2lhtv8aTE7OrYX2onKe4KIOKVjKdHDffVByBTZ2QtRr5ABr7kICMQDi+4pLo2jMvTWYWWC9cd17cmkvgMEciB0Jb9NWNaNMae4ny+xyObi2r2NPEDCp3Os=\\\"}\",\"version\":1}","store_id":"74103e72-83a1-483a-82a0-ece193df3352","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: '{"data":{"attributes":{"id":"48241ef8-650f-494e-93f5-da1414376efe","item_key":"test-key"},"id":"74103e72-83a1-483a-82a0-ece193df3352","type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/74103e72-83a1-483a-82a0-ece193df3352/items + response: + body: + string: '{"data":{"id":"48241ef8-650f-494e-93f5-da1414376efe","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/74103e72-83a1-483a-82a0-ece193df3352 + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +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..e9de010d70 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:03.140Z \ 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..821519a16d --- /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":[{"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..54d819a128 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-13T19:04:54.910Z \ 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..fd38a6c697 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_datastore_returns_ok_response.yaml @@ -0,0 +1,50 @@ +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":"f12a6a3b-ee1a-4388-a47b-d4aae4988a45","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/f12a6a3b-ee1a-4388-a47b-d4aae4988a45 + response: + body: + string: '{"data":{"id":"f12a6a3b-ee1a-4388-a47b-d4aae4988a45","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/f12a6a3b-ee1a-4388-a47b-d4aae4988a45 + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +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..7e5c67e915 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:03.850Z \ 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..05da6be09b --- /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":[{"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..e57c51b90b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:03.960Z \ 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..01372f2401 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +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":[{"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..400bb39c91 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:04.095Z \ 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..e193b6315c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_datastore_returns_ok_response.yaml @@ -0,0 +1,51 @@ +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":"0aeda3c9-fa45-4e5a-bb06-69c73b18e36a","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/0aeda3c9-fa45-4e5a-bb06-69c73b18e36a + response: + body: + string: '{"data":{"id":"0aeda3c9-fa45-4e5a-bb06-69c73b18e36a","type":"datastores","attributes":{"created_at":"2025-08-11T22:19:04.208564Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T22:19:04.208564Z","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/0aeda3c9-fa45-4e5a-bb06-69c73b18e36a + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +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..d8f0024855 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:04.532Z \ 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..e4cfe5d3e1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_bad_request_response.yaml @@ -0,0 +1,51 @@ +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":"ddb41c1d-51d8-4975-94b4-261e659dec74","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/invalid-uuid/items + response: + body: + string: '{"errors":[{"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 +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/ddb41c1d-51d8-4975-94b4-261e659dec74 + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +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..e2e9db5d4d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:04.951Z \ 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..562bb15c5a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +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":[{"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..d43a22a7f2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:05.094Z \ 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..9cf7a4341d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastore_items_returns_ok_response.yaml @@ -0,0 +1,101 @@ +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":"750ca6cd-e032-451f-91c5-be07a26ed420","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/750ca6cd-e032-451f-91c5-be07a26ed420 + response: + body: + string: '{"data":{"id":"750ca6cd-e032-451f-91c5-be07a26ed420","type":"datastores","attributes":{"created_at":"2025-08-11T22:19:05.19296Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T22:19:05.19296Z","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: '{"data":{"attributes":{"value":{"data":"test-value","id":"test-key"}},"id":"750ca6cd-e032-451f-91c5-be07a26ed420","type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/750ca6cd-e032-451f-91c5-be07a26ed420/items + response: + body: + string: '{"data":{"id":"d88904ef-386c-4723-a3b9-4e0d4ed2ea95","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/750ca6cd-e032-451f-91c5-be07a26ed420/items + response: + body: + string: '{"data":[{"id":"d88904ef-386c-4723-a3b9-4e0d4ed2ea95","type":"items","attributes":{"created_at":"2025-08-11T22:19:05.581035Z","modified_at":"2025-08-11T22:19:05.581035Z","org_id":321813,"primary_column_name":"id","signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"3Sh//jFQJZ+uhUOwvHL8krXnbOjEFxMZrYnngo8J/AY=\\\",\\\"timestamp\\\":1754950745,\\\"proof\\\":\\\"MGQCMH3EHN8dRcyYnlAGca1oavAiWREFIjqCYs26LJ0U7jnzVf3zNNzdnCHW+5p9CUoGKQIwMQ/hTuaHqQRKcaENqDr4tWhHbzTI+/KCW0ooyC8K1m6soAOZq1QHJi0b0BGbojPy\\\"}\",\"version\":1}","store_id":"750ca6cd-e032-451f-91c5-be07a26ed420","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: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions-datastores/750ca6cd-e032-451f-91c5-be07a26ed420/items + response: + body: + string: '{"data":[{"id":"d88904ef-386c-4723-a3b9-4e0d4ed2ea95","type":"items","attributes":{"created_at":"2025-08-11T22:19:05.581035Z","modified_at":"2025-08-11T22:19:05.581035Z","org_id":321813,"primary_column_name":"id","signature":"{\"signature\":\"{\\\"version\\\":2,\\\"algorithm\\\":\\\"ecdsa-p384\\\",\\\"pubkey\\\":\\\"3Sh//jFQJZ+uhUOwvHL8krXnbOjEFxMZrYnngo8J/AY=\\\",\\\"timestamp\\\":1754950745,\\\"proof\\\":\\\"MGQCMH3EHN8dRcyYnlAGca1oavAiWREFIjqCYs26LJ0U7jnzVf3zNNzdnCHW+5p9CUoGKQIwMQ/hTuaHqQRKcaENqDr4tWhHbzTI+/KCW0ooyC8K1m6soAOZq1QHJi0b0BGbojPy\\\"}\",\"version\":1}","store_id":"750ca6cd-e032-451f-91c5-be07a26ed420","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/750ca6cd-e032-451f-91c5-be07a26ed420 + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +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..76746e320c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastores_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:06.049Z \ 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..2e45dfdf53 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_datastores_returns_ok_response.yaml @@ -0,0 +1,58 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + string: '{"data":[{"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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"}},{"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":"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"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_bad_request_response.frozen new file mode 100644 index 0000000000..1ef7223521 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:06.188Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_bad_request_response.yaml new file mode 100644 index 0000000000..66217148ed --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_bad_request_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":"5d430898-fa17-4fe6-aab0-75f1b2880b9c","type":"datastores"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"value":{"missing":"item-key"}},"type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/5d430898-fa17-4fe6-aab0-75f1b2880b9c/items + response: + body: + string: '{"errors":[{"title":"item key missing or invalid","detail":"item at + index 0: 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/5d430898-fa17-4fe6-aab0-75f1b2880b9c + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_ok_response.frozen new file mode 100644 index 0000000000..b2ca12189e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:19:06.617Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_ok_response.yaml new file mode 100644 index 0000000000..724f628e89 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_put_datastore_item_returns_ok_response.yaml @@ -0,0 +1,69 @@ +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":"4bb0f4ff-bb80-45fe-ac06-73a66bb7b488","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/4bb0f4ff-bb80-45fe-ac06-73a66bb7b488 + response: + body: + string: '{"data":{"id":"4bb0f4ff-bb80-45fe-ac06-73a66bb7b488","type":"datastores","attributes":{"created_at":"2025-08-11T22:19:06.69789Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T22:19:06.69789Z","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: '{"data":{"attributes":{"value":{"data":"example data","id":"new-item-key","key":"value"}},"id":"e7e64418-b60c-4789-9612-895ac8423207","type":"items"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/4bb0f4ff-bb80-45fe-ac06-73a66bb7b488/items + response: + body: + string: '{"data":{"id":"94a0f1d7-0049-4a89-bd8b-38d596feb328","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/4bb0f4ff-bb80-45fe-ac06-73a66bb7b488 + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +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..59f6fef8f8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:25:45.331Z \ 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..82e151bb1e --- /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":[{"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..b128b3af23 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:26:28.062Z \ 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..60feb46612 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_not_found_response.yaml @@ -0,0 +1,20 @@ +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":[{"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..e6d0964fb8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-11T22:27:22.872Z \ 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..7a5450fe68 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_datastore_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":"b7312b5f-ff05-4c96-972e-2d4d04ace106","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/b7312b5f-ff05-4c96-972e-2d4d04ace106 + response: + body: + string: '{"data":{"id":"b7312b5f-ff05-4c96-972e-2d4d04ace106","type":"datastores","attributes":{"created_at":"2025-08-11T22:27:23.001019Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T22:27:23.001019Z","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: '{"data":{"attributes":{"name":"updated name"},"id":"b7312b5f-ff05-4c96-972e-2d4d04ace106","type":"datastores"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/actions-datastores/b7312b5f-ff05-4c96-972e-2d4d04ace106 + response: + body: + string: '{"data":{"id":"b7312b5f-ff05-4c96-972e-2d4d04ace106","type":"datastores","attributes":{"created_at":"2025-08-11T22:27:23.001019Z","creator_user_id":1445416,"creator_user_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","description":"","modified_at":"2025-08-11T22:27:23.321805Z","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/b7312b5f-ff05-4c96-972e-2d4d04ace106 + response: + body: + string: '' + headers: {} + status: + code: 200 + message: No Content +version: 1 diff --git a/tests/v2/features/actions_datastores.feature b/tests/v2/features/actions_datastores.feature new file mode 100644 index 0000000000..eac17c569a --- /dev/null +++ b/tests/v2/features/actions_datastores.feature @@ -0,0 +1,248 @@ +@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 a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ActionsDatastores" API + + @team:DataDog/app-builder-backend + Scenario: Bulk put datastore items returns "Bad Request" response + Given new "BulkPutDatastoreItems" request + And a "datastore" is created in the system + 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": [{"{{datastore.data.attributes.primary_column_name}}": "key1", "value": {"data": "example data 1", "key": "value"}}, {"badPrimaryKey": "key2", "value": {"data": "example data 2", "key": "value"}}]}, "type": "items", "id": "{{datastore.data.id}}"}} + 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 put datastore items returns "Not Found" response + Given new "BulkPutDatastoreItems" request + And request contains "datastore_id" parameter with value "70b87c26-886f-497a-bd9d-09f53bc9b40c" + And body with value {"data": {"attributes": {"values": [{"primaryKey": "key1", "value": {"data": "example data 1", "key": "value"}}, {"primaryKey": "key2", "value": {"data": "example data 2", "key": "value"}}]}, "type": "items", "id": "70b87c26-886f-497a-bd9d-09f53bc9b40c"}} + 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 put datastore items returns "OK" response + Given new "BulkPutDatastoreItems" request + And a "datastore" is created in the system + 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": [{"{{datastore.data.attributes.primary_column_name}}": "key1", "value": {"data": "example data 1", "key": "value"}}, {"{{datastore.data.attributes.primary_column_name}}": "key2", "value": {"data": "example data 2", "key": "value"}}]}, "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 from import returns "Bad Request" response + Given new "CreateDatastoreFromImport" request + And body with value {"data": {"attributes": {"name": "datastore-name", "primary_column_name": "0invalid_name", "values": [{"primaryKey": "key1", "value": {"data": "example data 1", "key": "value"}}, {"primaryKey": "key2", "value": {"data": "example data 2", "key": "value"}}]}, "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 "invalid column name" + + @team:DataDog/app-builder-backend + Scenario: Create datastore from import returns "OK" response + Given new "CreateDatastoreFromImport" request + And body with value {"data": {"attributes": {"name": "datastore-name", "primary_column_name": "primaryKey", "values": [{"primaryKey": "key1", "value": {"data": "example data 1", "key": "value"}}, {"primaryKey": "key2", "value": {"data": "example data 2", "key": "value"}}]}, "type": "datastores"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.item_count" is equal to 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 "invalid column name" + + @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", "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: 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", "id": "70b87c26-886f-497a-bd9d-09f53bc9b40c"}} + 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: Delete datastore item returns "OK" response + Given new "DeleteDatastoreItem" request + And a "datastore" is created in the system + And there is a valid "datastore" in the system + And a "datastore item" is created in the system + And there are valid "datastore items" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"id": "{{datastore_items.data[0].id}}", "item_key": "test-key"}, "type": "items", "id": "{{datastore.data.id}}"}} + 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 @team:DataDog/app-builder-backend + Scenario: Delete datastore returns "Not Found" response + Given new "DeleteDatastore" request + And request contains "datastore_id" parameter with value "f4822dc6-3c79-4963-8980-291a65d3b196" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/app-builder-backend + Scenario: Delete datastore returns "OK" response + Given new "DeleteDatastore" request + And a "datastore" is created in the system + And request contains "datastore_id" parameter from "created_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 a "datastore" is created in the system + And request contains "datastore_id" parameter from "created_datastore.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{created_datastore.data.id}}" + + @team:DataDog/app-builder-backend + Scenario: List datastore items returns "Bad Request" response + Given new "ListDatastoreItems" request + And a "datastore" is created in the system + 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" + + @team:DataDog/app-builder-backend + Scenario: List datastore items returns "OK" response + Given new "ListDatastoreItems" request + And a "datastore" is created in the system + And there is a valid "datastore" in the system + And a "datastore item" is created in the system + And there are valid "datastore items" 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 + And the response "data[0].id" is equal to "{{datastore_items.data[0].id}}" + + @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: Put datastore item returns "Bad Request" response + Given new "PutDatastoreItem" request + And a "datastore" is created in the system + And request contains "datastore_id" parameter from "created_datastore.data.id" + And body with value {"data": {"attributes": {"value": {"missing": "item-key"}}, "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: Put datastore item returns "OK" response + Given new "PutDatastoreItem" request + And a "datastore" is created in the system + 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": {"value": {"{{datastore.data.attributes.primary_column_name}}": "new-item-key", "data": "example data", "key": "value"}}, "type": "items", "id": "e7e64418-b60c-4789-9612-895ac8423207"}} + 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 a "datastore" is created in the system + 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 b609709365..5616102545 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -1,4 +1,68 @@ [ + { + "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": "a \"datastore\" is created in the system", + "key": "created_datastore", + "tag": "Actions Datastores", + "operationId": "CreateDatastore" + }, + { + "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 \"values\": [],\n \"description\": \"\",\n \"org_access\": \"contributor\"\n }\n }\n}" + } + ], + "step": "there is a valid imported \"datastore\" in the system", + "key": "imported_datastore", + "tag": "Actions Datastores", + "operationId": "CreateDatastoreFromImport" + }, + { + "parameters": [ + { + "name": "datastore_id", + "value": "\"{{created_datastore.data.id}}\"" + } + ], + "step": "there is a valid \"datastore\" in the system", + "key": "datastore", + "tag": "Actions Datastores", + "operationId": "GetDatastore" + }, + { + "parameters": [ + { + "name": "datastore_id", + "value": "\"{{datastore.data.id}}\"" + } + ], + "step": "there are valid \"datastore items\" in the system", + "key": "datastore_items", + "tag": "Actions Datastores", + "operationId": "ListDatastoreItems" + }, + { + "parameters": [ + { + "name": "datastore_id", + "value": "\"{{datastore.data.id}}\"" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"items\",\n \"attributes\": {\n \"value\": {\n \"{{datastore.data.attributes.primary_column_name}}\": \"test-key\",\n \"data\": \"test-value\"\n }\n },\n \"id\": \"{{datastore.data.id}}\"\n }\n}" + } + ], + "step": "a \"datastore item\" is created in the system", + "key": "created_datastore_item", + "tag": "Actions Datastores", + "operationId": "PutDatastoreItem" + }, { "parameters": [ { diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index fd14fad093..8a815429a5 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1,4 +1,91 @@ { + "ListDatastores": { + "tag": "Actions Datastores", + "undo": { + "type": "safe" + } + }, + "CreateDatastore": { + "tag": "Actions Datastores", + "undo": { + "operationId": "DeleteDatastore", + "parameters": [ + { + "name": "datastore_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "CreateDatastoreFromImport": { + "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" + } + }, + "PutDatastoreItem": { + "tag": "Actions Datastores", + "undo": { + "operationId": "DeleteDatastoreItem", + "parameters": [ + { + "name": "datastore_id", + "origin": "request", + "source": "data.id" + }, + { + "name": "body", + "origin": "request", + "template": "{\n \"data\": {\n \"type\": \"items\",\n \"attributes\": {\n \"id\": \"{{data.id}}\",\n \"item_key\": \"test-key\"\n },\n \"id\": \"{{data.id}}\"\n }\n}" + } + ], + "type": "idempotent" + } + }, + "BulkPutDatastoreItems": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, "ListAppKeyRegistrations": { "tag": "Action Connection", "undo": {