From f076184ec203891f0864d6d31099c3d48451520a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 11 Sep 2025 15:23:38 +0000 Subject: [PATCH] Regenerate client from commit 8548980 of spec repo --- .generator/schemas/v2/openapi.yaml | 892 +++++++++- .../BulkWriteDatastoreItems.java | 49 + .../actions-datastores/CreateDatastore.java | 38 + .../actions-datastores/DeleteDatastore.java | 25 + .../DeleteDatastoreItem.java | 40 + .../v2/actions-datastores/GetDatastore.java | 27 + .../ListDatastoreItems.java | 27 + .../v2/actions-datastores/ListDatastores.java | 24 + .../actions-datastores/UpdateDatastore.java | 39 + .../UpdateDatastoreItem.java | 43 + .../client/v2/api/ActionsDatastoresApi.java | 1481 +++++++++++++++++ .../BulkPutAppsDatastoreItemsRequest.java | 139 ++ .../BulkPutAppsDatastoreItemsRequestData.java | 184 ++ ...psDatastoreItemsRequestDataAttributes.java | 192 +++ .../v2/model/CreateAppsDatastoreRequest.java | 137 ++ .../model/CreateAppsDatastoreRequestData.java | 208 +++ ...ateAppsDatastoreRequestDataAttributes.java | 285 ++++ ...tastoreRequestDataAttributesOrgAccess.java | 67 + .../v2/model/CreateAppsDatastoreResponse.java | 137 ++ .../CreateAppsDatastoreResponseData.java | 179 ++ .../model/DORAFailureRequestAttributes.java | 3 +- .../api/client/v2/model/Datastore.java | 136 ++ .../api/client/v2/model/DatastoreArray.java | 154 ++ .../api/client/v2/model/DatastoreData.java | 205 +++ .../v2/model/DatastoreDataAttributes.java | 378 +++++ .../client/v2/model/DatastoreDataType.java | 53 + .../v2/model/DatastoreItemConflictMode.java | 59 + .../v2/model/DatastoreItemsDataType.java | 55 + ...DatastorePrimaryKeyGenerationStrategy.java | 67 + .../model/DeleteAppsDatastoreItemRequest.java | 139 ++ .../DeleteAppsDatastoreItemRequestData.java | 183 ++ ...ppsDatastoreItemRequestDataAttributes.java | 176 ++ .../DeleteAppsDatastoreItemResponse.java | 138 ++ .../DeleteAppsDatastoreItemResponseData.java | 179 ++ .../api/client/v2/model/ItemApiPayload.java | 136 ++ .../client/v2/model/ItemApiPayloadArray.java | 182 ++ .../client/v2/model/ItemApiPayloadData.java | 205 +++ .../model/ItemApiPayloadDataAttributes.java | 319 ++++ .../client/v2/model/ItemApiPayloadMeta.java | 166 ++ .../v2/model/ItemApiPayloadMetaPage.java | 191 +++ .../v2/model/ItemApiPayloadMetaSchema.java | 178 ++ .../model/ItemApiPayloadMetaSchemaField.java | 174 ++ .../PutAppsDatastoreItemResponseArray.java | 160 ++ .../PutAppsDatastoreItemResponseData.java | 182 ++ .../model/UpdateAppsDatastoreItemRequest.java | 139 ++ .../UpdateAppsDatastoreItemRequestData.java | 212 +++ ...ppsDatastoreItemRequestDataAttributes.java | 209 +++ ...eItemRequestDataAttributesItemChanges.java | 154 ++ ...pdateAppsDatastoreItemRequestDataType.java | 62 + .../v2/model/UpdateAppsDatastoreRequest.java | 137 ++ .../model/UpdateAppsDatastoreRequestData.java | 208 +++ ...ateAppsDatastoreRequestDataAttributes.java | 167 ++ ..._items_returns_Bad_Request_response.freeze | 1 + ...re_items_returns_Bad_Request_response.json | 88 + ...re_items_returns_Not_Found_response.freeze | 1 + ...tore_items_returns_Not_Found_response.json | 32 + ...datastore_items_returns_OK_response.freeze | 1 + ...e_datastore_items_returns_OK_response.json | 88 + ...astore_returns_Bad_Request_response.freeze | 1 + ...atastore_returns_Bad_Request_response.json | 32 + ...reate_datastore_returns_OK_response.freeze | 1 + .../Create_datastore_returns_OK_response.json | 58 + ...e_item_returns_Bad_Request_response.freeze | 1 + ...ore_item_returns_Bad_Request_response.json | 32 + ...ore_item_returns_Not_Found_response.freeze | 1 + ...store_item_returns_Not_Found_response.json | 32 + ..._datastore_item_returns_OK_response.freeze | 1 + ...te_datastore_item_returns_OK_response.json | 118 ++ ...astore_returns_Bad_Request_response.freeze | 1 + ...atastore_returns_Bad_Request_response.json | 28 + ...elete_datastore_returns_OK_response.freeze | 1 + .../Delete_datastore_returns_OK_response.json | 83 + ...astore_returns_Bad_Request_response.freeze | 1 + ...atastore_returns_Bad_Request_response.json | 28 + ...atastore_returns_Not_Found_response.freeze | 1 + ..._datastore_returns_Not_Found_response.json | 28 + .../Get_datastore_returns_OK_response.freeze | 1 + .../v2/Get_datastore_returns_OK_response.json | 84 + ..._items_returns_Bad_Request_response.freeze | 1 + ...re_items_returns_Bad_Request_response.json | 28 + ...re_items_returns_Not_Found_response.freeze | 1 + ...tore_items_returns_Not_Found_response.json | 28 + ...datastore_items_returns_OK_response.freeze | 1 + ...t_datastore_items_returns_OK_response.json | 114 ++ ...List_datastores_returns_OK_response.freeze | 1 + .../List_datastores_returns_OK_response.json | 28 + ...e_item_returns_Bad_Request_response.freeze | 1 + ...ore_item_returns_Bad_Request_response.json | 32 + ...ore_item_returns_Not_Found_response.freeze | 1 + ...store_item_returns_Not_Found_response.json | 32 + ..._datastore_item_returns_OK_response.freeze | 1 + ...te_datastore_item_returns_OK_response.json | 118 ++ ...astore_returns_Bad_Request_response.freeze | 1 + ...atastore_returns_Bad_Request_response.json | 32 + ...atastore_returns_Not_Found_response.freeze | 1 + ..._datastore_returns_Not_Found_response.json | 32 + ...pdate_datastore_returns_OK_response.freeze | 1 + .../Update_datastore_returns_OK_response.json | 88 + .../client/v2/api/actions_datastores.feature | 220 +++ .../com/datadog/api/client/v2/api/given.json | 28 + .../com/datadog/api/client/v2/api/undo.json | 61 + 101 files changed, 10911 insertions(+), 3 deletions(-) create mode 100644 examples/v2/actions-datastores/BulkWriteDatastoreItems.java create mode 100644 examples/v2/actions-datastores/CreateDatastore.java create mode 100644 examples/v2/actions-datastores/DeleteDatastore.java create mode 100644 examples/v2/actions-datastores/DeleteDatastoreItem.java create mode 100644 examples/v2/actions-datastores/GetDatastore.java create mode 100644 examples/v2/actions-datastores/ListDatastoreItems.java create mode 100644 examples/v2/actions-datastores/ListDatastores.java create mode 100644 examples/v2/actions-datastores/UpdateDatastore.java create mode 100644 examples/v2/actions-datastores/UpdateDatastoreItem.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/ActionsDatastoresApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestDataAttributesOrgAccess.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/Datastore.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DatastoreArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DatastoreData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DatastoreDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DatastoreDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DatastoreItemConflictMode.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DatastoreItemsDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DatastorePrimaryKeyGenerationStrategy.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ItemApiPayload.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaPage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaSchema.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaSchemaField.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PutAppsDatastoreItemResponseArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PutAppsDatastoreItemResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataAttributesItemChanges.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequestDataAttributes.java create mode 100644 src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_datastore_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_datastore_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_datastore_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_datastore_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Delete_datastore_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_datastore_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_datastore_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_datastore_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_datastore_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_datastore_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_datastore_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_datastore_items_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_datastore_items_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_datastore_items_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_datastore_items_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_datastore_items_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_datastore_items_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_datastores_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_datastores_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_item_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_item_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_datastore_returns_OK_response.json create mode 100644 src/test/resources/com/datadog/api/client/v2/api/actions_datastores.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 085c5aa51a7..011c51ec120 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5795,6 +5795,33 @@ components: type: $ref: '#/components/schemas/FindingType' type: object + BulkPutAppsDatastoreItemsRequest: + description: Request to insert multiple items into a datastore in a single operation. + properties: + data: + $ref: '#/components/schemas/BulkPutAppsDatastoreItemsRequestData' + type: object + BulkPutAppsDatastoreItemsRequestData: + description: Data wrapper containing the items to insert and their configuration + for the bulk insert operation. + properties: + attributes: + $ref: '#/components/schemas/BulkPutAppsDatastoreItemsRequestDataAttributes' + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object + BulkPutAppsDatastoreItemsRequestDataAttributes: + description: Configuration for bulk inserting multiple items into a datastore. + properties: + conflict_mode: + $ref: '#/components/schemas/DatastoreItemConflictMode' + values: + $ref: '#/components/schemas/DatastoreItemValues' + required: + - values + type: object CIAppAggregateBucketValue: description: A bucket value, can either be a timeseries or a single value. oneOf: @@ -10785,6 +10812,77 @@ components: - id - type type: object + CreateAppsDatastoreRequest: + description: Request to create a new datastore with specified configuration + and metadata. + properties: + data: + $ref: '#/components/schemas/CreateAppsDatastoreRequestData' + type: object + CreateAppsDatastoreRequestData: + description: Data wrapper containing the configuration needed to create a new + datastore. + properties: + attributes: + $ref: '#/components/schemas/CreateAppsDatastoreRequestDataAttributes' + id: + description: Optional ID for the new datastore. If not provided, one will + be generated automatically. + type: string + type: + $ref: '#/components/schemas/DatastoreDataType' + required: + - type + type: object + CreateAppsDatastoreRequestDataAttributes: + description: Configuration and metadata to create a new datastore. + properties: + description: + description: A human-readable description about the datastore. + type: string + name: + description: The display name for the new datastore. + example: datastore-name + type: string + org_access: + $ref: '#/components/schemas/CreateAppsDatastoreRequestDataAttributesOrgAccess' + primary_column_name: + $ref: '#/components/schemas/DatastoreAttributesPrimaryColumnName' + primary_key_generation_strategy: + $ref: '#/components/schemas/DatastorePrimaryKeyGenerationStrategy' + required: + - name + - primary_column_name + type: object + CreateAppsDatastoreRequestDataAttributesOrgAccess: + description: The organization access level for the datastore. For example, 'contributor'. + enum: + - contributor + - viewer + - manager + type: string + x-enum-varnames: + - CONTRIBUTOR + - VIEWER + - MANAGER + CreateAppsDatastoreResponse: + description: Response after successfully creating a new datastore, containing + the datastore's assigned ID. + properties: + data: + $ref: '#/components/schemas/CreateAppsDatastoreResponseData' + type: object + CreateAppsDatastoreResponseData: + description: The newly created datastore's data. + properties: + id: + description: The unique identifier assigned to the newly created datastore. + type: string + type: + $ref: '#/components/schemas/DatastoreDataType' + required: + - type + type: object CreateCustomFrameworkRequest: description: Request object to create a custom framework. properties: @@ -12635,7 +12733,7 @@ components: type: string finished_at: description: Unix timestamp when the failure finished. It must be in nanoseconds, - milliseconds, or seconds, and it should not be older than 1 hour. + milliseconds, or seconds. example: 1693491984000000000 format: int64 type: integer @@ -13512,6 +13610,134 @@ components: required: - data type: object + Datastore: + description: A datastore's complete configuration and metadata. + properties: + data: + $ref: '#/components/schemas/DatastoreData' + type: object + DatastoreArray: + description: A collection of datastores returned by list operations. + properties: + data: + description: An array of datastore objects containing their configurations + and metadata. + items: + $ref: '#/components/schemas/DatastoreData' + type: array + required: + - data + type: object + DatastoreAttributesPrimaryColumnName: + description: "The name of the primary key column for this datastore. Primary + column names:\n - Must abide by both [PostgreSQL naming conventions](https://www.postgresql.org/docs/7.0/syntax525.htm)\n + \ - Cannot exceed 63 characters" + example: '' + maxLength: 63 + type: string + DatastoreData: + description: Core information about a datastore, including its unique identifier + and attributes. + properties: + attributes: + $ref: '#/components/schemas/DatastoreDataAttributes' + id: + description: The unique identifier of the datastore. + type: string + type: + $ref: '#/components/schemas/DatastoreDataType' + required: + - type + type: object + DatastoreDataAttributes: + description: Detailed information about a datastore. + properties: + created_at: + description: Timestamp when the datastore was created. + format: date-time + type: string + creator_user_id: + description: The numeric ID of the user who created the datastore. + format: int64 + type: integer + creator_user_uuid: + description: The UUID of the user who created the datastore. + type: string + description: + description: A human-readable description about the datastore. + type: string + modified_at: + description: Timestamp when the datastore was last modified. + format: date-time + type: string + name: + description: The display name of the datastore. + type: string + org_id: + description: The ID of the organization that owns this datastore. + format: int64 + type: integer + primary_column_name: + $ref: '#/components/schemas/DatastoreAttributesPrimaryColumnName' + primary_key_generation_strategy: + $ref: '#/components/schemas/DatastorePrimaryKeyGenerationStrategy' + type: object + DatastoreDataType: + default: datastores + description: The resource type for datastores. + enum: + - datastores + example: datastores + type: string + x-enum-varnames: + - DATASTORES + DatastoreItemConflictMode: + description: How to handle conflicts when inserting items that already exist + in the datastore. + enum: + - fail_on_conflict + - overwrite_on_conflict + example: overwrite_on_conflict + type: string + x-enum-varnames: + - FAIL_ON_CONFLICT + - OVERWRITE_ON_CONFLICT + DatastoreItemValues: + description: An array of items to add to the datastore, where each item is a + set of key-value pairs representing the item's data. Up to 100 items can be + updated in a single request. + example: + - data: example data + key: value + - data: example data2 + key: value2 + items: + additionalProperties: {} + description: A single item's data as key-value pairs. Key names cannot exceed + 63 characters. + type: object + maxItems: 100 + type: array + DatastoreItemsDataType: + default: items + description: The resource type for datastore items. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS + DatastorePrimaryKeyGenerationStrategy: + description: Can be set to `uuid` to automatically generate primary keys when + new items are added. Default value is `none`, which requires you to supply + a primary key for each new item. + enum: + - none + - uuid + type: string + x-enum-varnames: + - NONE + - UUID Date: description: Date as Unix timestamp in milliseconds. example: 1722439510282 @@ -13537,6 +13763,59 @@ components: - id - type type: object + DeleteAppsDatastoreItemRequest: + description: Request to delete a specific item from a datastore by its primary + key. + properties: + data: + $ref: '#/components/schemas/DeleteAppsDatastoreItemRequestData' + type: object + DeleteAppsDatastoreItemRequestData: + description: Data wrapper containing the information needed to identify and + delete a specific datastore item. + properties: + attributes: + $ref: '#/components/schemas/DeleteAppsDatastoreItemRequestDataAttributes' + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object + DeleteAppsDatastoreItemRequestDataAttributes: + description: Attributes specifying which datastore item to delete by its primary + key. + properties: + id: + description: Optional unique identifier of the item to delete. + example: a7656bcc-51d4-4884-adf7-4d0d9a3e0633 + type: string + item_key: + description: The primary key value that identifies the item to delete. Cannot + exceed 256 characters. + example: primaryKey + maxLength: 256 + type: string + required: + - item_key + type: object + DeleteAppsDatastoreItemResponse: + description: Response from successfully deleting a datastore item. + properties: + data: + $ref: '#/components/schemas/DeleteAppsDatastoreItemResponseData' + type: object + DeleteAppsDatastoreItemResponseData: + description: Data containing the identifier of the datastore item that was successfully + deleted. + properties: + id: + description: The unique identifier of the item that was deleted. + type: string + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object DeleteAppsRequest: description: A request object for deleting multiple apps by ID. example: @@ -22969,6 +23248,125 @@ components: type: string x-enum-varnames: - ERROR_TRACKING_SEARCH_RESULT + ItemApiPayload: + description: A single datastore item with its content and metadata. + properties: + data: + $ref: '#/components/schemas/ItemApiPayloadData' + type: object + ItemApiPayloadArray: + description: A collection of datastore items with pagination and schema metadata. + properties: + data: + description: An array of datastore items with their content and metadata. + items: + $ref: '#/components/schemas/ItemApiPayloadData' + maxItems: 100 + type: array + meta: + $ref: '#/components/schemas/ItemApiPayloadMeta' + description: Metadata about the included items, including pagination info + and datastore schema. + required: + - data + type: object + ItemApiPayloadData: + description: Core data and metadata for a single datastore item. + properties: + attributes: + $ref: '#/components/schemas/ItemApiPayloadDataAttributes' + id: + description: The unique identifier of the datastore. + type: string + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object + ItemApiPayloadDataAttributes: + description: Metadata and content of a datastore item. + properties: + created_at: + description: Timestamp when the item was first created. + format: date-time + type: string + modified_at: + description: Timestamp when the item was last modified. + format: date-time + type: string + org_id: + description: The ID of the organization that owns this item. + format: int64 + type: integer + primary_column_name: + $ref: '#/components/schemas/DatastoreAttributesPrimaryColumnName' + signature: + description: A unique signature identifying this item version. + type: string + store_id: + description: The unique identifier of the datastore containing this item. + type: string + value: + $ref: '#/components/schemas/ItemApiPayloadDataAttributesValue' + type: object + ItemApiPayloadDataAttributesValue: + additionalProperties: {} + description: The data content (as key-value pairs) of a datastore item. + type: object + ItemApiPayloadMeta: + description: Additional metadata about a collection of datastore items, including + pagination and schema information. + properties: + page: + $ref: '#/components/schemas/ItemApiPayloadMetaPage' + schema: + $ref: '#/components/schemas/ItemApiPayloadMetaSchema' + type: object + ItemApiPayloadMetaPage: + description: Pagination information for a collection of datastore items. + properties: + hasMore: + description: Whether there are additional pages of items beyond the current + page. + type: boolean + totalCount: + description: The total number of items in the datastore, ignoring any filters. + format: int64 + type: integer + totalFilteredCount: + description: The total number of items that match the current filter criteria. + format: int64 + type: integer + type: object + ItemApiPayloadMetaSchema: + description: Schema information about the datastore, including its primary key + and field definitions. + properties: + fields: + description: An array describing the columns available in this datastore. + items: + $ref: '#/components/schemas/ItemApiPayloadMetaSchemaField' + type: array + primary_key: + description: The name of the primary key column for this datastore. + type: string + type: object + ItemApiPayloadMetaSchemaField: + description: Information about a specific column in the datastore schema. + properties: + name: + description: The name of this column in the datastore. + example: '' + type: string + type: + description: The data type of this column. For example, 'string', 'number', + or 'boolean'. + example: '' + type: string + required: + - name + - type + type: object JSONAPIErrorItem: description: API error response body properties: @@ -33877,6 +34275,32 @@ components: data: $ref: '#/components/schemas/Deployment' type: object + PutAppsDatastoreItemResponseArray: + description: Response after successfully inserting multiple items into a datastore, + containing the identifiers of the created items. + properties: + data: + description: An array of data objects containing the identifiers of the + successfully inserted items. + items: + $ref: '#/components/schemas/PutAppsDatastoreItemResponseData' + maxItems: 100 + type: array + required: + - data + type: object + PutAppsDatastoreItemResponseData: + description: Data containing the identifier of a single item that was successfully + inserted into the datastore. + properties: + id: + description: The unique identifier assigned to the inserted item. + type: string + type: + $ref: '#/components/schemas/DatastoreItemsDataType' + required: + - type + type: object PutIncidentNotificationRuleRequest: description: Put request for a notification rule. properties: @@ -45742,6 +46166,94 @@ components: type: string type: array type: object + UpdateAppsDatastoreItemRequest: + description: Request to update specific fields on an existing datastore item. + properties: + data: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequestData' + type: object + UpdateAppsDatastoreItemRequestData: + description: Data wrapper containing the item identifier and the changes to + apply during the update operation. + properties: + attributes: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequestDataAttributes' + id: + description: The unique identifier of the datastore item. + type: string + type: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequestDataType' + required: + - type + type: object + UpdateAppsDatastoreItemRequestDataAttributes: + description: Attributes for updating a datastore item, including the item key + and changes to apply. + properties: + id: + description: The unique identifier of the item being updated. + type: string + item_changes: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequestDataAttributesItemChanges' + item_key: + description: The primary key that identifies the item to update. Cannot + exceed 256 characters. + example: '' + maxLength: 256 + type: string + required: + - item_changes + - item_key + type: object + UpdateAppsDatastoreItemRequestDataAttributesItemChanges: + description: Changes to apply to a datastore item using set operations. + properties: + ops_set: + additionalProperties: {} + description: Set operation that contains key-value pairs to set on the datastore + item. + type: object + type: object + UpdateAppsDatastoreItemRequestDataType: + default: items + description: The resource type for datastore items. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS + UpdateAppsDatastoreRequest: + description: Request to update a datastore's configuration such as its name + or description. + properties: + data: + $ref: '#/components/schemas/UpdateAppsDatastoreRequestData' + type: object + UpdateAppsDatastoreRequestData: + description: Data wrapper containing the datastore identifier and the attributes + to update. + properties: + attributes: + $ref: '#/components/schemas/UpdateAppsDatastoreRequestDataAttributes' + id: + description: The unique identifier of the datastore to update. + type: string + type: + $ref: '#/components/schemas/DatastoreDataType' + required: + - type + type: object + UpdateAppsDatastoreRequestDataAttributes: + description: Attributes that can be updated on a datastore. + properties: + description: + description: A human-readable description about the datastore. + type: string + name: + description: The display name of the datastore. + type: string + type: object UpdateCustomFrameworkRequest: description: Request object to update a custom framework. properties: @@ -47765,6 +48277,378 @@ info: version: '1.0' openapi: 3.0.0 paths: + /api/v2/actions-datastores: + get: + description: Lists all datastores for the organization. + operationId: ListDatastores + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DatastoreArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List datastores + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_read + post: + description: Creates a new datastore. + operationId: CreateDatastore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAppsDatastoreRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAppsDatastoreResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create datastore + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_manage + /api/v2/actions-datastores/{datastore_id}: + delete: + description: Deletes a datastore by its unique identifier. + operationId: DeleteDatastore + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + responses: + '200': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete datastore + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_manage + get: + description: Retrieves a specific datastore by its ID. + operationId: GetDatastore + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Datastore' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get datastore + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_read + patch: + description: Updates an existing datastore's attributes. + operationId: UpdateDatastore + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAppsDatastoreRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Datastore' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update datastore + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_manage + /api/v2/actions-datastores/{datastore_id}/items: + delete: + description: Deletes an item from a datastore by its key. + operationId: DeleteDatastoreItem + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteAppsDatastoreItemRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteAppsDatastoreItemResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete datastore item + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_write + get: + description: Lists items from a datastore. You can filter the results by specifying + either an item key or a filter query parameter, but not both at the same time. + Supports server-side pagination for large datasets. + operationId: ListDatastoreItems + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + - description: Optional query filter to search items using the [logs search + syntax](https://docs.datadoghq.com/logs/explorer/search_syntax/). + in: query + name: filter + schema: + type: string + - description: Optional primary key value to retrieve a specific item. Cannot + be used together with the filter parameter. + in: query + name: item_key + schema: + maxLength: 256 + type: string + - description: Optional field to limit the number of items to return per page + for pagination. Up to 100 items can be returned per page. + in: query + name: page[limit] + schema: + format: int64 + maximum: 100 + minimum: 1 + type: integer + - description: Optional field to offset the number of items to skip from the + beginning of the result set for pagination. + in: query + name: page[offset] + schema: + format: int64 + type: integer + - description: Optional field to sort results by. Prefix with '-' for descending + order (e.g., '-created_at'). + in: query + name: sort + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemApiPayloadArray' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List datastore items + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_read + patch: + description: Partially updates an item in a datastore by its key. + operationId: UpdateDatastoreItem + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAppsDatastoreItemRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemApiPayload' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update datastore item + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_write + /api/v2/actions-datastores/{datastore_id}/items/bulk: + post: + description: Creates or replaces multiple items in a datastore by their keys + in a single operation. + operationId: BulkWriteDatastoreItems + parameters: + - description: The unique identifier of the datastore to retrieve. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkPutAppsDatastoreItemsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PutAppsDatastoreItemResponseArray' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Bulk write datastore items + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_write /api/v2/actions/app_key_registrations: get: description: List App Key Registrations @@ -71931,6 +72815,12 @@ tags: description: Find out more at url: https://docs.datadoghq.com/service_management/workflows/connections/ name: Action Connection +- description: 'Leverage the Actions Datastore API to create, modify, and delete + + items in datastores owned by your organization.' + externalDocs: + url: https://docs.datadoghq.com/actions/datastore + name: Actions Datastores - description: "Datadog Agentless Scanning provides visibility into risks and vulnerabilities\nwithin your hosts, running containers, and serverless functions\u2014all without\nrequiring teams to install Agents on every host or where Agents cannot be installed.\nAgentless diff --git a/examples/v2/actions-datastores/BulkWriteDatastoreItems.java b/examples/v2/actions-datastores/BulkWriteDatastoreItems.java new file mode 100644 index 00000000000..b068d9d0376 --- /dev/null +++ b/examples/v2/actions-datastores/BulkWriteDatastoreItems.java @@ -0,0 +1,49 @@ +// Bulk write datastore items returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionsDatastoresApi; +import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequest; +import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequestData; +import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequestDataAttributes; +import com.datadog.api.client.v2.model.DatastoreItemsDataType; +import com.datadog.api.client.v2.model.PutAppsDatastoreItemResponseArray; +import java.util.Arrays; +import java.util.Map; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient); + + // there is a valid "datastore" in the system + String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID"); + + BulkPutAppsDatastoreItemsRequest body = + new BulkPutAppsDatastoreItemsRequest() + .data( + new BulkPutAppsDatastoreItemsRequestData() + .attributes( + new BulkPutAppsDatastoreItemsRequestDataAttributes() + .values( + Arrays.asList( + Map.ofEntries( + Map.entry("id", "cust_3141"), + Map.entry("name", "Johnathan")), + Map.ofEntries( + Map.entry("id", "cust_3142"), Map.entry("name", "Mary"))))) + .type(DatastoreItemsDataType.ITEMS)); + + try { + PutAppsDatastoreItemResponseArray result = + apiInstance.bulkWriteDatastoreItems(DATASTORE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsDatastoresApi#bulkWriteDatastoreItems"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/actions-datastores/CreateDatastore.java b/examples/v2/actions-datastores/CreateDatastore.java new file mode 100644 index 00000000000..36ae06db2d9 --- /dev/null +++ b/examples/v2/actions-datastores/CreateDatastore.java @@ -0,0 +1,38 @@ +// Create datastore returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionsDatastoresApi; +import com.datadog.api.client.v2.model.CreateAppsDatastoreRequest; +import com.datadog.api.client.v2.model.CreateAppsDatastoreRequestData; +import com.datadog.api.client.v2.model.CreateAppsDatastoreRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateAppsDatastoreResponse; +import com.datadog.api.client.v2.model.DatastoreDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient); + + CreateAppsDatastoreRequest body = + new CreateAppsDatastoreRequest() + .data( + new CreateAppsDatastoreRequestData() + .attributes( + new CreateAppsDatastoreRequestDataAttributes() + .name("datastore-name") + .primaryColumnName("primaryKey")) + .type(DatastoreDataType.DATASTORES)); + + try { + CreateAppsDatastoreResponse result = apiInstance.createDatastore(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsDatastoresApi#createDatastore"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/actions-datastores/DeleteDatastore.java b/examples/v2/actions-datastores/DeleteDatastore.java new file mode 100644 index 00000000000..b2e3d1d6b8f --- /dev/null +++ b/examples/v2/actions-datastores/DeleteDatastore.java @@ -0,0 +1,25 @@ +// Delete datastore returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionsDatastoresApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient); + + // there is a valid "datastore" in the system + String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID"); + + try { + apiInstance.deleteDatastore(DATASTORE_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsDatastoresApi#deleteDatastore"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/actions-datastores/DeleteDatastoreItem.java b/examples/v2/actions-datastores/DeleteDatastoreItem.java new file mode 100644 index 00000000000..05c53fe2b1d --- /dev/null +++ b/examples/v2/actions-datastores/DeleteDatastoreItem.java @@ -0,0 +1,40 @@ +// Delete datastore item returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionsDatastoresApi; +import com.datadog.api.client.v2.model.DatastoreItemsDataType; +import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequest; +import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequestData; +import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequestDataAttributes; +import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient); + + // there is a valid "datastore" in the system + String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID"); + + DeleteAppsDatastoreItemRequest body = + new DeleteAppsDatastoreItemRequest() + .data( + new DeleteAppsDatastoreItemRequestData() + .attributes( + new DeleteAppsDatastoreItemRequestDataAttributes().itemKey("test-key")) + .type(DatastoreItemsDataType.ITEMS)); + + try { + DeleteAppsDatastoreItemResponse result = + apiInstance.deleteDatastoreItem(DATASTORE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsDatastoresApi#deleteDatastoreItem"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/actions-datastores/GetDatastore.java b/examples/v2/actions-datastores/GetDatastore.java new file mode 100644 index 00000000000..739b9dab553 --- /dev/null +++ b/examples/v2/actions-datastores/GetDatastore.java @@ -0,0 +1,27 @@ +// Get datastore returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionsDatastoresApi; +import com.datadog.api.client.v2.model.Datastore; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient); + + // there is a valid "datastore" in the system + String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID"); + + try { + Datastore result = apiInstance.getDatastore(DATASTORE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsDatastoresApi#getDatastore"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/actions-datastores/ListDatastoreItems.java b/examples/v2/actions-datastores/ListDatastoreItems.java new file mode 100644 index 00000000000..85f74d138e4 --- /dev/null +++ b/examples/v2/actions-datastores/ListDatastoreItems.java @@ -0,0 +1,27 @@ +// List datastore items returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionsDatastoresApi; +import com.datadog.api.client.v2.model.ItemApiPayloadArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient); + + // there is a valid "datastore" in the system + String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID"); + + try { + ItemApiPayloadArray result = apiInstance.listDatastoreItems(DATASTORE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsDatastoresApi#listDatastoreItems"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/actions-datastores/ListDatastores.java b/examples/v2/actions-datastores/ListDatastores.java new file mode 100644 index 00000000000..b01317b17b3 --- /dev/null +++ b/examples/v2/actions-datastores/ListDatastores.java @@ -0,0 +1,24 @@ +// List datastores returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionsDatastoresApi; +import com.datadog.api.client.v2.model.DatastoreArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient); + + try { + DatastoreArray result = apiInstance.listDatastores(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsDatastoresApi#listDatastores"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/actions-datastores/UpdateDatastore.java b/examples/v2/actions-datastores/UpdateDatastore.java new file mode 100644 index 00000000000..8b812f9b7d9 --- /dev/null +++ b/examples/v2/actions-datastores/UpdateDatastore.java @@ -0,0 +1,39 @@ +// Update datastore returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionsDatastoresApi; +import com.datadog.api.client.v2.model.Datastore; +import com.datadog.api.client.v2.model.DatastoreDataType; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequest; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequestData; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequestDataAttributes; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient); + + // there is a valid "datastore" in the system + String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID"); + + UpdateAppsDatastoreRequest body = + new UpdateAppsDatastoreRequest() + .data( + new UpdateAppsDatastoreRequestData() + .attributes(new UpdateAppsDatastoreRequestDataAttributes().name("updated name")) + .type(DatastoreDataType.DATASTORES) + .id(DATASTORE_DATA_ID)); + + try { + Datastore result = apiInstance.updateDatastore(DATASTORE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsDatastoresApi#updateDatastore"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/actions-datastores/UpdateDatastoreItem.java b/examples/v2/actions-datastores/UpdateDatastoreItem.java new file mode 100644 index 00000000000..30da7ae2b66 --- /dev/null +++ b/examples/v2/actions-datastores/UpdateDatastoreItem.java @@ -0,0 +1,43 @@ +// Update datastore item returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ActionsDatastoresApi; +import com.datadog.api.client.v2.model.ItemApiPayload; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequest; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestData; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestDataAttributes; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestDataAttributesItemChanges; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequestDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + ActionsDatastoresApi apiInstance = new ActionsDatastoresApi(defaultClient); + + // there is a valid "datastore" in the system + String DATASTORE_DATA_ID = System.getenv("DATASTORE_DATA_ID"); + + UpdateAppsDatastoreItemRequest body = + new UpdateAppsDatastoreItemRequest() + .data( + new UpdateAppsDatastoreItemRequestData() + .attributes( + new UpdateAppsDatastoreItemRequestDataAttributes() + .itemChanges( + new UpdateAppsDatastoreItemRequestDataAttributesItemChanges()) + .itemKey("test-key")) + .type(UpdateAppsDatastoreItemRequestDataType.ITEMS)); + + try { + ItemApiPayload result = apiInstance.updateDatastoreItem(DATASTORE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ActionsDatastoresApi#updateDatastoreItem"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/ActionsDatastoresApi.java b/src/main/java/com/datadog/api/client/v2/api/ActionsDatastoresApi.java new file mode 100644 index 00000000000..b4dbd96c55f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/ActionsDatastoresApi.java @@ -0,0 +1,1481 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.BulkPutAppsDatastoreItemsRequest; +import com.datadog.api.client.v2.model.CreateAppsDatastoreRequest; +import com.datadog.api.client.v2.model.CreateAppsDatastoreResponse; +import com.datadog.api.client.v2.model.Datastore; +import com.datadog.api.client.v2.model.DatastoreArray; +import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemRequest; +import com.datadog.api.client.v2.model.DeleteAppsDatastoreItemResponse; +import com.datadog.api.client.v2.model.ItemApiPayload; +import com.datadog.api.client.v2.model.ItemApiPayloadArray; +import com.datadog.api.client.v2.model.PutAppsDatastoreItemResponseArray; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreItemRequest; +import com.datadog.api.client.v2.model.UpdateAppsDatastoreRequest; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ActionsDatastoresApi { + private ApiClient apiClient; + + public ActionsDatastoresApi() { + this(ApiClient.getDefaultApiClient()); + } + + public ActionsDatastoresApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Bulk write datastore items. + * + *

See {@link #bulkWriteDatastoreItemsWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return PutAppsDatastoreItemResponseArray + * @throws ApiException if fails to make API call + */ + public PutAppsDatastoreItemResponseArray bulkWriteDatastoreItems( + String datastoreId, BulkPutAppsDatastoreItemsRequest body) throws ApiException { + return bulkWriteDatastoreItemsWithHttpInfo(datastoreId, body).getData(); + } + + /** + * Bulk write datastore items. + * + *

See {@link #bulkWriteDatastoreItemsWithHttpInfoAsync}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return CompletableFuture<PutAppsDatastoreItemResponseArray> + */ + public CompletableFuture bulkWriteDatastoreItemsAsync( + String datastoreId, BulkPutAppsDatastoreItemsRequest body) { + return bulkWriteDatastoreItemsWithHttpInfoAsync(datastoreId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Creates or replaces multiple items in a datastore by their keys in a single operation. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return ApiResponse<PutAppsDatastoreItemResponseArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse bulkWriteDatastoreItemsWithHttpInfo( + String datastoreId, BulkPutAppsDatastoreItemsRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + throw new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling bulkWriteDatastoreItems"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling bulkWriteDatastoreItems"); + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}/items/bulk" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.bulkWriteDatastoreItems", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Bulk write datastore items. + * + *

See {@link #bulkWriteDatastoreItemsWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<PutAppsDatastoreItemResponseArray>> + */ + public CompletableFuture> + bulkWriteDatastoreItemsWithHttpInfoAsync( + String datastoreId, BulkPutAppsDatastoreItemsRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'datastoreId' when calling bulkWriteDatastoreItems")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling bulkWriteDatastoreItems")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}/items/bulk" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.bulkWriteDatastoreItems", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create datastore. + * + *

See {@link #createDatastoreWithHttpInfo}. + * + * @param body (required) + * @return CreateAppsDatastoreResponse + * @throws ApiException if fails to make API call + */ + public CreateAppsDatastoreResponse createDatastore(CreateAppsDatastoreRequest body) + throws ApiException { + return createDatastoreWithHttpInfo(body).getData(); + } + + /** + * Create datastore. + * + *

See {@link #createDatastoreWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<CreateAppsDatastoreResponse> + */ + public CompletableFuture createDatastoreAsync( + CreateAppsDatastoreRequest body) { + return createDatastoreWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Creates a new datastore. + * + * @param body (required) + * @return ApiResponse<CreateAppsDatastoreResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse createDatastoreWithHttpInfo( + CreateAppsDatastoreRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createDatastore"); + } + // create path and map variables + String localVarPath = "/api/v2/actions-datastores"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.createDatastore", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create datastore. + * + *

See {@link #createDatastoreWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<CreateAppsDatastoreResponse>> + */ + public CompletableFuture> + createDatastoreWithHttpInfoAsync(CreateAppsDatastoreRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createDatastore")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/actions-datastores"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.createDatastore", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete datastore. + * + *

See {@link #deleteDatastoreWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @throws ApiException if fails to make API call + */ + public void deleteDatastore(String datastoreId) throws ApiException { + deleteDatastoreWithHttpInfo(datastoreId); + } + + /** + * Delete datastore. + * + *

See {@link #deleteDatastoreWithHttpInfoAsync}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteDatastoreAsync(String datastoreId) { + return deleteDatastoreWithHttpInfoAsync(datastoreId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Deletes a datastore by its unique identifier. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse deleteDatastoreWithHttpInfo(String datastoreId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + throw new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling deleteDatastore"); + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.deleteDatastore", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete datastore. + * + *

See {@link #deleteDatastoreWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteDatastoreWithHttpInfoAsync(String datastoreId) { + Object localVarPostBody = null; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling deleteDatastore")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.deleteDatastore", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete datastore item. + * + *

See {@link #deleteDatastoreItemWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return DeleteAppsDatastoreItemResponse + * @throws ApiException if fails to make API call + */ + public DeleteAppsDatastoreItemResponse deleteDatastoreItem( + String datastoreId, DeleteAppsDatastoreItemRequest body) throws ApiException { + return deleteDatastoreItemWithHttpInfo(datastoreId, body).getData(); + } + + /** + * Delete datastore item. + * + *

See {@link #deleteDatastoreItemWithHttpInfoAsync}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return CompletableFuture<DeleteAppsDatastoreItemResponse> + */ + public CompletableFuture deleteDatastoreItemAsync( + String datastoreId, DeleteAppsDatastoreItemRequest body) { + return deleteDatastoreItemWithHttpInfoAsync(datastoreId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Deletes an item from a datastore by its key. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return ApiResponse<DeleteAppsDatastoreItemResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteDatastoreItemWithHttpInfo( + String datastoreId, DeleteAppsDatastoreItemRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + throw new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling deleteDatastoreItem"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling deleteDatastoreItem"); + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}/items" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.deleteDatastoreItem", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete datastore item. + * + *

See {@link #deleteDatastoreItemWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<DeleteAppsDatastoreItemResponse>> + */ + public CompletableFuture> + deleteDatastoreItemWithHttpInfoAsync( + String datastoreId, DeleteAppsDatastoreItemRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'datastoreId' when calling deleteDatastoreItem")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling deleteDatastoreItem")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}/items" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.deleteDatastoreItem", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get datastore. + * + *

See {@link #getDatastoreWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @return Datastore + * @throws ApiException if fails to make API call + */ + public Datastore getDatastore(String datastoreId) throws ApiException { + return getDatastoreWithHttpInfo(datastoreId).getData(); + } + + /** + * Get datastore. + * + *

See {@link #getDatastoreWithHttpInfoAsync}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @return CompletableFuture<Datastore> + */ + public CompletableFuture getDatastoreAsync(String datastoreId) { + return getDatastoreWithHttpInfoAsync(datastoreId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieves a specific datastore by its ID. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @return ApiResponse<Datastore> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getDatastoreWithHttpInfo(String datastoreId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + throw new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling getDatastore"); + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.getDatastore", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get datastore. + * + *

See {@link #getDatastoreWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @return CompletableFuture<ApiResponse<Datastore>> + */ + public CompletableFuture> getDatastoreWithHttpInfoAsync( + String datastoreId) { + Object localVarPostBody = null; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling getDatastore")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.getDatastore", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listDatastoreItems. */ + public static class ListDatastoreItemsOptionalParameters { + private String filter; + private String itemKey; + private Long pageLimit; + private Long pageOffset; + private String sort; + + /** + * Set filter. + * + * @param filter Optional query filter to search items using the logs search syntax. + * (optional) + * @return ListDatastoreItemsOptionalParameters + */ + public ListDatastoreItemsOptionalParameters filter(String filter) { + this.filter = filter; + return this; + } + + /** + * Set itemKey. + * + * @param itemKey Optional primary key value to retrieve a specific item. Cannot be used + * together with the filter parameter. (optional) + * @return ListDatastoreItemsOptionalParameters + */ + public ListDatastoreItemsOptionalParameters itemKey(String itemKey) { + this.itemKey = itemKey; + return this; + } + + /** + * Set pageLimit. + * + * @param pageLimit Optional field to limit the number of items to return per page for + * pagination. Up to 100 items can be returned per page. (optional) + * @return ListDatastoreItemsOptionalParameters + */ + public ListDatastoreItemsOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; + return this; + } + + /** + * Set pageOffset. + * + * @param pageOffset Optional field to offset the number of items to skip from the beginning of + * the result set for pagination. (optional) + * @return ListDatastoreItemsOptionalParameters + */ + public ListDatastoreItemsOptionalParameters pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + + /** + * Set sort. + * + * @param sort Optional field to sort results by. Prefix with '-' for descending order (e.g., + * '-created_at'). (optional) + * @return ListDatastoreItemsOptionalParameters + */ + public ListDatastoreItemsOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + } + + /** + * List datastore items. + * + *

See {@link #listDatastoreItemsWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @return ItemApiPayloadArray + * @throws ApiException if fails to make API call + */ + public ItemApiPayloadArray listDatastoreItems(String datastoreId) throws ApiException { + return listDatastoreItemsWithHttpInfo(datastoreId, new ListDatastoreItemsOptionalParameters()) + .getData(); + } + + /** + * List datastore items. + * + *

See {@link #listDatastoreItemsWithHttpInfoAsync}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @return CompletableFuture<ItemApiPayloadArray> + */ + public CompletableFuture listDatastoreItemsAsync(String datastoreId) { + return listDatastoreItemsWithHttpInfoAsync( + datastoreId, new ListDatastoreItemsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List datastore items. + * + *

See {@link #listDatastoreItemsWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return ItemApiPayloadArray + * @throws ApiException if fails to make API call + */ + public ItemApiPayloadArray listDatastoreItems( + String datastoreId, ListDatastoreItemsOptionalParameters parameters) throws ApiException { + return listDatastoreItemsWithHttpInfo(datastoreId, parameters).getData(); + } + + /** + * List datastore items. + * + *

See {@link #listDatastoreItemsWithHttpInfoAsync}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ItemApiPayloadArray> + */ + public CompletableFuture listDatastoreItemsAsync( + String datastoreId, ListDatastoreItemsOptionalParameters parameters) { + return listDatastoreItemsWithHttpInfoAsync(datastoreId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Lists items from a datastore. You can filter the results by specifying either an item key or a + * filter query parameter, but not both at the same time. Supports server-side pagination for + * large datasets. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<ItemApiPayloadArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listDatastoreItemsWithHttpInfo( + String datastoreId, ListDatastoreItemsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + throw new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling listDatastoreItems"); + } + String filter = parameters.filter; + String itemKey = parameters.itemKey; + Long pageLimit = parameters.pageLimit; + Long pageOffset = parameters.pageOffset; + String sort = parameters.sort; + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}/items" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "item_key", itemKey)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.listDatastoreItems", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List datastore items. + * + *

See {@link #listDatastoreItemsWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ItemApiPayloadArray>> + */ + public CompletableFuture> listDatastoreItemsWithHttpInfoAsync( + String datastoreId, ListDatastoreItemsOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling listDatastoreItems")); + return result; + } + String filter = parameters.filter; + String itemKey = parameters.itemKey; + Long pageLimit = parameters.pageLimit; + Long pageOffset = parameters.pageOffset; + String sort = parameters.sort; + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}/items" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "item_key", itemKey)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.listDatastoreItems", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List datastores. + * + *

See {@link #listDatastoresWithHttpInfo}. + * + * @return DatastoreArray + * @throws ApiException if fails to make API call + */ + public DatastoreArray listDatastores() throws ApiException { + return listDatastoresWithHttpInfo().getData(); + } + + /** + * List datastores. + * + *

See {@link #listDatastoresWithHttpInfoAsync}. + * + * @return CompletableFuture<DatastoreArray> + */ + public CompletableFuture listDatastoresAsync() { + return listDatastoresWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Lists all datastores for the organization. + * + * @return ApiResponse<DatastoreArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse listDatastoresWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/actions-datastores"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.listDatastores", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List datastores. + * + *

See {@link #listDatastoresWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<DatastoreArray>> + */ + public CompletableFuture> listDatastoresWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/actions-datastores"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.listDatastores", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update datastore. + * + *

See {@link #updateDatastoreWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return Datastore + * @throws ApiException if fails to make API call + */ + public Datastore updateDatastore(String datastoreId, UpdateAppsDatastoreRequest body) + throws ApiException { + return updateDatastoreWithHttpInfo(datastoreId, body).getData(); + } + + /** + * Update datastore. + * + *

See {@link #updateDatastoreWithHttpInfoAsync}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return CompletableFuture<Datastore> + */ + public CompletableFuture updateDatastoreAsync( + String datastoreId, UpdateAppsDatastoreRequest body) { + return updateDatastoreWithHttpInfoAsync(datastoreId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Updates an existing datastore's attributes. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return ApiResponse<Datastore> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateDatastoreWithHttpInfo( + String datastoreId, UpdateAppsDatastoreRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + throw new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling updateDatastore"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateDatastore"); + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.updateDatastore", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update datastore. + * + *

See {@link #updateDatastoreWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Datastore>> + */ + public CompletableFuture> updateDatastoreWithHttpInfoAsync( + String datastoreId, UpdateAppsDatastoreRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling updateDatastore")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateDatastore")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.updateDatastore", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update datastore item. + * + *

See {@link #updateDatastoreItemWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return ItemApiPayload + * @throws ApiException if fails to make API call + */ + public ItemApiPayload updateDatastoreItem(String datastoreId, UpdateAppsDatastoreItemRequest body) + throws ApiException { + return updateDatastoreItemWithHttpInfo(datastoreId, body).getData(); + } + + /** + * Update datastore item. + * + *

See {@link #updateDatastoreItemWithHttpInfoAsync}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return CompletableFuture<ItemApiPayload> + */ + public CompletableFuture updateDatastoreItemAsync( + String datastoreId, UpdateAppsDatastoreItemRequest body) { + return updateDatastoreItemWithHttpInfoAsync(datastoreId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Partially updates an item in a datastore by its key. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return ApiResponse<ItemApiPayload> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateDatastoreItemWithHttpInfo( + String datastoreId, UpdateAppsDatastoreItemRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + throw new ApiException( + 400, "Missing the required parameter 'datastoreId' when calling updateDatastoreItem"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateDatastoreItem"); + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}/items" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.updateDatastoreItem", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update datastore item. + * + *

See {@link #updateDatastoreItemWithHttpInfo}. + * + * @param datastoreId The unique identifier of the datastore to retrieve. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<ItemApiPayload>> + */ + public CompletableFuture> updateDatastoreItemWithHttpInfoAsync( + String datastoreId, UpdateAppsDatastoreItemRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'datastoreId' is set + if (datastoreId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'datastoreId' when calling updateDatastoreItem")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateDatastoreItem")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/actions-datastores/{datastore_id}/items" + .replaceAll( + "\\{" + "datastore_id" + "\\}", apiClient.escapeString(datastoreId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ActionsDatastoresApi.updateDatastoreItem", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequest.java b/src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequest.java new file mode 100644 index 00000000000..618e611ab80 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequest.java @@ -0,0 +1,139 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to insert multiple items into a datastore in a single operation. */ +@JsonPropertyOrder({BulkPutAppsDatastoreItemsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BulkPutAppsDatastoreItemsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private BulkPutAppsDatastoreItemsRequestData data; + + public BulkPutAppsDatastoreItemsRequest data(BulkPutAppsDatastoreItemsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data wrapper containing the items to insert and their configuration for the bulk insert + * operation. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BulkPutAppsDatastoreItemsRequestData getData() { + return data; + } + + public void setData(BulkPutAppsDatastoreItemsRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return BulkPutAppsDatastoreItemsRequest + */ + @JsonAnySetter + public BulkPutAppsDatastoreItemsRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this BulkPutAppsDatastoreItemsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkPutAppsDatastoreItemsRequest bulkPutAppsDatastoreItemsRequest = + (BulkPutAppsDatastoreItemsRequest) o; + return Objects.equals(this.data, bulkPutAppsDatastoreItemsRequest.data) + && Objects.equals( + this.additionalProperties, bulkPutAppsDatastoreItemsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkPutAppsDatastoreItemsRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequestData.java b/src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequestData.java new file mode 100644 index 00000000000..0a9a6fa0b31 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequestData.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Data wrapper containing the items to insert and their configuration for the bulk insert + * operation. + */ +@JsonPropertyOrder({ + BulkPutAppsDatastoreItemsRequestData.JSON_PROPERTY_ATTRIBUTES, + BulkPutAppsDatastoreItemsRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BulkPutAppsDatastoreItemsRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private BulkPutAppsDatastoreItemsRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DatastoreItemsDataType type = DatastoreItemsDataType.ITEMS; + + public BulkPutAppsDatastoreItemsRequestData() {} + + @JsonCreator + public BulkPutAppsDatastoreItemsRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public BulkPutAppsDatastoreItemsRequestData attributes( + BulkPutAppsDatastoreItemsRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Configuration for bulk inserting multiple items into a datastore. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BulkPutAppsDatastoreItemsRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(BulkPutAppsDatastoreItemsRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public BulkPutAppsDatastoreItemsRequestData type(DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastore items. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreItemsDataType getType() { + return type; + } + + public void setType(DatastoreItemsDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return BulkPutAppsDatastoreItemsRequestData + */ + @JsonAnySetter + public BulkPutAppsDatastoreItemsRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this BulkPutAppsDatastoreItemsRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkPutAppsDatastoreItemsRequestData bulkPutAppsDatastoreItemsRequestData = + (BulkPutAppsDatastoreItemsRequestData) o; + return Objects.equals(this.attributes, bulkPutAppsDatastoreItemsRequestData.attributes) + && Objects.equals(this.type, bulkPutAppsDatastoreItemsRequestData.type) + && Objects.equals( + this.additionalProperties, bulkPutAppsDatastoreItemsRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkPutAppsDatastoreItemsRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequestDataAttributes.java new file mode 100644 index 00000000000..2ec5188e01b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/BulkPutAppsDatastoreItemsRequestDataAttributes.java @@ -0,0 +1,192 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Configuration for bulk inserting multiple items into a datastore. */ +@JsonPropertyOrder({ + BulkPutAppsDatastoreItemsRequestDataAttributes.JSON_PROPERTY_CONFLICT_MODE, + BulkPutAppsDatastoreItemsRequestDataAttributes.JSON_PROPERTY_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BulkPutAppsDatastoreItemsRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONFLICT_MODE = "conflict_mode"; + private DatastoreItemConflictMode conflictMode; + + public static final String JSON_PROPERTY_VALUES = "values"; + private List> values = new ArrayList<>(); + + public BulkPutAppsDatastoreItemsRequestDataAttributes() {} + + @JsonCreator + public BulkPutAppsDatastoreItemsRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_VALUES) + List> values) { + this.values = values; + } + + public BulkPutAppsDatastoreItemsRequestDataAttributes conflictMode( + DatastoreItemConflictMode conflictMode) { + this.conflictMode = conflictMode; + this.unparsed |= !conflictMode.isValid(); + return this; + } + + /** + * How to handle conflicts when inserting items that already exist in the datastore. + * + * @return conflictMode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFLICT_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreItemConflictMode getConflictMode() { + return conflictMode; + } + + public void setConflictMode(DatastoreItemConflictMode conflictMode) { + if (!conflictMode.isValid()) { + this.unparsed = true; + } + this.conflictMode = conflictMode; + } + + public BulkPutAppsDatastoreItemsRequestDataAttributes values(List> values) { + this.values = values; + return this; + } + + public BulkPutAppsDatastoreItemsRequestDataAttributes addValuesItem( + Map valuesItem) { + this.values.add(valuesItem); + return this; + } + + /** + * An array of items to add to the datastore, where each item is a set of key-value pairs + * representing the item's data. Up to 100 items can be updated in a single request. + * + * @return values + */ + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List> getValues() { + return values; + } + + public void setValues(List> values) { + this.values = values; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return BulkPutAppsDatastoreItemsRequestDataAttributes + */ + @JsonAnySetter + public BulkPutAppsDatastoreItemsRequestDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this BulkPutAppsDatastoreItemsRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkPutAppsDatastoreItemsRequestDataAttributes bulkPutAppsDatastoreItemsRequestDataAttributes = + (BulkPutAppsDatastoreItemsRequestDataAttributes) o; + return Objects.equals( + this.conflictMode, bulkPutAppsDatastoreItemsRequestDataAttributes.conflictMode) + && Objects.equals(this.values, bulkPutAppsDatastoreItemsRequestDataAttributes.values) + && Objects.equals( + this.additionalProperties, + bulkPutAppsDatastoreItemsRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conflictMode, values, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkPutAppsDatastoreItemsRequestDataAttributes {\n"); + sb.append(" conflictMode: ").append(toIndentedString(conflictMode)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequest.java new file mode 100644 index 00000000000..635062122dd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequest.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to create a new datastore with specified configuration and metadata. */ +@JsonPropertyOrder({CreateAppsDatastoreRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateAppsDatastoreRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateAppsDatastoreRequestData data; + + public CreateAppsDatastoreRequest data(CreateAppsDatastoreRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data wrapper containing the configuration needed to create a new datastore. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateAppsDatastoreRequestData getData() { + return data; + } + + public void setData(CreateAppsDatastoreRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateAppsDatastoreRequest + */ + @JsonAnySetter + public CreateAppsDatastoreRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateAppsDatastoreRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAppsDatastoreRequest createAppsDatastoreRequest = (CreateAppsDatastoreRequest) o; + return Objects.equals(this.data, createAppsDatastoreRequest.data) + && Objects.equals( + this.additionalProperties, createAppsDatastoreRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAppsDatastoreRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestData.java new file mode 100644 index 00000000000..9562ef879d5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestData.java @@ -0,0 +1,208 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data wrapper containing the configuration needed to create a new datastore. */ +@JsonPropertyOrder({ + CreateAppsDatastoreRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateAppsDatastoreRequestData.JSON_PROPERTY_ID, + CreateAppsDatastoreRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateAppsDatastoreRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateAppsDatastoreRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DatastoreDataType type = DatastoreDataType.DATASTORES; + + public CreateAppsDatastoreRequestData() {} + + @JsonCreator + public CreateAppsDatastoreRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DatastoreDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateAppsDatastoreRequestData attributes( + CreateAppsDatastoreRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Configuration and metadata to create a new datastore. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateAppsDatastoreRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateAppsDatastoreRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateAppsDatastoreRequestData id(String id) { + this.id = id; + return this; + } + + /** + * Optional ID for the new datastore. If not provided, one will be generated automatically. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CreateAppsDatastoreRequestData type(DatastoreDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastores. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreDataType getType() { + return type; + } + + public void setType(DatastoreDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateAppsDatastoreRequestData + */ + @JsonAnySetter + public CreateAppsDatastoreRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateAppsDatastoreRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAppsDatastoreRequestData createAppsDatastoreRequestData = + (CreateAppsDatastoreRequestData) o; + return Objects.equals(this.attributes, createAppsDatastoreRequestData.attributes) + && Objects.equals(this.id, createAppsDatastoreRequestData.id) + && Objects.equals(this.type, createAppsDatastoreRequestData.type) + && Objects.equals( + this.additionalProperties, createAppsDatastoreRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAppsDatastoreRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestDataAttributes.java new file mode 100644 index 00000000000..8d9b80757f9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestDataAttributes.java @@ -0,0 +1,285 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Configuration and metadata to create a new datastore. */ +@JsonPropertyOrder({ + CreateAppsDatastoreRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + CreateAppsDatastoreRequestDataAttributes.JSON_PROPERTY_NAME, + CreateAppsDatastoreRequestDataAttributes.JSON_PROPERTY_ORG_ACCESS, + CreateAppsDatastoreRequestDataAttributes.JSON_PROPERTY_PRIMARY_COLUMN_NAME, + CreateAppsDatastoreRequestDataAttributes.JSON_PROPERTY_PRIMARY_KEY_GENERATION_STRATEGY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateAppsDatastoreRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ORG_ACCESS = "org_access"; + private CreateAppsDatastoreRequestDataAttributesOrgAccess orgAccess; + + public static final String JSON_PROPERTY_PRIMARY_COLUMN_NAME = "primary_column_name"; + private String primaryColumnName; + + public static final String JSON_PROPERTY_PRIMARY_KEY_GENERATION_STRATEGY = + "primary_key_generation_strategy"; + private DatastorePrimaryKeyGenerationStrategy primaryKeyGenerationStrategy; + + public CreateAppsDatastoreRequestDataAttributes() {} + + @JsonCreator + public CreateAppsDatastoreRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PRIMARY_COLUMN_NAME) + String primaryColumnName) { + this.name = name; + this.primaryColumnName = primaryColumnName; + } + + public CreateAppsDatastoreRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A human-readable description about the datastore. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateAppsDatastoreRequestDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The display name for the new datastore. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateAppsDatastoreRequestDataAttributes orgAccess( + CreateAppsDatastoreRequestDataAttributesOrgAccess orgAccess) { + this.orgAccess = orgAccess; + this.unparsed |= !orgAccess.isValid(); + return this; + } + + /** + * The organization access level for the datastore. For example, 'contributor'. + * + * @return orgAccess + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORG_ACCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateAppsDatastoreRequestDataAttributesOrgAccess getOrgAccess() { + return orgAccess; + } + + public void setOrgAccess(CreateAppsDatastoreRequestDataAttributesOrgAccess orgAccess) { + if (!orgAccess.isValid()) { + this.unparsed = true; + } + this.orgAccess = orgAccess; + } + + public CreateAppsDatastoreRequestDataAttributes primaryColumnName(String primaryColumnName) { + this.primaryColumnName = primaryColumnName; + return this; + } + + /** + * The name of the primary key column for this datastore. Primary column names: - Must abide by + * both PostgreSQL naming + * conventions - Cannot exceed 63 characters + * + * @return primaryColumnName + */ + @JsonProperty(JSON_PROPERTY_PRIMARY_COLUMN_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPrimaryColumnName() { + return primaryColumnName; + } + + public void setPrimaryColumnName(String primaryColumnName) { + this.primaryColumnName = primaryColumnName; + } + + public CreateAppsDatastoreRequestDataAttributes primaryKeyGenerationStrategy( + DatastorePrimaryKeyGenerationStrategy primaryKeyGenerationStrategy) { + this.primaryKeyGenerationStrategy = primaryKeyGenerationStrategy; + this.unparsed |= !primaryKeyGenerationStrategy.isValid(); + return this; + } + + /** + * Can be set to uuid to automatically generate primary keys when new items are + * added. Default value is none, which requires you to supply a primary key for each + * new item. + * + * @return primaryKeyGenerationStrategy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_KEY_GENERATION_STRATEGY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastorePrimaryKeyGenerationStrategy getPrimaryKeyGenerationStrategy() { + return primaryKeyGenerationStrategy; + } + + public void setPrimaryKeyGenerationStrategy( + DatastorePrimaryKeyGenerationStrategy primaryKeyGenerationStrategy) { + if (!primaryKeyGenerationStrategy.isValid()) { + this.unparsed = true; + } + this.primaryKeyGenerationStrategy = primaryKeyGenerationStrategy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateAppsDatastoreRequestDataAttributes + */ + @JsonAnySetter + public CreateAppsDatastoreRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateAppsDatastoreRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAppsDatastoreRequestDataAttributes createAppsDatastoreRequestDataAttributes = + (CreateAppsDatastoreRequestDataAttributes) o; + return Objects.equals(this.description, createAppsDatastoreRequestDataAttributes.description) + && Objects.equals(this.name, createAppsDatastoreRequestDataAttributes.name) + && Objects.equals(this.orgAccess, createAppsDatastoreRequestDataAttributes.orgAccess) + && Objects.equals( + this.primaryColumnName, createAppsDatastoreRequestDataAttributes.primaryColumnName) + && Objects.equals( + this.primaryKeyGenerationStrategy, + createAppsDatastoreRequestDataAttributes.primaryKeyGenerationStrategy) + && Objects.equals( + this.additionalProperties, + createAppsDatastoreRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + name, + orgAccess, + primaryColumnName, + primaryKeyGenerationStrategy, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAppsDatastoreRequestDataAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" orgAccess: ").append(toIndentedString(orgAccess)).append("\n"); + sb.append(" primaryColumnName: ").append(toIndentedString(primaryColumnName)).append("\n"); + sb.append(" primaryKeyGenerationStrategy: ") + .append(toIndentedString(primaryKeyGenerationStrategy)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestDataAttributesOrgAccess.java b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestDataAttributesOrgAccess.java new file mode 100644 index 00000000000..0059d6e7d36 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreRequestDataAttributesOrgAccess.java @@ -0,0 +1,67 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The organization access level for the datastore. For example, 'contributor'. */ +@JsonSerialize( + using = + CreateAppsDatastoreRequestDataAttributesOrgAccess + .CreateAppsDatastoreRequestDataAttributesOrgAccessSerializer.class) +public class CreateAppsDatastoreRequestDataAttributesOrgAccess extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("contributor", "viewer", "manager")); + + public static final CreateAppsDatastoreRequestDataAttributesOrgAccess CONTRIBUTOR = + new CreateAppsDatastoreRequestDataAttributesOrgAccess("contributor"); + public static final CreateAppsDatastoreRequestDataAttributesOrgAccess VIEWER = + new CreateAppsDatastoreRequestDataAttributesOrgAccess("viewer"); + public static final CreateAppsDatastoreRequestDataAttributesOrgAccess MANAGER = + new CreateAppsDatastoreRequestDataAttributesOrgAccess("manager"); + + CreateAppsDatastoreRequestDataAttributesOrgAccess(String value) { + super(value, allowedValues); + } + + public static class CreateAppsDatastoreRequestDataAttributesOrgAccessSerializer + extends StdSerializer { + public CreateAppsDatastoreRequestDataAttributesOrgAccessSerializer( + Class t) { + super(t); + } + + public CreateAppsDatastoreRequestDataAttributesOrgAccessSerializer() { + this(null); + } + + @Override + public void serialize( + CreateAppsDatastoreRequestDataAttributesOrgAccess value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CreateAppsDatastoreRequestDataAttributesOrgAccess fromValue(String value) { + return new CreateAppsDatastoreRequestDataAttributesOrgAccess(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreResponse.java b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreResponse.java new file mode 100644 index 00000000000..a523f3897b9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreResponse.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response after successfully creating a new datastore, containing the datastore's assigned ID. */ +@JsonPropertyOrder({CreateAppsDatastoreResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateAppsDatastoreResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateAppsDatastoreResponseData data; + + public CreateAppsDatastoreResponse data(CreateAppsDatastoreResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The newly created datastore's data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateAppsDatastoreResponseData getData() { + return data; + } + + public void setData(CreateAppsDatastoreResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateAppsDatastoreResponse + */ + @JsonAnySetter + public CreateAppsDatastoreResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateAppsDatastoreResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAppsDatastoreResponse createAppsDatastoreResponse = (CreateAppsDatastoreResponse) o; + return Objects.equals(this.data, createAppsDatastoreResponse.data) + && Objects.equals( + this.additionalProperties, createAppsDatastoreResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAppsDatastoreResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreResponseData.java b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreResponseData.java new file mode 100644 index 00000000000..0d45c0442c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateAppsDatastoreResponseData.java @@ -0,0 +1,179 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The newly created datastore's data. */ +@JsonPropertyOrder({ + CreateAppsDatastoreResponseData.JSON_PROPERTY_ID, + CreateAppsDatastoreResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateAppsDatastoreResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DatastoreDataType type = DatastoreDataType.DATASTORES; + + public CreateAppsDatastoreResponseData() {} + + @JsonCreator + public CreateAppsDatastoreResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DatastoreDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateAppsDatastoreResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier assigned to the newly created datastore. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CreateAppsDatastoreResponseData type(DatastoreDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastores. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreDataType getType() { + return type; + } + + public void setType(DatastoreDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateAppsDatastoreResponseData + */ + @JsonAnySetter + public CreateAppsDatastoreResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateAppsDatastoreResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAppsDatastoreResponseData createAppsDatastoreResponseData = + (CreateAppsDatastoreResponseData) o; + return Objects.equals(this.id, createAppsDatastoreResponseData.id) + && Objects.equals(this.type, createAppsDatastoreResponseData.type) + && Objects.equals( + this.additionalProperties, createAppsDatastoreResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAppsDatastoreResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestAttributes.java index b5c1dfd4195..bfd20632f7b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORAFailureRequestAttributes.java @@ -150,8 +150,7 @@ public DORAFailureRequestAttributes finishedAt(Long finishedAt) { } /** - * Unix timestamp when the failure finished. It must be in nanoseconds, milliseconds, or seconds, - * and it should not be older than 1 hour. + * Unix timestamp when the failure finished. It must be in nanoseconds, milliseconds, or seconds. * * @return finishedAt */ diff --git a/src/main/java/com/datadog/api/client/v2/model/Datastore.java b/src/main/java/com/datadog/api/client/v2/model/Datastore.java new file mode 100644 index 00000000000..143b243b236 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Datastore.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A datastore's complete configuration and metadata. */ +@JsonPropertyOrder({Datastore.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Datastore { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DatastoreData data; + + public Datastore data(DatastoreData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Core information about a datastore, including its unique identifier and attributes. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreData getData() { + return data; + } + + public void setData(DatastoreData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return Datastore + */ + @JsonAnySetter + public Datastore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Datastore object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Datastore datastore = (Datastore) o; + return Objects.equals(this.data, datastore.data) + && Objects.equals(this.additionalProperties, datastore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Datastore {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DatastoreArray.java b/src/main/java/com/datadog/api/client/v2/model/DatastoreArray.java new file mode 100644 index 00000000000..fa3f2deee7b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DatastoreArray.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A collection of datastores returned by list operations. */ +@JsonPropertyOrder({DatastoreArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DatastoreArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public DatastoreArray() {} + + @JsonCreator + public DatastoreArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public DatastoreArray data(List data) { + this.data = data; + for (DatastoreData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DatastoreArray addDataItem(DatastoreData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of datastore objects containing their configurations and metadata. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DatastoreArray + */ + @JsonAnySetter + public DatastoreArray putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DatastoreArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreArray datastoreArray = (DatastoreArray) o; + return Objects.equals(this.data, datastoreArray.data) + && Objects.equals(this.additionalProperties, datastoreArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreArray {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DatastoreData.java b/src/main/java/com/datadog/api/client/v2/model/DatastoreData.java new file mode 100644 index 00000000000..bca9e656a7b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DatastoreData.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Core information about a datastore, including its unique identifier and attributes. */ +@JsonPropertyOrder({ + DatastoreData.JSON_PROPERTY_ATTRIBUTES, + DatastoreData.JSON_PROPERTY_ID, + DatastoreData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DatastoreData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DatastoreDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DatastoreDataType type = DatastoreDataType.DATASTORES; + + public DatastoreData() {} + + @JsonCreator + public DatastoreData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DatastoreDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DatastoreData attributes(DatastoreDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Detailed information about a datastore. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastoreDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DatastoreDataAttributes attributes) { + this.attributes = attributes; + } + + public DatastoreData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the datastore. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DatastoreData type(DatastoreDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastores. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreDataType getType() { + return type; + } + + public void setType(DatastoreDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DatastoreData + */ + @JsonAnySetter + public DatastoreData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DatastoreData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreData datastoreData = (DatastoreData) o; + return Objects.equals(this.attributes, datastoreData.attributes) + && Objects.equals(this.id, datastoreData.id) + && Objects.equals(this.type, datastoreData.type) + && Objects.equals(this.additionalProperties, datastoreData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DatastoreDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DatastoreDataAttributes.java new file mode 100644 index 00000000000..1f68fb1280a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DatastoreDataAttributes.java @@ -0,0 +1,378 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Detailed information about a datastore. */ +@JsonPropertyOrder({ + DatastoreDataAttributes.JSON_PROPERTY_CREATED_AT, + DatastoreDataAttributes.JSON_PROPERTY_CREATOR_USER_ID, + DatastoreDataAttributes.JSON_PROPERTY_CREATOR_USER_UUID, + DatastoreDataAttributes.JSON_PROPERTY_DESCRIPTION, + DatastoreDataAttributes.JSON_PROPERTY_MODIFIED_AT, + DatastoreDataAttributes.JSON_PROPERTY_NAME, + DatastoreDataAttributes.JSON_PROPERTY_ORG_ID, + DatastoreDataAttributes.JSON_PROPERTY_PRIMARY_COLUMN_NAME, + DatastoreDataAttributes.JSON_PROPERTY_PRIMARY_KEY_GENERATION_STRATEGY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DatastoreDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATOR_USER_ID = "creator_user_id"; + private Long creatorUserId; + + public static final String JSON_PROPERTY_CREATOR_USER_UUID = "creator_user_uuid"; + private String creatorUserUuid; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ORG_ID = "org_id"; + private Long orgId; + + public static final String JSON_PROPERTY_PRIMARY_COLUMN_NAME = "primary_column_name"; + private String primaryColumnName; + + public static final String JSON_PROPERTY_PRIMARY_KEY_GENERATION_STRATEGY = + "primary_key_generation_strategy"; + private DatastorePrimaryKeyGenerationStrategy primaryKeyGenerationStrategy; + + public DatastoreDataAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the datastore was created. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public DatastoreDataAttributes creatorUserId(Long creatorUserId) { + this.creatorUserId = creatorUserId; + return this; + } + + /** + * The numeric ID of the user who created the datastore. + * + * @return creatorUserId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATOR_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCreatorUserId() { + return creatorUserId; + } + + public void setCreatorUserId(Long creatorUserId) { + this.creatorUserId = creatorUserId; + } + + public DatastoreDataAttributes creatorUserUuid(String creatorUserUuid) { + this.creatorUserUuid = creatorUserUuid; + return this; + } + + /** + * The UUID of the user who created the datastore. + * + * @return creatorUserUuid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATOR_USER_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreatorUserUuid() { + return creatorUserUuid; + } + + public void setCreatorUserUuid(String creatorUserUuid) { + this.creatorUserUuid = creatorUserUuid; + } + + public DatastoreDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A human-readable description about the datastore. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public DatastoreDataAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Timestamp when the datastore was last modified. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public DatastoreDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The display name of the datastore. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public DatastoreDataAttributes orgId(Long orgId) { + this.orgId = orgId; + return this; + } + + /** + * The ID of the organization that owns this datastore. + * + * @return orgId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORG_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOrgId() { + return orgId; + } + + public void setOrgId(Long orgId) { + this.orgId = orgId; + } + + public DatastoreDataAttributes primaryColumnName(String primaryColumnName) { + this.primaryColumnName = primaryColumnName; + return this; + } + + /** + * The name of the primary key column for this datastore. Primary column names: - Must abide by + * both PostgreSQL naming + * conventions - Cannot exceed 63 characters + * + * @return primaryColumnName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_COLUMN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryColumnName() { + return primaryColumnName; + } + + public void setPrimaryColumnName(String primaryColumnName) { + this.primaryColumnName = primaryColumnName; + } + + public DatastoreDataAttributes primaryKeyGenerationStrategy( + DatastorePrimaryKeyGenerationStrategy primaryKeyGenerationStrategy) { + this.primaryKeyGenerationStrategy = primaryKeyGenerationStrategy; + this.unparsed |= !primaryKeyGenerationStrategy.isValid(); + return this; + } + + /** + * Can be set to uuid to automatically generate primary keys when new items are + * added. Default value is none, which requires you to supply a primary key for each + * new item. + * + * @return primaryKeyGenerationStrategy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_KEY_GENERATION_STRATEGY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DatastorePrimaryKeyGenerationStrategy getPrimaryKeyGenerationStrategy() { + return primaryKeyGenerationStrategy; + } + + public void setPrimaryKeyGenerationStrategy( + DatastorePrimaryKeyGenerationStrategy primaryKeyGenerationStrategy) { + if (!primaryKeyGenerationStrategy.isValid()) { + this.unparsed = true; + } + this.primaryKeyGenerationStrategy = primaryKeyGenerationStrategy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DatastoreDataAttributes + */ + @JsonAnySetter + public DatastoreDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DatastoreDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatastoreDataAttributes datastoreDataAttributes = (DatastoreDataAttributes) o; + return Objects.equals(this.createdAt, datastoreDataAttributes.createdAt) + && Objects.equals(this.creatorUserId, datastoreDataAttributes.creatorUserId) + && Objects.equals(this.creatorUserUuid, datastoreDataAttributes.creatorUserUuid) + && Objects.equals(this.description, datastoreDataAttributes.description) + && Objects.equals(this.modifiedAt, datastoreDataAttributes.modifiedAt) + && Objects.equals(this.name, datastoreDataAttributes.name) + && Objects.equals(this.orgId, datastoreDataAttributes.orgId) + && Objects.equals(this.primaryColumnName, datastoreDataAttributes.primaryColumnName) + && Objects.equals( + this.primaryKeyGenerationStrategy, datastoreDataAttributes.primaryKeyGenerationStrategy) + && Objects.equals(this.additionalProperties, datastoreDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + creatorUserId, + creatorUserUuid, + description, + modifiedAt, + name, + orgId, + primaryColumnName, + primaryKeyGenerationStrategy, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatastoreDataAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" creatorUserId: ").append(toIndentedString(creatorUserId)).append("\n"); + sb.append(" creatorUserUuid: ").append(toIndentedString(creatorUserUuid)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" primaryColumnName: ").append(toIndentedString(primaryColumnName)).append("\n"); + sb.append(" primaryKeyGenerationStrategy: ") + .append(toIndentedString(primaryKeyGenerationStrategy)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DatastoreDataType.java b/src/main/java/com/datadog/api/client/v2/model/DatastoreDataType.java new file mode 100644 index 00000000000..29e3c7afdde --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DatastoreDataType.java @@ -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. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type for datastores. */ +@JsonSerialize(using = DatastoreDataType.DatastoreDataTypeSerializer.class) +public class DatastoreDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("datastores")); + + public static final DatastoreDataType DATASTORES = new DatastoreDataType("datastores"); + + DatastoreDataType(String value) { + super(value, allowedValues); + } + + public static class DatastoreDataTypeSerializer extends StdSerializer { + public DatastoreDataTypeSerializer(Class t) { + super(t); + } + + public DatastoreDataTypeSerializer() { + this(null); + } + + @Override + public void serialize(DatastoreDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DatastoreDataType fromValue(String value) { + return new DatastoreDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DatastoreItemConflictMode.java b/src/main/java/com/datadog/api/client/v2/model/DatastoreItemConflictMode.java new file mode 100644 index 00000000000..e1ecd9a41d8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DatastoreItemConflictMode.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** How to handle conflicts when inserting items that already exist in the datastore. */ +@JsonSerialize(using = DatastoreItemConflictMode.DatastoreItemConflictModeSerializer.class) +public class DatastoreItemConflictMode extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("fail_on_conflict", "overwrite_on_conflict")); + + public static final DatastoreItemConflictMode FAIL_ON_CONFLICT = + new DatastoreItemConflictMode("fail_on_conflict"); + public static final DatastoreItemConflictMode OVERWRITE_ON_CONFLICT = + new DatastoreItemConflictMode("overwrite_on_conflict"); + + DatastoreItemConflictMode(String value) { + super(value, allowedValues); + } + + public static class DatastoreItemConflictModeSerializer + extends StdSerializer { + public DatastoreItemConflictModeSerializer(Class t) { + super(t); + } + + public DatastoreItemConflictModeSerializer() { + this(null); + } + + @Override + public void serialize( + DatastoreItemConflictMode value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DatastoreItemConflictMode fromValue(String value) { + return new DatastoreItemConflictMode(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DatastoreItemsDataType.java b/src/main/java/com/datadog/api/client/v2/model/DatastoreItemsDataType.java new file mode 100644 index 00000000000..449bb1a233d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DatastoreItemsDataType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type for datastore items. */ +@JsonSerialize(using = DatastoreItemsDataType.DatastoreItemsDataTypeSerializer.class) +public class DatastoreItemsDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("items")); + + public static final DatastoreItemsDataType ITEMS = new DatastoreItemsDataType("items"); + + DatastoreItemsDataType(String value) { + super(value, allowedValues); + } + + public static class DatastoreItemsDataTypeSerializer + extends StdSerializer { + public DatastoreItemsDataTypeSerializer(Class t) { + super(t); + } + + public DatastoreItemsDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DatastoreItemsDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DatastoreItemsDataType fromValue(String value) { + return new DatastoreItemsDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DatastorePrimaryKeyGenerationStrategy.java b/src/main/java/com/datadog/api/client/v2/model/DatastorePrimaryKeyGenerationStrategy.java new file mode 100644 index 00000000000..73a882382fb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DatastorePrimaryKeyGenerationStrategy.java @@ -0,0 +1,67 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Can be set to uuid to automatically generate primary keys when new items are added. + * Default value is none, which requires you to supply a primary key for each new item. + */ +@JsonSerialize( + using = + DatastorePrimaryKeyGenerationStrategy.DatastorePrimaryKeyGenerationStrategySerializer.class) +public class DatastorePrimaryKeyGenerationStrategy extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("none", "uuid")); + + public static final DatastorePrimaryKeyGenerationStrategy NONE = + new DatastorePrimaryKeyGenerationStrategy("none"); + public static final DatastorePrimaryKeyGenerationStrategy UUID = + new DatastorePrimaryKeyGenerationStrategy("uuid"); + + DatastorePrimaryKeyGenerationStrategy(String value) { + super(value, allowedValues); + } + + public static class DatastorePrimaryKeyGenerationStrategySerializer + extends StdSerializer { + public DatastorePrimaryKeyGenerationStrategySerializer( + Class t) { + super(t); + } + + public DatastorePrimaryKeyGenerationStrategySerializer() { + this(null); + } + + @Override + public void serialize( + DatastorePrimaryKeyGenerationStrategy value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DatastorePrimaryKeyGenerationStrategy fromValue(String value) { + return new DatastorePrimaryKeyGenerationStrategy(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequest.java b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequest.java new file mode 100644 index 00000000000..161c5f7a709 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequest.java @@ -0,0 +1,139 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to delete a specific item from a datastore by its primary key. */ +@JsonPropertyOrder({DeleteAppsDatastoreItemRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeleteAppsDatastoreItemRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DeleteAppsDatastoreItemRequestData data; + + public DeleteAppsDatastoreItemRequest data(DeleteAppsDatastoreItemRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data wrapper containing the information needed to identify and delete a specific datastore + * item. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeleteAppsDatastoreItemRequestData getData() { + return data; + } + + public void setData(DeleteAppsDatastoreItemRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeleteAppsDatastoreItemRequest + */ + @JsonAnySetter + public DeleteAppsDatastoreItemRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeleteAppsDatastoreItemRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteAppsDatastoreItemRequest deleteAppsDatastoreItemRequest = + (DeleteAppsDatastoreItemRequest) o; + return Objects.equals(this.data, deleteAppsDatastoreItemRequest.data) + && Objects.equals( + this.additionalProperties, deleteAppsDatastoreItemRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteAppsDatastoreItemRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequestData.java b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequestData.java new file mode 100644 index 00000000000..6c8deeed9a5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequestData.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Data wrapper containing the information needed to identify and delete a specific datastore item. + */ +@JsonPropertyOrder({ + DeleteAppsDatastoreItemRequestData.JSON_PROPERTY_ATTRIBUTES, + DeleteAppsDatastoreItemRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeleteAppsDatastoreItemRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeleteAppsDatastoreItemRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DatastoreItemsDataType type = DatastoreItemsDataType.ITEMS; + + public DeleteAppsDatastoreItemRequestData() {} + + @JsonCreator + public DeleteAppsDatastoreItemRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeleteAppsDatastoreItemRequestData attributes( + DeleteAppsDatastoreItemRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes specifying which datastore item to delete by its primary key. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeleteAppsDatastoreItemRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeleteAppsDatastoreItemRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public DeleteAppsDatastoreItemRequestData type(DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastore items. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreItemsDataType getType() { + return type; + } + + public void setType(DatastoreItemsDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeleteAppsDatastoreItemRequestData + */ + @JsonAnySetter + public DeleteAppsDatastoreItemRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeleteAppsDatastoreItemRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteAppsDatastoreItemRequestData deleteAppsDatastoreItemRequestData = + (DeleteAppsDatastoreItemRequestData) o; + return Objects.equals(this.attributes, deleteAppsDatastoreItemRequestData.attributes) + && Objects.equals(this.type, deleteAppsDatastoreItemRequestData.type) + && Objects.equals( + this.additionalProperties, deleteAppsDatastoreItemRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteAppsDatastoreItemRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequestDataAttributes.java new file mode 100644 index 00000000000..31b41f51ad2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemRequestDataAttributes.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes specifying which datastore item to delete by its primary key. */ +@JsonPropertyOrder({ + DeleteAppsDatastoreItemRequestDataAttributes.JSON_PROPERTY_ID, + DeleteAppsDatastoreItemRequestDataAttributes.JSON_PROPERTY_ITEM_KEY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeleteAppsDatastoreItemRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_ITEM_KEY = "item_key"; + private String itemKey; + + public DeleteAppsDatastoreItemRequestDataAttributes() {} + + @JsonCreator + public DeleteAppsDatastoreItemRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ITEM_KEY) String itemKey) { + this.itemKey = itemKey; + } + + public DeleteAppsDatastoreItemRequestDataAttributes id(String id) { + this.id = id; + return this; + } + + /** + * Optional unique identifier of the item to delete. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeleteAppsDatastoreItemRequestDataAttributes itemKey(String itemKey) { + this.itemKey = itemKey; + return this; + } + + /** + * The primary key value that identifies the item to delete. Cannot exceed 256 characters. + * + * @return itemKey + */ + @JsonProperty(JSON_PROPERTY_ITEM_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getItemKey() { + return itemKey; + } + + public void setItemKey(String itemKey) { + this.itemKey = itemKey; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeleteAppsDatastoreItemRequestDataAttributes + */ + @JsonAnySetter + public DeleteAppsDatastoreItemRequestDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeleteAppsDatastoreItemRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteAppsDatastoreItemRequestDataAttributes deleteAppsDatastoreItemRequestDataAttributes = + (DeleteAppsDatastoreItemRequestDataAttributes) o; + return Objects.equals(this.id, deleteAppsDatastoreItemRequestDataAttributes.id) + && Objects.equals(this.itemKey, deleteAppsDatastoreItemRequestDataAttributes.itemKey) + && Objects.equals( + this.additionalProperties, + deleteAppsDatastoreItemRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, itemKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteAppsDatastoreItemRequestDataAttributes {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" itemKey: ").append(toIndentedString(itemKey)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemResponse.java new file mode 100644 index 00000000000..f932f646b0f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemResponse.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response from successfully deleting a datastore item. */ +@JsonPropertyOrder({DeleteAppsDatastoreItemResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeleteAppsDatastoreItemResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DeleteAppsDatastoreItemResponseData data; + + public DeleteAppsDatastoreItemResponse data(DeleteAppsDatastoreItemResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data containing the identifier of the datastore item that was successfully deleted. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeleteAppsDatastoreItemResponseData getData() { + return data; + } + + public void setData(DeleteAppsDatastoreItemResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeleteAppsDatastoreItemResponse + */ + @JsonAnySetter + public DeleteAppsDatastoreItemResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeleteAppsDatastoreItemResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteAppsDatastoreItemResponse deleteAppsDatastoreItemResponse = + (DeleteAppsDatastoreItemResponse) o; + return Objects.equals(this.data, deleteAppsDatastoreItemResponse.data) + && Objects.equals( + this.additionalProperties, deleteAppsDatastoreItemResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteAppsDatastoreItemResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemResponseData.java b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemResponseData.java new file mode 100644 index 00000000000..e423e6e4712 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeleteAppsDatastoreItemResponseData.java @@ -0,0 +1,179 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data containing the identifier of the datastore item that was successfully deleted. */ +@JsonPropertyOrder({ + DeleteAppsDatastoreItemResponseData.JSON_PROPERTY_ID, + DeleteAppsDatastoreItemResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeleteAppsDatastoreItemResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DatastoreItemsDataType type = DatastoreItemsDataType.ITEMS; + + public DeleteAppsDatastoreItemResponseData() {} + + @JsonCreator + public DeleteAppsDatastoreItemResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DeleteAppsDatastoreItemResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the item that was deleted. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeleteAppsDatastoreItemResponseData type(DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastore items. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreItemsDataType getType() { + return type; + } + + public void setType(DatastoreItemsDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeleteAppsDatastoreItemResponseData + */ + @JsonAnySetter + public DeleteAppsDatastoreItemResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DeleteAppsDatastoreItemResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteAppsDatastoreItemResponseData deleteAppsDatastoreItemResponseData = + (DeleteAppsDatastoreItemResponseData) o; + return Objects.equals(this.id, deleteAppsDatastoreItemResponseData.id) + && Objects.equals(this.type, deleteAppsDatastoreItemResponseData.type) + && Objects.equals( + this.additionalProperties, deleteAppsDatastoreItemResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteAppsDatastoreItemResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ItemApiPayload.java b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayload.java new file mode 100644 index 00000000000..9b4f8e1c2b6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayload.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A single datastore item with its content and metadata. */ +@JsonPropertyOrder({ItemApiPayload.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ItemApiPayload { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ItemApiPayloadData data; + + public ItemApiPayload data(ItemApiPayloadData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Core data and metadata for a single datastore item. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ItemApiPayloadData getData() { + return data; + } + + public void setData(ItemApiPayloadData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ItemApiPayload + */ + @JsonAnySetter + public ItemApiPayload putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ItemApiPayload object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemApiPayload itemApiPayload = (ItemApiPayload) o; + return Objects.equals(this.data, itemApiPayload.data) + && Objects.equals(this.additionalProperties, itemApiPayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemApiPayload {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadArray.java b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadArray.java new file mode 100644 index 00000000000..d2be938fa31 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadArray.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A collection of datastore items with pagination and schema metadata. */ +@JsonPropertyOrder({ItemApiPayloadArray.JSON_PROPERTY_DATA, ItemApiPayloadArray.JSON_PROPERTY_META}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ItemApiPayloadArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private ItemApiPayloadMeta meta; + + public ItemApiPayloadArray() {} + + @JsonCreator + public ItemApiPayloadArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public ItemApiPayloadArray data(List data) { + this.data = data; + for (ItemApiPayloadData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ItemApiPayloadArray addDataItem(ItemApiPayloadData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of datastore items with their content and metadata. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ItemApiPayloadArray meta(ItemApiPayloadMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Additional metadata about a collection of datastore items, including pagination and schema + * information. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ItemApiPayloadMeta getMeta() { + return meta; + } + + public void setMeta(ItemApiPayloadMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ItemApiPayloadArray + */ + @JsonAnySetter + public ItemApiPayloadArray putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ItemApiPayloadArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemApiPayloadArray itemApiPayloadArray = (ItemApiPayloadArray) o; + return Objects.equals(this.data, itemApiPayloadArray.data) + && Objects.equals(this.meta, itemApiPayloadArray.meta) + && Objects.equals(this.additionalProperties, itemApiPayloadArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemApiPayloadArray {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadData.java b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadData.java new file mode 100644 index 00000000000..babb030d3c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadData.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Core data and metadata for a single datastore item. */ +@JsonPropertyOrder({ + ItemApiPayloadData.JSON_PROPERTY_ATTRIBUTES, + ItemApiPayloadData.JSON_PROPERTY_ID, + ItemApiPayloadData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ItemApiPayloadData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ItemApiPayloadDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DatastoreItemsDataType type = DatastoreItemsDataType.ITEMS; + + public ItemApiPayloadData() {} + + @JsonCreator + public ItemApiPayloadData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ItemApiPayloadData attributes(ItemApiPayloadDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Metadata and content of a datastore item. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ItemApiPayloadDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ItemApiPayloadDataAttributes attributes) { + this.attributes = attributes; + } + + public ItemApiPayloadData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the datastore. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ItemApiPayloadData type(DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastore items. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreItemsDataType getType() { + return type; + } + + public void setType(DatastoreItemsDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ItemApiPayloadData + */ + @JsonAnySetter + public ItemApiPayloadData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ItemApiPayloadData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemApiPayloadData itemApiPayloadData = (ItemApiPayloadData) o; + return Objects.equals(this.attributes, itemApiPayloadData.attributes) + && Objects.equals(this.id, itemApiPayloadData.id) + && Objects.equals(this.type, itemApiPayloadData.type) + && Objects.equals(this.additionalProperties, itemApiPayloadData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemApiPayloadData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadDataAttributes.java new file mode 100644 index 00000000000..a9e7af67365 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadDataAttributes.java @@ -0,0 +1,319 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata and content of a datastore item. */ +@JsonPropertyOrder({ + ItemApiPayloadDataAttributes.JSON_PROPERTY_CREATED_AT, + ItemApiPayloadDataAttributes.JSON_PROPERTY_MODIFIED_AT, + ItemApiPayloadDataAttributes.JSON_PROPERTY_ORG_ID, + ItemApiPayloadDataAttributes.JSON_PROPERTY_PRIMARY_COLUMN_NAME, + ItemApiPayloadDataAttributes.JSON_PROPERTY_SIGNATURE, + ItemApiPayloadDataAttributes.JSON_PROPERTY_STORE_ID, + ItemApiPayloadDataAttributes.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ItemApiPayloadDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_ORG_ID = "org_id"; + private Long orgId; + + public static final String JSON_PROPERTY_PRIMARY_COLUMN_NAME = "primary_column_name"; + private String primaryColumnName; + + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + private String signature; + + public static final String JSON_PROPERTY_STORE_ID = "store_id"; + private String storeId; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Map value = null; + + public ItemApiPayloadDataAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the item was first created. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public ItemApiPayloadDataAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Timestamp when the item was last modified. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public ItemApiPayloadDataAttributes orgId(Long orgId) { + this.orgId = orgId; + return this; + } + + /** + * The ID of the organization that owns this item. + * + * @return orgId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORG_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOrgId() { + return orgId; + } + + public void setOrgId(Long orgId) { + this.orgId = orgId; + } + + public ItemApiPayloadDataAttributes primaryColumnName(String primaryColumnName) { + this.primaryColumnName = primaryColumnName; + return this; + } + + /** + * The name of the primary key column for this datastore. Primary column names: - Must abide by + * both PostgreSQL naming + * conventions - Cannot exceed 63 characters + * + * @return primaryColumnName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_COLUMN_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryColumnName() { + return primaryColumnName; + } + + public void setPrimaryColumnName(String primaryColumnName) { + this.primaryColumnName = primaryColumnName; + } + + public ItemApiPayloadDataAttributes signature(String signature) { + this.signature = signature; + return this; + } + + /** + * A unique signature identifying this item version. + * + * @return signature + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public ItemApiPayloadDataAttributes storeId(String storeId) { + this.storeId = storeId; + return this; + } + + /** + * The unique identifier of the datastore containing this item. + * + * @return storeId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STORE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoreId() { + return storeId; + } + + public void setStoreId(String storeId) { + this.storeId = storeId; + } + + public ItemApiPayloadDataAttributes value(Map value) { + this.value = value; + return this; + } + + public ItemApiPayloadDataAttributes putValueItem(String key, Object valueItem) { + if (this.value == null) { + this.value = new HashMap<>(); + } + this.value.put(key, valueItem); + return this; + } + + /** + * The data content (as key-value pairs) of a datastore item. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getValue() { + return value; + } + + public void setValue(Map value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ItemApiPayloadDataAttributes + */ + @JsonAnySetter + public ItemApiPayloadDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ItemApiPayloadDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemApiPayloadDataAttributes itemApiPayloadDataAttributes = (ItemApiPayloadDataAttributes) o; + return Objects.equals(this.createdAt, itemApiPayloadDataAttributes.createdAt) + && Objects.equals(this.modifiedAt, itemApiPayloadDataAttributes.modifiedAt) + && Objects.equals(this.orgId, itemApiPayloadDataAttributes.orgId) + && Objects.equals(this.primaryColumnName, itemApiPayloadDataAttributes.primaryColumnName) + && Objects.equals(this.signature, itemApiPayloadDataAttributes.signature) + && Objects.equals(this.storeId, itemApiPayloadDataAttributes.storeId) + && Objects.equals(this.value, itemApiPayloadDataAttributes.value) + && Objects.equals( + this.additionalProperties, itemApiPayloadDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + modifiedAt, + orgId, + primaryColumnName, + signature, + storeId, + value, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemApiPayloadDataAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" primaryColumnName: ").append(toIndentedString(primaryColumnName)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" storeId: ").append(toIndentedString(storeId)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMeta.java b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMeta.java new file mode 100644 index 00000000000..39e3ad80214 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMeta.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Additional metadata about a collection of datastore items, including pagination and schema + * information. + */ +@JsonPropertyOrder({ItemApiPayloadMeta.JSON_PROPERTY_PAGE, ItemApiPayloadMeta.JSON_PROPERTY_SCHEMA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ItemApiPayloadMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private ItemApiPayloadMetaPage page; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + private ItemApiPayloadMetaSchema schema; + + public ItemApiPayloadMeta page(ItemApiPayloadMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination information for a collection of datastore items. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ItemApiPayloadMetaPage getPage() { + return page; + } + + public void setPage(ItemApiPayloadMetaPage page) { + this.page = page; + } + + public ItemApiPayloadMeta schema(ItemApiPayloadMetaSchema schema) { + this.schema = schema; + this.unparsed |= schema.unparsed; + return this; + } + + /** + * Schema information about the datastore, including its primary key and field definitions. + * + * @return schema + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ItemApiPayloadMetaSchema getSchema() { + return schema; + } + + public void setSchema(ItemApiPayloadMetaSchema schema) { + this.schema = schema; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ItemApiPayloadMeta + */ + @JsonAnySetter + public ItemApiPayloadMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ItemApiPayloadMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemApiPayloadMeta itemApiPayloadMeta = (ItemApiPayloadMeta) o; + return Objects.equals(this.page, itemApiPayloadMeta.page) + && Objects.equals(this.schema, itemApiPayloadMeta.schema) + && Objects.equals(this.additionalProperties, itemApiPayloadMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, schema, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemApiPayloadMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaPage.java new file mode 100644 index 00000000000..9f6b6b888ea --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaPage.java @@ -0,0 +1,191 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Pagination information for a collection of datastore items. */ +@JsonPropertyOrder({ + ItemApiPayloadMetaPage.JSON_PROPERTY_HAS_MORE, + ItemApiPayloadMetaPage.JSON_PROPERTY_TOTAL_COUNT, + ItemApiPayloadMetaPage.JSON_PROPERTY_TOTAL_FILTERED_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ItemApiPayloadMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HAS_MORE = "hasMore"; + private Boolean hasMore; + + public static final String JSON_PROPERTY_TOTAL_COUNT = "totalCount"; + private Long totalCount; + + public static final String JSON_PROPERTY_TOTAL_FILTERED_COUNT = "totalFilteredCount"; + private Long totalFilteredCount; + + public ItemApiPayloadMetaPage hasMore(Boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + /** + * Whether there are additional pages of items beyond the current page. + * + * @return hasMore + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_MORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasMore() { + return hasMore; + } + + public void setHasMore(Boolean hasMore) { + this.hasMore = hasMore; + } + + public ItemApiPayloadMetaPage totalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * The total number of items in the datastore, ignoring any filters. + * + * @return totalCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(Long totalCount) { + this.totalCount = totalCount; + } + + public ItemApiPayloadMetaPage totalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + return this; + } + + /** + * The total number of items that match the current filter criteria. + * + * @return totalFilteredCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_FILTERED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalFilteredCount() { + return totalFilteredCount; + } + + public void setTotalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ItemApiPayloadMetaPage + */ + @JsonAnySetter + public ItemApiPayloadMetaPage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ItemApiPayloadMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemApiPayloadMetaPage itemApiPayloadMetaPage = (ItemApiPayloadMetaPage) o; + return Objects.equals(this.hasMore, itemApiPayloadMetaPage.hasMore) + && Objects.equals(this.totalCount, itemApiPayloadMetaPage.totalCount) + && Objects.equals(this.totalFilteredCount, itemApiPayloadMetaPage.totalFilteredCount) + && Objects.equals(this.additionalProperties, itemApiPayloadMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hasMore, totalCount, totalFilteredCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemApiPayloadMetaPage {\n"); + sb.append(" hasMore: ").append(toIndentedString(hasMore)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); + sb.append(" totalFilteredCount: ").append(toIndentedString(totalFilteredCount)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaSchema.java b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaSchema.java new file mode 100644 index 00000000000..8b9b67f74b5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaSchema.java @@ -0,0 +1,178 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema information about the datastore, including its primary key and field definitions. */ +@JsonPropertyOrder({ + ItemApiPayloadMetaSchema.JSON_PROPERTY_FIELDS, + ItemApiPayloadMetaSchema.JSON_PROPERTY_PRIMARY_KEY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ItemApiPayloadMetaSchema { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELDS = "fields"; + private List fields = null; + + public static final String JSON_PROPERTY_PRIMARY_KEY = "primary_key"; + private String primaryKey; + + public ItemApiPayloadMetaSchema fields(List fields) { + this.fields = fields; + for (ItemApiPayloadMetaSchemaField item : fields) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ItemApiPayloadMetaSchema addFieldsItem(ItemApiPayloadMetaSchemaField fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + this.unparsed |= fieldsItem.unparsed; + return this; + } + + /** + * An array describing the columns available in this datastore. + * + * @return fields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } + + public ItemApiPayloadMetaSchema primaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * The name of the primary key column for this datastore. + * + * @return primaryKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIMARY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryKey() { + return primaryKey; + } + + public void setPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ItemApiPayloadMetaSchema + */ + @JsonAnySetter + public ItemApiPayloadMetaSchema putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ItemApiPayloadMetaSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemApiPayloadMetaSchema itemApiPayloadMetaSchema = (ItemApiPayloadMetaSchema) o; + return Objects.equals(this.fields, itemApiPayloadMetaSchema.fields) + && Objects.equals(this.primaryKey, itemApiPayloadMetaSchema.primaryKey) + && Objects.equals(this.additionalProperties, itemApiPayloadMetaSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, primaryKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemApiPayloadMetaSchema {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" primaryKey: ").append(toIndentedString(primaryKey)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaSchemaField.java b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaSchemaField.java new file mode 100644 index 00000000000..7a912dcebf5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ItemApiPayloadMetaSchemaField.java @@ -0,0 +1,174 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Information about a specific column in the datastore schema. */ +@JsonPropertyOrder({ + ItemApiPayloadMetaSchemaField.JSON_PROPERTY_NAME, + ItemApiPayloadMetaSchemaField.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ItemApiPayloadMetaSchemaField { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public ItemApiPayloadMetaSchemaField() {} + + @JsonCreator + public ItemApiPayloadMetaSchemaField( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.name = name; + this.type = type; + } + + public ItemApiPayloadMetaSchemaField name(String name) { + this.name = name; + return this; + } + + /** + * The name of this column in the datastore. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ItemApiPayloadMetaSchemaField type(String type) { + this.type = type; + return this; + } + + /** + * The data type of this column. For example, 'string', 'number', or 'boolean'. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ItemApiPayloadMetaSchemaField + */ + @JsonAnySetter + public ItemApiPayloadMetaSchemaField putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ItemApiPayloadMetaSchemaField object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemApiPayloadMetaSchemaField itemApiPayloadMetaSchemaField = (ItemApiPayloadMetaSchemaField) o; + return Objects.equals(this.name, itemApiPayloadMetaSchemaField.name) + && Objects.equals(this.type, itemApiPayloadMetaSchemaField.type) + && Objects.equals( + this.additionalProperties, itemApiPayloadMetaSchemaField.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemApiPayloadMetaSchemaField {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PutAppsDatastoreItemResponseArray.java b/src/main/java/com/datadog/api/client/v2/model/PutAppsDatastoreItemResponseArray.java new file mode 100644 index 00000000000..c37bfa01378 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PutAppsDatastoreItemResponseArray.java @@ -0,0 +1,160 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Response after successfully inserting multiple items into a datastore, containing the identifiers + * of the created items. + */ +@JsonPropertyOrder({PutAppsDatastoreItemResponseArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PutAppsDatastoreItemResponseArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public PutAppsDatastoreItemResponseArray() {} + + @JsonCreator + public PutAppsDatastoreItemResponseArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public PutAppsDatastoreItemResponseArray data(List data) { + this.data = data; + for (PutAppsDatastoreItemResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public PutAppsDatastoreItemResponseArray addDataItem(PutAppsDatastoreItemResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An array of data objects containing the identifiers of the successfully inserted items. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PutAppsDatastoreItemResponseArray + */ + @JsonAnySetter + public PutAppsDatastoreItemResponseArray putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PutAppsDatastoreItemResponseArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PutAppsDatastoreItemResponseArray putAppsDatastoreItemResponseArray = + (PutAppsDatastoreItemResponseArray) o; + return Objects.equals(this.data, putAppsDatastoreItemResponseArray.data) + && Objects.equals( + this.additionalProperties, putAppsDatastoreItemResponseArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PutAppsDatastoreItemResponseArray {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PutAppsDatastoreItemResponseData.java b/src/main/java/com/datadog/api/client/v2/model/PutAppsDatastoreItemResponseData.java new file mode 100644 index 00000000000..22ecf9ffcc4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PutAppsDatastoreItemResponseData.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Data containing the identifier of a single item that was successfully inserted into the + * datastore. + */ +@JsonPropertyOrder({ + PutAppsDatastoreItemResponseData.JSON_PROPERTY_ID, + PutAppsDatastoreItemResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PutAppsDatastoreItemResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DatastoreItemsDataType type = DatastoreItemsDataType.ITEMS; + + public PutAppsDatastoreItemResponseData() {} + + @JsonCreator + public PutAppsDatastoreItemResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PutAppsDatastoreItemResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier assigned to the inserted item. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public PutAppsDatastoreItemResponseData type(DatastoreItemsDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastore items. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreItemsDataType getType() { + return type; + } + + public void setType(DatastoreItemsDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PutAppsDatastoreItemResponseData + */ + @JsonAnySetter + public PutAppsDatastoreItemResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PutAppsDatastoreItemResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PutAppsDatastoreItemResponseData putAppsDatastoreItemResponseData = + (PutAppsDatastoreItemResponseData) o; + return Objects.equals(this.id, putAppsDatastoreItemResponseData.id) + && Objects.equals(this.type, putAppsDatastoreItemResponseData.type) + && Objects.equals( + this.additionalProperties, putAppsDatastoreItemResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PutAppsDatastoreItemResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequest.java new file mode 100644 index 00000000000..c7dedb39d6b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequest.java @@ -0,0 +1,139 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to update specific fields on an existing datastore item. */ +@JsonPropertyOrder({UpdateAppsDatastoreItemRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppsDatastoreItemRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateAppsDatastoreItemRequestData data; + + public UpdateAppsDatastoreItemRequest data(UpdateAppsDatastoreItemRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data wrapper containing the item identifier and the changes to apply during the update + * operation. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppsDatastoreItemRequestData getData() { + return data; + } + + public void setData(UpdateAppsDatastoreItemRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppsDatastoreItemRequest + */ + @JsonAnySetter + public UpdateAppsDatastoreItemRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppsDatastoreItemRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppsDatastoreItemRequest updateAppsDatastoreItemRequest = + (UpdateAppsDatastoreItemRequest) o; + return Objects.equals(this.data, updateAppsDatastoreItemRequest.data) + && Objects.equals( + this.additionalProperties, updateAppsDatastoreItemRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppsDatastoreItemRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestData.java new file mode 100644 index 00000000000..c49e1dcb1f2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestData.java @@ -0,0 +1,212 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Data wrapper containing the item identifier and the changes to apply during the update operation. + */ +@JsonPropertyOrder({ + UpdateAppsDatastoreItemRequestData.JSON_PROPERTY_ATTRIBUTES, + UpdateAppsDatastoreItemRequestData.JSON_PROPERTY_ID, + UpdateAppsDatastoreItemRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppsDatastoreItemRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateAppsDatastoreItemRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UpdateAppsDatastoreItemRequestDataType type = + UpdateAppsDatastoreItemRequestDataType.ITEMS; + + public UpdateAppsDatastoreItemRequestData() {} + + @JsonCreator + public UpdateAppsDatastoreItemRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + UpdateAppsDatastoreItemRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpdateAppsDatastoreItemRequestData attributes( + UpdateAppsDatastoreItemRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating a datastore item, including the item key and changes to apply. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppsDatastoreItemRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateAppsDatastoreItemRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateAppsDatastoreItemRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the datastore item. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UpdateAppsDatastoreItemRequestData type(UpdateAppsDatastoreItemRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastore items. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateAppsDatastoreItemRequestDataType getType() { + return type; + } + + public void setType(UpdateAppsDatastoreItemRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppsDatastoreItemRequestData + */ + @JsonAnySetter + public UpdateAppsDatastoreItemRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppsDatastoreItemRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppsDatastoreItemRequestData updateAppsDatastoreItemRequestData = + (UpdateAppsDatastoreItemRequestData) o; + return Objects.equals(this.attributes, updateAppsDatastoreItemRequestData.attributes) + && Objects.equals(this.id, updateAppsDatastoreItemRequestData.id) + && Objects.equals(this.type, updateAppsDatastoreItemRequestData.type) + && Objects.equals( + this.additionalProperties, updateAppsDatastoreItemRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppsDatastoreItemRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataAttributes.java new file mode 100644 index 00000000000..bb590083a68 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataAttributes.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating a datastore item, including the item key and changes to apply. */ +@JsonPropertyOrder({ + UpdateAppsDatastoreItemRequestDataAttributes.JSON_PROPERTY_ID, + UpdateAppsDatastoreItemRequestDataAttributes.JSON_PROPERTY_ITEM_CHANGES, + UpdateAppsDatastoreItemRequestDataAttributes.JSON_PROPERTY_ITEM_KEY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppsDatastoreItemRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_ITEM_CHANGES = "item_changes"; + private UpdateAppsDatastoreItemRequestDataAttributesItemChanges itemChanges; + + public static final String JSON_PROPERTY_ITEM_KEY = "item_key"; + private String itemKey; + + public UpdateAppsDatastoreItemRequestDataAttributes() {} + + @JsonCreator + public UpdateAppsDatastoreItemRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ITEM_CHANGES) + UpdateAppsDatastoreItemRequestDataAttributesItemChanges itemChanges, + @JsonProperty(required = true, value = JSON_PROPERTY_ITEM_KEY) String itemKey) { + this.itemChanges = itemChanges; + this.unparsed |= itemChanges.unparsed; + this.itemKey = itemKey; + } + + public UpdateAppsDatastoreItemRequestDataAttributes id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the item being updated. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UpdateAppsDatastoreItemRequestDataAttributes itemChanges( + UpdateAppsDatastoreItemRequestDataAttributesItemChanges itemChanges) { + this.itemChanges = itemChanges; + this.unparsed |= itemChanges.unparsed; + return this; + } + + /** + * Changes to apply to a datastore item using set operations. + * + * @return itemChanges + */ + @JsonProperty(JSON_PROPERTY_ITEM_CHANGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UpdateAppsDatastoreItemRequestDataAttributesItemChanges getItemChanges() { + return itemChanges; + } + + public void setItemChanges(UpdateAppsDatastoreItemRequestDataAttributesItemChanges itemChanges) { + this.itemChanges = itemChanges; + } + + public UpdateAppsDatastoreItemRequestDataAttributes itemKey(String itemKey) { + this.itemKey = itemKey; + return this; + } + + /** + * The primary key that identifies the item to update. Cannot exceed 256 characters. + * + * @return itemKey + */ + @JsonProperty(JSON_PROPERTY_ITEM_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getItemKey() { + return itemKey; + } + + public void setItemKey(String itemKey) { + this.itemKey = itemKey; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppsDatastoreItemRequestDataAttributes + */ + @JsonAnySetter + public UpdateAppsDatastoreItemRequestDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppsDatastoreItemRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppsDatastoreItemRequestDataAttributes updateAppsDatastoreItemRequestDataAttributes = + (UpdateAppsDatastoreItemRequestDataAttributes) o; + return Objects.equals(this.id, updateAppsDatastoreItemRequestDataAttributes.id) + && Objects.equals( + this.itemChanges, updateAppsDatastoreItemRequestDataAttributes.itemChanges) + && Objects.equals(this.itemKey, updateAppsDatastoreItemRequestDataAttributes.itemKey) + && Objects.equals( + this.additionalProperties, + updateAppsDatastoreItemRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, itemChanges, itemKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppsDatastoreItemRequestDataAttributes {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" itemChanges: ").append(toIndentedString(itemChanges)).append("\n"); + sb.append(" itemKey: ").append(toIndentedString(itemKey)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataAttributesItemChanges.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataAttributesItemChanges.java new file mode 100644 index 00000000000..7f8c3977613 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataAttributesItemChanges.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Changes to apply to a datastore item using set operations. */ +@JsonPropertyOrder({UpdateAppsDatastoreItemRequestDataAttributesItemChanges.JSON_PROPERTY_OPS_SET}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppsDatastoreItemRequestDataAttributesItemChanges { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OPS_SET = "ops_set"; + private Map opsSet = null; + + public UpdateAppsDatastoreItemRequestDataAttributesItemChanges opsSet( + Map opsSet) { + this.opsSet = opsSet; + return this; + } + + public UpdateAppsDatastoreItemRequestDataAttributesItemChanges putOpsSetItem( + String key, Object opsSetItem) { + if (this.opsSet == null) { + this.opsSet = new HashMap<>(); + } + this.opsSet.put(key, opsSetItem); + return this; + } + + /** + * Set operation that contains key-value pairs to set on the datastore item. + * + * @return opsSet + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPS_SET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getOpsSet() { + return opsSet; + } + + public void setOpsSet(Map opsSet) { + this.opsSet = opsSet; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppsDatastoreItemRequestDataAttributesItemChanges + */ + @JsonAnySetter + public UpdateAppsDatastoreItemRequestDataAttributesItemChanges putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this UpdateAppsDatastoreItemRequestDataAttributesItemChanges object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppsDatastoreItemRequestDataAttributesItemChanges + updateAppsDatastoreItemRequestDataAttributesItemChanges = + (UpdateAppsDatastoreItemRequestDataAttributesItemChanges) o; + return Objects.equals( + this.opsSet, updateAppsDatastoreItemRequestDataAttributesItemChanges.opsSet) + && Objects.equals( + this.additionalProperties, + updateAppsDatastoreItemRequestDataAttributesItemChanges.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(opsSet, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppsDatastoreItemRequestDataAttributesItemChanges {\n"); + sb.append(" opsSet: ").append(toIndentedString(opsSet)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataType.java new file mode 100644 index 00000000000..58e0bb1d7a6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreItemRequestDataType.java @@ -0,0 +1,62 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type for datastore items. */ +@JsonSerialize( + using = + UpdateAppsDatastoreItemRequestDataType.UpdateAppsDatastoreItemRequestDataTypeSerializer + .class) +public class UpdateAppsDatastoreItemRequestDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("items")); + + public static final UpdateAppsDatastoreItemRequestDataType ITEMS = + new UpdateAppsDatastoreItemRequestDataType("items"); + + UpdateAppsDatastoreItemRequestDataType(String value) { + super(value, allowedValues); + } + + public static class UpdateAppsDatastoreItemRequestDataTypeSerializer + extends StdSerializer { + public UpdateAppsDatastoreItemRequestDataTypeSerializer( + Class t) { + super(t); + } + + public UpdateAppsDatastoreItemRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + UpdateAppsDatastoreItemRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static UpdateAppsDatastoreItemRequestDataType fromValue(String value) { + return new UpdateAppsDatastoreItemRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequest.java new file mode 100644 index 00000000000..b6a4cd2a724 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequest.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to update a datastore's configuration such as its name or description. */ +@JsonPropertyOrder({UpdateAppsDatastoreRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppsDatastoreRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateAppsDatastoreRequestData data; + + public UpdateAppsDatastoreRequest data(UpdateAppsDatastoreRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data wrapper containing the datastore identifier and the attributes to update. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppsDatastoreRequestData getData() { + return data; + } + + public void setData(UpdateAppsDatastoreRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppsDatastoreRequest + */ + @JsonAnySetter + public UpdateAppsDatastoreRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppsDatastoreRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppsDatastoreRequest updateAppsDatastoreRequest = (UpdateAppsDatastoreRequest) o; + return Objects.equals(this.data, updateAppsDatastoreRequest.data) + && Objects.equals( + this.additionalProperties, updateAppsDatastoreRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppsDatastoreRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequestData.java new file mode 100644 index 00000000000..038d53943cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequestData.java @@ -0,0 +1,208 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data wrapper containing the datastore identifier and the attributes to update. */ +@JsonPropertyOrder({ + UpdateAppsDatastoreRequestData.JSON_PROPERTY_ATTRIBUTES, + UpdateAppsDatastoreRequestData.JSON_PROPERTY_ID, + UpdateAppsDatastoreRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppsDatastoreRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateAppsDatastoreRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DatastoreDataType type = DatastoreDataType.DATASTORES; + + public UpdateAppsDatastoreRequestData() {} + + @JsonCreator + public UpdateAppsDatastoreRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DatastoreDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpdateAppsDatastoreRequestData attributes( + UpdateAppsDatastoreRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes that can be updated on a datastore. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppsDatastoreRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateAppsDatastoreRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateAppsDatastoreRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the datastore to update. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UpdateAppsDatastoreRequestData type(DatastoreDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for datastores. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DatastoreDataType getType() { + return type; + } + + public void setType(DatastoreDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppsDatastoreRequestData + */ + @JsonAnySetter + public UpdateAppsDatastoreRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppsDatastoreRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppsDatastoreRequestData updateAppsDatastoreRequestData = + (UpdateAppsDatastoreRequestData) o; + return Objects.equals(this.attributes, updateAppsDatastoreRequestData.attributes) + && Objects.equals(this.id, updateAppsDatastoreRequestData.id) + && Objects.equals(this.type, updateAppsDatastoreRequestData.type) + && Objects.equals( + this.additionalProperties, updateAppsDatastoreRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppsDatastoreRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequestDataAttributes.java new file mode 100644 index 00000000000..6ca9c0e8edc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppsDatastoreRequestDataAttributes.java @@ -0,0 +1,167 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes that can be updated on a datastore. */ +@JsonPropertyOrder({ + UpdateAppsDatastoreRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + UpdateAppsDatastoreRequestDataAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppsDatastoreRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public UpdateAppsDatastoreRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A human-readable description about the datastore. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public UpdateAppsDatastoreRequestDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The display name of the datastore. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppsDatastoreRequestDataAttributes + */ + @JsonAnySetter + public UpdateAppsDatastoreRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppsDatastoreRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppsDatastoreRequestDataAttributes updateAppsDatastoreRequestDataAttributes = + (UpdateAppsDatastoreRequestDataAttributes) o; + return Objects.equals(this.description, updateAppsDatastoreRequestDataAttributes.description) + && Objects.equals(this.name, updateAppsDatastoreRequestDataAttributes.name) + && Objects.equals( + this.additionalProperties, + updateAppsDatastoreRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppsDatastoreRequestDataAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..91fb9c71dbe --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-06T19:02:39.774Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Bad_Request_response.json new file mode 100644 index 00000000000..eb6915eead6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Bad_Request_response.json @@ -0,0 +1,88 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"\",\"name\":\"Test Datastore\",\"org_access\":\"contributor\",\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"226df00a-c52e-41cd-9067-2b8c2b18649d\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6574cf7e-1c55-24e1-45d2-b92f9fa74d32" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"values\":[{\"id\":\"cust_3141\",\"name\":\"Johnathan\"},{\"badPrimaryKey\":\"key2\",\"name\":\"Johnathan\"}]},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores/226df00a-c52e-41cd-9067-2b8c2b18649d/items/bulk", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"id\":\"b6f27ea4-0a0b-43fa-92ef-b023f8e06e2c\",\"title\":\"item key missing or invalid\",\"detail\":\"primary column \\\"id\\\" is missing\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "63a78f23-e106-ee7c-499b-3b4601a8ec0e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/226df00a-c52e-41cd-9067-2b8c2b18649d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"226df00a-c52e-41cd-9067-2b8c2b18649d\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1f7013a5-5159-0e12-085a-315e100e88a1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..468bf22ec4d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-09-06T19:02:54.153Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Not_Found_response.json new file mode 100644 index 00000000000..f36233f7ab8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"values\":[{\"id\":\"cust_3141\",\"name\":\"Johnathan\"},{\"id\":\"cust_3142\",\"name\":\"Mary\"}]},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores/70b87c26-886f-497a-bd9d-09f53bc9b40c/items/bulk", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"id\":\"b799bd68-cfb7-4c3d-8026-e0e00c27252f\",\"title\":\"datastore not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7b85df98-bd95-d566-8b6b-eaa5d48a00fa" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_OK_response.freeze new file mode 100644 index 00000000000..315b978b48d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:06.486Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_OK_response.json new file mode 100644 index 00000000000..2043141df57 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Bulk_write_datastore_items_returns_OK_response.json @@ -0,0 +1,88 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"\",\"name\":\"Test Datastore\",\"org_access\":\"contributor\",\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6c0dbbfd-a905-4f79-9c2f-16cb4d9a56a7\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6574cf7e-1c55-24e1-45d2-b92f9fa74d2d" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"values\":[{\"id\":\"cust_3141\",\"name\":\"Johnathan\"},{\"id\":\"cust_3142\",\"name\":\"Mary\"}]},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores/6c0dbbfd-a905-4f79-9c2f-16cb4d9a56a7/items/bulk", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"8c6bba37-01d4-4b49-9d90-4ac909aa8c9f\",\"type\":\"items\"},{\"id\":\"285244c6-b07f-4502-928b-2444c1de31e7\",\"type\":\"items\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5477242a-47dc-c0d1-6fce-5b4819e0a568" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/6c0dbbfd-a905-4f79-9c2f-16cb4d9a56a7", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6c0dbbfd-a905-4f79-9c2f-16cb4d9a56a7\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3c420a7a-f3c7-f72b-55ac-8dacb96c3a45" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_datastore_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_datastore_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..bc7536ef1fc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_datastore_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:06.982Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_datastore_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_datastore_returns_Bad_Request_response.json new file mode 100644 index 00000000000..90d4d09aef7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_datastore_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"datastore-name\",\"primary_column_name\":\"0invalid_key\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"id\":\"78cd887f-1a77-421f-915d-4bfebb3784c0\",\"title\":\"datastore configuration invalid\",\"detail\":\"column name '0invalid_key' does not start with a letter or an underscore\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dd2db85e-e185-8240-b008-77862d9d896a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_datastore_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_datastore_returns_OK_response.freeze new file mode 100644 index 00000000000..6833aae6503 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_datastore_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:07.136Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_datastore_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_datastore_returns_OK_response.json new file mode 100644 index 00000000000..2b8dc5cf0cd --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_datastore_returns_OK_response.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"datastore-name\",\"primary_column_name\":\"primaryKey\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"040e45f8-b354-4817-8c01-e5d2bb8aa55d\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0ff3d90c-15dd-9e76-23c0-ab147a12dd44" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/040e45f8-b354-4817-8c01-e5d2bb8aa55d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"040e45f8-b354-4817-8c01-e5d2bb8aa55d\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "aa189c18-56e7-ca80-f296-6ae2810ba76d" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..0bfb558f918 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-06T19:03:07.134Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Bad_Request_response.json new file mode 100644 index 00000000000..3c00a08fec8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"item_key\":\"primaryKey\"},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/invalid-uuid/items", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"id\":\"5adc82ee-f920-4fe9-aafc-10cabac28b68\",\"title\":\"invalid path parameter\",\"detail\":\"invalid datastoreId format in path\",\"source\":{\"parameter\":\"datastoreId\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cc279af8-67c7-abbd-1e30-f81c29c559be" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..2636c1d2bfe --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-09-06T19:03:18.396Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Not_Found_response.json new file mode 100644 index 00000000000..a639f4bb4ef --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"item_key\":\"primaryKey\"},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/70b87c26-886f-497a-bd9d-09f53bc9b40c/items", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"id\":\"38b88198-bd74-4494-8571-f689b21cd216\",\"title\":\"datastore not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a1672d1a-5392-9a3b-6f9e-45e4ea22ce71" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_OK_response.freeze new file mode 100644 index 00000000000..c639a010e96 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:07.743Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_OK_response.json new file mode 100644 index 00000000000..e1f6cfcce7c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_item_returns_OK_response.json @@ -0,0 +1,118 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"\",\"name\":\"Test Datastore\",\"org_access\":\"contributor\",\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6574cf7e-1c55-24e1-45d2-b92f9fa74d30" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"conflict_mode\":\"fail_on_conflict\",\"values\":[{\"data\":\"test-value\",\"id\":\"test-key\"}]},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores/ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8/items/bulk", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"8eee511f-e1bc-4a02-8805-1770bbdc4d2e\",\"type\":\"items\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4cb325f3-e6f7-7596-e26d-985719a8eeb4" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"item_key\":\"test-key\"},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8/items", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"8eee511f-e1bc-4a02-8805-1770bbdc4d2e\",\"type\":\"items\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ce8255d3-2f2e-23fc-66ad-3001fb8233fb" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ad9cc3b7-da9b-452d-8eab-a1e0a0a4e3d8\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d90a5aa2-ad82-6f1a-81b7-277480123a78" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Delete_datastore_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..a262f922c45 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:08.448Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Delete_datastore_returns_Bad_Request_response.json new file mode 100644 index 00000000000..729e224fae9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/invalid-uuid", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"id\":\"ee853859-fef5-4771-98bd-1af309286bc0\",\"title\":\"invalid path parameter\",\"detail\":\"invalid datastoreId format in path\",\"source\":{\"parameter\":\"datastoreId\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9ac967a0-8efe-4c44-5259-d4058c442635" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Delete_datastore_returns_OK_response.freeze new file mode 100644 index 00000000000..b46a8c75f26 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:08.615Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_datastore_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_datastore_returns_OK_response.json new file mode 100644 index 00000000000..89a12a585b3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_datastore_returns_OK_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"\",\"name\":\"Test Datastore\",\"org_access\":\"contributor\",\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"8185f4a4-6cf6-4fde-a705-e248effe50fc\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6574cf7e-1c55-24e1-45d2-b92f9fa74d31" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/8185f4a4-6cf6-4fde-a705-e248effe50fc", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"8185f4a4-6cf6-4fde-a705-e248effe50fc\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9493bfe6-d7b1-3c5f-a935-f25ec72e049f" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/8185f4a4-6cf6-4fde-a705-e248effe50fc", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9493bfe6-d7b1-3c5f-a935-f25ec72e04a0" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_datastore_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_datastore_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..17f435beab3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_datastore_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:09.096Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_datastore_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_datastore_returns_Bad_Request_response.json new file mode 100644 index 00000000000..9894ffaed06 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_datastore_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions-datastores/invalid-uuid", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"id\":\"51295683-ce69-48d6-8efb-4d877ff7e1b2\",\"title\":\"invalid path parameter\",\"detail\":\"invalid datastoreId format in path\",\"source\":{\"parameter\":\"datastoreId\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5e548b9d-a68e-566f-45ff-e15937232294" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_datastore_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_datastore_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..ae156efd1c0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_datastore_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:09.218Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_datastore_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_datastore_returns_Not_Found_response.json new file mode 100644 index 00000000000..d9364d234db --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_datastore_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions-datastores/5bf53b3f-b230-4b35-ab1a-b39f2633eb22", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"id\":\"d4aab06a-e0f9-4aff-9af4-bc99e2938ec3\",\"title\":\"datastore not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a60a64ca-8088-62ee-fdc6-68fcf8999c3a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_datastore_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_datastore_returns_OK_response.freeze new file mode 100644 index 00000000000..34a4f2a77cb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_datastore_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:09.394Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_datastore_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_datastore_returns_OK_response.json new file mode 100644 index 00000000000..7f112b2283d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_datastore_returns_OK_response.json @@ -0,0 +1,84 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"\",\"name\":\"Test Datastore\",\"org_access\":\"contributor\",\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b06309e7-b4e9-4edb-a494-e5dd27d9525f\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6574cf7e-1c55-24e1-45d2-b92f9fa74d2e" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions-datastores/b06309e7-b4e9-4edb-a494-e5dd27d9525f", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b06309e7-b4e9-4edb-a494-e5dd27d9525f\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-09-05T22:54:09.545626Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-09-05T22:54:09.545626Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b914379f-fa05-9b66-217a-cbab33dc1bfe" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/b06309e7-b4e9-4edb-a494-e5dd27d9525f", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b06309e7-b4e9-4edb-a494-e5dd27d9525f\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7b9a1ad2-07e3-b69c-0ff3-81241c4d5d66" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..b7c9ce7b394 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:09.863Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Bad_Request_response.json new file mode 100644 index 00000000000..1ef8bd738ab --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions-datastores/invalid-uuid/items", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"id\":\"d41a11e1-5db7-47bf-a542-b469768194dd\",\"title\":\"invalid path parameter\",\"detail\":\"invalid datastoreId format in path\",\"source\":{\"parameter\":\"datastoreId\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "89734d04-9511-bd4e-2cfc-bdcea411cf1a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..0f045f4f811 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:10.018Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Not_Found_response.json new file mode 100644 index 00000000000..506ae719187 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions-datastores/3cfdd0b8-c490-4969-8d51-69add64a70ea/items", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"id\":\"1fe0de3f-9e9c-475b-8cb4-6ea831aa167f\",\"title\":\"datastore not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ab8625af-a894-dd2d-0418-a800c34fea08" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_datastore_items_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_OK_response.freeze new file mode 100644 index 00000000000..87a934a1bf2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:10.195Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_datastore_items_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_OK_response.json new file mode 100644 index 00000000000..61061134fe6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_datastore_items_returns_OK_response.json @@ -0,0 +1,114 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"\",\"name\":\"Test Datastore\",\"org_access\":\"contributor\",\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"edfe7784-570c-4984-a4ae-883642b561d8\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6574cf7e-1c55-24e1-45d2-b92f9fa74d33" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"conflict_mode\":\"fail_on_conflict\",\"values\":[{\"data\":\"test-value\",\"id\":\"test-key\"}]},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores/edfe7784-570c-4984-a4ae-883642b561d8/items/bulk", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"b20fe87b-f383-4afc-91ee-8fbc178942a2\",\"type\":\"items\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2eb3dcf3-df0b-c563-499a-a6d50d4ab986" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions-datastores/edfe7784-570c-4984-a4ae-883642b561d8/items", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"b20fe87b-f383-4afc-91ee-8fbc178942a2\",\"type\":\"items\",\"attributes\":{\"created_at\":\"2025-09-05T22:54:10.544424Z\",\"modified_at\":\"2025-09-05T22:54:10.544424Z\",\"org_id\":321813,\"primary_column_name\":\"id\",\"signature\":\"{\\\"signature\\\":\\\"{\\\\\\\"version\\\\\\\":2,\\\\\\\"algorithm\\\\\\\":\\\\\\\"ecdsa-p384\\\\\\\",\\\\\\\"pubkey\\\\\\\":\\\\\\\"voTcDho3mVIVzY8m98GyVfIib84TgbZoHSWzVQ09TFU=\\\\\\\",\\\\\\\"timestamp\\\\\\\":1757112850,\\\\\\\"proof\\\\\\\":\\\\\\\"MGUCMDX1ijfjUxZK9hVzaMIxU+DociQUkZpkz7FD7tAiykeviU/66p2j1sDf4fYGK3agCwIxALarzvBhasIVGC46VgJuoC0MIkb5WyVWZKh50ist9OfVCQbbe4ZTKKvrW3pVQN34rg==\\\\\\\"}\\\",\\\"version\\\":1}\",\"store_id\":\"edfe7784-570c-4984-a4ae-883642b561d8\",\"value\":{\"data\":\"test-value\",\"id\":\"test-key\"}}}],\"meta\":{\"page\":{\"totalCount\":1,\"totalFilteredCount\":1,\"hasMore\":false},\"schema\":{\"primary_key\":\"id\",\"fields\":[{\"name\":\"id\",\"type\":\"STRING\"},{\"name\":\"data\",\"type\":\"JSON\"}]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e579ddb5-92d7-b91e-f9df-ad5e95b142ae" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/edfe7784-570c-4984-a4ae-883642b561d8", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"edfe7784-570c-4984-a4ae-883642b561d8\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3bec8541-728e-dab8-9ec3-2f9751960eff" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_datastores_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_datastores_returns_OK_response.freeze new file mode 100644 index 00000000000..34ec023d7a2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_datastores_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:10.870Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_datastores_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_datastores_returns_OK_response.json new file mode 100644 index 00000000000..e0694226c16 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_datastores_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"0ff20856-6af3-4b8a-bfa6-26ffd7f61551\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:45:48.532915Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:45:48.532915Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"1c60feb8-f9ea-4b81-9f7d-b0ae97b10cc7\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-11T21:33:38.587401Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-11T21:33:38.587401Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"1d38b58d-d7ac-4a47-be37-6457cea49630\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T17:42:31.923013Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T17:42:31.923013Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"1d6f1853-eb64-43a3-a85b-b187853393c7\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:41:27.399846Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:41:27.399846Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"236e7736-44d9-40d0-985f-1ab73f25ad09\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T18:02:29.490155Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T18:02:29.490155Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"2b0704ce-1efd-4485-976b-f272ea39a9b9\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T14:02:11.360529Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T14:02:11.360529Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"2bccd24d-715d-473f-8771-eff9370d14b9\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-11T22:19:07.258146Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-11T22:19:07.258146Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"31af63e6-8363-45a4-ad6b-d92ec256b005\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T03:27:41.246238Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T03:27:41.246238Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"3d4f33dd-41af-4b4e-94e0-a142cd47f83d\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T17:58:55.363703Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T17:58:55.363703Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"44f23b41-3925-4620-b5ad-641c0cac57b9\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T17:30:39.520162Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T17:30:39.520162Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"457cae9c-32ad-4598-9ac0-489c7d4fc20b\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T03:07:54.05107Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T03:07:54.05107Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"55a92f3e-6804-4f45-9ecf-7c09cef155ed\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:33:42.534986Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:33:42.534987Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"5b3664f0-faaa-4f1b-b067-f521aa156516\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:35:02.776449Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:35:02.776449Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"7059cb1d-20f6-44e6-a5ee-8eeb19b799e2\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T17:24:03.907384Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T17:24:03.907384Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"7ef9ca96-be6d-435c-b452-9e562beedb4a\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T17:27:38.411129Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T17:27:38.411129Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"8204dff8-7335-4e33-a28b-8f8a0dd47ad0\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T14:08:19.382083Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T14:08:19.382083Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"84e4ca89-9266-4fb3-a552-e6da080abc3f\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T18:11:58.405584Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T18:11:58.405584Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"858032d2-1c2f-4ac1-a434-de5773fc14c2\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T02:55:43.831724Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T02:55:43.831724Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"89c95311-d63a-4535-be9d-92a3912ec074\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-11T21:24:28.298273Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-11T21:24:28.298273Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"8b0fb519-c55f-45d5-b532-1645bed41a92\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:54:02.27972Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:54:02.27972Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"99366571-d1de-4a6f-9213-5c77a5468de9\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:50:10.748216Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:50:10.748217Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"9d9d7162-cfd2-40f1-b413-d2df89a5eba9\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T03:28:50.178882Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T03:28:50.178882Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"a751bca4-54eb-4739-a4a3-4779650f9fad\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T03:45:28.881437Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T03:45:28.881437Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"a78fe3e0-4325-459f-aca4-69c084ab818d\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:22:37.043971Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:22:37.043972Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"aec831f3-cbc3-411f-8ef0-23fdb834d549\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T17:36:12.428171Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T17:36:12.428171Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"b55b6d33-da75-4432-85fc-e0f0a28b4826\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:38:13.641577Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:38:13.641578Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"bd5e4649-674b-444f-850c-74625b0be9ab\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T18:03:00.425892Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T18:03:00.425892Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"be6825fd-82d5-4d9d-8db5-cc674404b710\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T03:01:57.110842Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T03:01:57.110843Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"c412c4b3-7d3d-4ac3-ace6-99abfc0a8567\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T02:57:09.998039Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T02:57:09.998039Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"c698d221-5dc9-44d3-ae61-a6a422d204ab\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T03:18:11.876246Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T03:18:11.876246Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"cd915e84-87b1-495d-a868-9c24578696e3\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:36:53.994588Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:36:53.994588Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"cfadef50-963b-45fa-8334-f33094ca6d76\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T14:29:33.425183Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T14:29:33.425183Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"d018730c-26cb-47af-ba93-3604d8a8ad74\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T17:35:23.034496Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T17:35:23.034496Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"d14f84a9-9a26-4b0d-bd6d-f7baf8c9a9ae\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T17:30:07.452804Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T17:30:07.452804Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"d3dedf8d-6620-4dec-bb8b-b0fa53b19135\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:45:16.371907Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:45:16.371907Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"d8cdfbae-8ec9-4c50-8459-5d55a7b5a945\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T17:27:01.039091Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T17:27:01.039091Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"de765300-fca1-4ab2-a441-a6633cd7f976\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T14:11:34.405607Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T14:11:34.405607Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"e174ff20-eff7-40b9-a472-b8ce2a8492d8\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-11T20:40:08.137413Z\",\"creator_user_id\":2320499,\"creator_user_uuid\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"description\":\"\",\"modified_at\":\"2025-08-11T20:40:08.137413Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"ea68e1d7-6e4d-40d2-a67f-f5c3c54aab2b\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T03:03:21.673996Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T03:03:21.673996Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"ee56b789-56b6-481c-851b-d0c14a7228d4\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T13:44:50.073893Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T13:44:50.073894Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}},{\"id\":\"f5a8ac6e-0cfb-44ad-b71d-28fd40a210a6\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-08-08T03:36:29.121686Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-08-08T03:36:29.121686Z\",\"name\":\"Test Datastore\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ab966718-2c56-94c8-d72a-b79d99b6f9f6" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..184d2c8e929 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:11.057Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Bad_Request_response.json new file mode 100644 index 00000000000..41010055b19 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"item_changes\":{},\"item_key\":\"\"},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/actions-datastores/invalid-uuid/items", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"id\":\"f88d0b88-0d55-482b-9a90-3556ef7d6b4a\",\"title\":\"invalid path parameter\",\"detail\":\"invalid datastoreId format in path\",\"source\":{\"parameter\":\"datastoreId\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7de9857a-530e-8f79-0178-90e8415e029c" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..d3523bfc49d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:11.195Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Not_Found_response.json new file mode 100644 index 00000000000..7a35e0ddf15 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"item_changes\":{},\"item_key\":\"itemKey\"},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/actions-datastores/3cfdd0b8-c490-4969-8d51-69add64a70ea/items", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"id\":\"d0d6adeb-c5cf-4dce-98d9-532cbc386b09\",\"title\":\"datastore not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "eb4e6f96-0835-788b-946b-7bdecaa41629" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_OK_response.freeze new file mode 100644 index 00000000000..27714e5ed37 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:11.331Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_OK_response.json new file mode 100644 index 00000000000..9d5a3661bcb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_item_returns_OK_response.json @@ -0,0 +1,118 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"\",\"name\":\"Test Datastore\",\"org_access\":\"contributor\",\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6d5556c8-04d7-45dc-9a08-cd671c4e519a\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6574cf7e-1c55-24e1-45d2-b92f9fa74d2c" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"conflict_mode\":\"fail_on_conflict\",\"values\":[{\"data\":\"test-value\",\"id\":\"test-key\"}]},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores/6d5556c8-04d7-45dc-9a08-cd671c4e519a/items/bulk", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"94c791a3-9cc2-44be-857e-95c11eb1eefd\",\"type\":\"items\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7a043305-77c6-3475-577f-42fb5557012c" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"item_changes\":{},\"item_key\":\"test-key\"},\"type\":\"items\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/actions-datastores/6d5556c8-04d7-45dc-9a08-cd671c4e519a/items", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"94c791a3-9cc2-44be-857e-95c11eb1eefd\",\"type\":\"items\",\"attributes\":{\"created_at\":\"2025-09-05T22:54:11.652289Z\",\"modified_at\":\"2025-09-05T22:54:11.793763Z\",\"org_id\":321813,\"primary_column_name\":\"id\",\"signature\":\"{\\\"signature\\\":\\\"{\\\\\\\"version\\\\\\\":2,\\\\\\\"algorithm\\\\\\\":\\\\\\\"ecdsa-p384\\\\\\\",\\\\\\\"pubkey\\\\\\\":\\\\\\\"voTcDho3mVIVzY8m98GyVfIib84TgbZoHSWzVQ09TFU=\\\\\\\",\\\\\\\"timestamp\\\\\\\":1757112851,\\\\\\\"proof\\\\\\\":\\\\\\\"MGQCMGTEegXzPFeiOMj3tizwKvIXhJ2jLwzZW240N+HDLsvK2QIs1PD+6n/b15rdnABaigIwKYLG3PRtBKd8hV7eF4r9X5vM9fJvCyMPPi05K86m3lm22oxWEsDvLdgx0PxrojuT\\\\\\\"}\\\",\\\"version\\\":1}\",\"store_id\":\"6d5556c8-04d7-45dc-9a08-cd671c4e519a\",\"value\":{\"data\":\"test-value\",\"id\":\"test-key\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "93a537fb-0a41-dc84-45d9-adc0edcb24a2" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/6d5556c8-04d7-45dc-9a08-cd671c4e519a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6d5556c8-04d7-45dc-9a08-cd671c4e519a\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "30e81479-497a-13e8-0b39-f54cd866bfc3" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_datastore_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..46b1d9ed356 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:11.950Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_datastore_returns_Bad_Request_response.json new file mode 100644 index 00000000000..39bfb3d124d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{},\"id\":\"invalid-uuid\",\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/actions-datastores/invalid-uuid", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"id\":\"22fc6f64-67c9-44ad-b6e0-094dd77c7690\",\"title\":\"invalid path parameter\",\"detail\":\"invalid datastoreId format in path\",\"source\":{\"parameter\":\"datastoreId\"}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f7e2be7c-9634-a82b-c51d-7c0402fda314" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_datastore_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..cd4a108daff --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:12.100Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_datastore_returns_Not_Found_response.json new file mode 100644 index 00000000000..9fbf273e5d7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"updated name\"},\"id\":\"c1eb5bb8-726a-4e59-9a61-ccbb26f95329\",\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/actions-datastores/c1eb5bb8-726a-4e59-9a61-ccbb26f95329", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"id\":\"9738106a-d613-4be1-ad98-88760c9e0e9f\",\"title\":\"datastore not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7492d562-2109-0cf2-be6e-1cef2c60d941" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_datastore_returns_OK_response.freeze new file mode 100644 index 00000000000..b667a5007bb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T22:54:12.245Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_datastore_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_datastore_returns_OK_response.json new file mode 100644 index 00000000000..3300bd74e78 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_datastore_returns_OK_response.json @@ -0,0 +1,88 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"\",\"name\":\"Test Datastore\",\"org_access\":\"contributor\",\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"},\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/actions-datastores", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"785f6031-19e8-4dda-8ccc-f4e700ae5c99\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6574cf7e-1c55-24e1-45d2-b92f9fa74d2f" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"updated name\"},\"id\":\"785f6031-19e8-4dda-8ccc-f4e700ae5c99\",\"type\":\"datastores\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/actions-datastores/785f6031-19e8-4dda-8ccc-f4e700ae5c99", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"785f6031-19e8-4dda-8ccc-f4e700ae5c99\",\"type\":\"datastores\",\"attributes\":{\"created_at\":\"2025-09-05T22:54:12.386695Z\",\"creator_user_id\":1445416,\"creator_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"\",\"modified_at\":\"2025-09-05T22:54:12.575024Z\",\"name\":\"updated name\",\"org_id\":321813,\"primary_column_name\":\"id\",\"primary_key_generation_strategy\":\"none\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fb0181e7-c9a2-0aec-4f0d-5041e3f642d4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/actions-datastores/785f6031-19e8-4dda-8ccc-f4e700ae5c99", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"785f6031-19e8-4dda-8ccc-f4e700ae5c99\",\"type\":\"datastores\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2cb79983-af8e-fb8e-8222-36088882310c" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/actions_datastores.feature b/src/test/resources/com/datadog/api/client/v2/api/actions_datastores.feature new file mode 100644 index 00000000000..ed19da3aec2 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/actions_datastores.feature @@ -0,0 +1,220 @@ +@endpoint(actions-datastores) @endpoint(actions-datastores-v2) +Feature: Actions Datastores + Leverage the Actions Datastore API to create, modify, and delete items in + datastores owned by your organization. + + Background: + Given an instance of "ActionsDatastores" API + And a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + + @team:DataDog/app-builder-backend + Scenario: Bulk write datastore items returns "Bad Request" response + Given new "BulkWriteDatastoreItems" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"values": [{"id": "cust_3141", "name": "Johnathan"}, {"badPrimaryKey": "key2", "name": "Johnathan"}]}, "type": "items"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "item key missing or invalid" + + @team:DataDog/app-builder-backend + Scenario: Bulk write datastore items returns "Not Found" response + Given new "BulkWriteDatastoreItems" request + And request contains "datastore_id" parameter with value "70b87c26-886f-497a-bd9d-09f53bc9b40c" + And body with value {"data": {"attributes": {"values": [{"id": "cust_3141", "name": "Johnathan"}, {"id": "cust_3142", "name": "Mary"}]}, "type": "items"}} + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @team:DataDog/app-builder-backend + Scenario: Bulk write datastore items returns "OK" response + Given new "BulkWriteDatastoreItems" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"values": [{"id": "cust_3141", "name": "Johnathan"}, {"id": "cust_3142", "name": "Mary"}]}, "type": "items"}} + When the request is sent + Then the response status is 200 OK + And the response "data" has length 2 + + @team:DataDog/app-builder-backend + Scenario: Create datastore returns "Bad Request" response + Given new "CreateDatastore" request + And body with value {"data": {"attributes": {"name": "datastore-name", "primary_column_name": "0invalid_key"}, "type": "datastores"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore configuration invalid" + + @team:DataDog/app-builder-backend + Scenario: Create datastore returns "OK" response + Given new "CreateDatastore" request + And body with value {"data": {"attributes": {"name": "datastore-name", "primary_column_name": "primaryKey"}, "type": "datastores"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Delete datastore item returns "Bad Request" response + Given new "DeleteDatastoreItem" request + And request contains "datastore_id" parameter with value "invalid-uuid" + And body with value {"data": {"attributes": {"item_key": "primaryKey"}, "type": "items"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @team:DataDog/app-builder-backend + Scenario: Delete datastore item returns "Not Found" response + Given new "DeleteDatastoreItem" request + And request contains "datastore_id" parameter with value "70b87c26-886f-497a-bd9d-09f53bc9b40c" + And body with value {"data": {"attributes": {"item_key": "primaryKey"}, "type": "items"}} + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete datastore item returns "OK" response + Given new "DeleteDatastoreItem" request + And there is a valid "datastore" in the system + And there is a valid "datastore_item" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"item_key": "test-key"}, "type": "items" }} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Delete datastore returns "Bad Request" response + Given new "DeleteDatastore" request + And request contains "datastore_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @skip-typescript @skip-validation @team:DataDog/app-builder-backend + Scenario: Delete datastore returns "OK" response + Given new "DeleteDatastore" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Get datastore returns "Bad Request" response + Given new "GetDatastore" request + And request contains "datastore_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @team:DataDog/app-builder-backend + Scenario: Get datastore returns "Not Found" response + Given new "GetDatastore" request + And request contains "datastore_id" parameter with value "5bf53b3f-b230-4b35-ab1a-b39f2633eb22" + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @team:DataDog/app-builder-backend + Scenario: Get datastore returns "OK" response + Given new "GetDatastore" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{datastore.data.id}}" + + @team:DataDog/app-builder-backend + Scenario: List datastore items returns "Bad Request" response + Given new "ListDatastoreItems" request + And request contains "datastore_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @team:DataDog/app-builder-backend + Scenario: List datastore items returns "Not Found" response + Given new "ListDatastoreItems" request + And request contains "datastore_id" parameter with value "3cfdd0b8-c490-4969-8d51-69add64a70ea" + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: List datastore items returns "OK" response + Given new "ListDatastoreItems" request + And there is a valid "datastore" in the system + And there is a valid "datastore_item" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + + @team:DataDog/app-builder-backend + Scenario: List datastores returns "OK" response + Given new "ListDatastores" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Update datastore item returns "Bad Request" response + Given new "UpdateDatastoreItem" request + And request contains "datastore_id" parameter with value "invalid-uuid" + And body with value {"data": {"attributes": {"item_changes": {}, "item_key": ""}, "type": "items"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/app-builder-backend + Scenario: Update datastore item returns "Not Found" response + Given new "UpdateDatastoreItem" request + And request contains "datastore_id" parameter with value "3cfdd0b8-c490-4969-8d51-69add64a70ea" + And body with value {"data": {"attributes": {"item_changes": {}, "item_key": "itemKey"}, "type": "items"}} + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update datastore item returns "OK" response + Given new "UpdateDatastoreItem" request + And there is a valid "datastore" in the system + And there is a valid "datastore_item" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"item_changes": {}, "item_key": "test-key"}, "type": "items"}} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/app-builder-backend + Scenario: Update datastore returns "Bad Request" response + Given new "UpdateDatastore" request + And request contains "datastore_id" parameter with value "invalid-uuid" + And body with value {"data": {"attributes": {}, "type": "datastores", "id": "invalid-uuid"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "invalid path parameter" + + @team:DataDog/app-builder-backend + Scenario: Update datastore returns "Not Found" response + Given new "UpdateDatastore" request + And request contains "datastore_id" parameter with value "c1eb5bb8-726a-4e59-9a61-ccbb26f95329" + And body with value {"data": {"attributes": {"name": "updated name"}, "type": "datastores", "id": "c1eb5bb8-726a-4e59-9a61-ccbb26f95329"}} + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].title" is equal to "datastore not found" + + @team:DataDog/app-builder-backend + Scenario: Update datastore returns "OK" response + Given new "UpdateDatastore" request + And there is a valid "datastore" in the system + And request contains "datastore_id" parameter from "datastore.data.id" + And body with value {"data": {"attributes": {"name": "updated name"}, "type": "datastores", "id": "{{datastore.data.id}}"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "updated name" diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 4e0610f2f8f..a4872ca4d57 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -1,4 +1,32 @@ [ + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"datastores\",\n \"attributes\": {\n \"name\": \"Test Datastore\",\n \"primary_column_name\": \"id\",\n \"primary_key_generation_strategy\": \"none\",\n \"description\": \"\",\n \"org_access\": \"contributor\"\n }\n }\n}" + } + ], + "step": "there is a valid \"datastore\" in the system", + "key": "datastore", + "tag": "Actions Datastores", + "operationId": "CreateDatastore" + }, + { + "parameters": [ + { + "name": "datastore_id", + "source": "datastore.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"items\",\n \"attributes\": {\n \"conflict_mode\": \"fail_on_conflict\",\n \"values\": [\n {\n \"id\": \"test-key\",\n \"data\": \"test-value\"\n }\n ]\n }\n }\n}" + } + ], + "step": "there is a valid \"datastore_item\" in the system", + "key": "datastore_item", + "tag": "Actions Datastores", + "operationId": "BulkWriteDatastoreItems" + }, { "parameters": [ { diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index f9424d938fd..9aa936bc995 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1,4 +1,65 @@ { + "ListDatastores": { + "tag": "Actions Datastores", + "undo": { + "type": "safe" + } + }, + "CreateDatastore": { + "tag": "Actions Datastores", + "undo": { + "operationId": "DeleteDatastore", + "parameters": [ + { + "name": "datastore_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteDatastore": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, + "GetDatastore": { + "tag": "Actions Datastores", + "undo": { + "type": "safe" + } + }, + "UpdateDatastore": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, + "DeleteDatastoreItem": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, + "ListDatastoreItems": { + "tag": "Actions Datastores", + "undo": { + "type": "safe" + } + }, + "UpdateDatastoreItem": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, + "BulkWriteDatastoreItems": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, "ListAppKeyRegistrations": { "tag": "Action Connection", "undo": {