From f5ea8eac48b9d981c8c3d20506bb86596b4d24df Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 3 Oct 2025 15:33:41 +0000 Subject: [PATCH] Regenerate client from commit c65cf5e of spec repo --- .generator/schemas/v2/openapi.yaml | 102 +++++++++++++ ...-items-returns-Bad-Request-response.frozen | 1 + ...ore-items-returns-Bad-Request-response.yml | 65 ++++++++ ...re-items-returns-Not-Found-response.frozen | 1 + ...store-items-returns-Not-Found-response.yml | 25 +++ ...datastore-items-returns-OK-response.frozen | 1 + ...te-datastore-items-returns-OK-response.yml | 86 +++++++++++ .../BulkDeleteDatastoreItems.rb | 19 +++ features/scenarios_model_mapping.rb | 4 + features/v2/actions_datastores.feature | 31 +++- features/v2/undo.json | 6 + lib/datadog_api_client/inflector.rb | 5 + .../v2/api/actions_datastores_api.rb | 72 +++++++++ ...ulk_delete_apps_datastore_items_request.rb | 105 +++++++++++++ ...elete_apps_datastore_items_request_data.rb | 143 ++++++++++++++++++ ...datastore_items_request_data_attributes.rb | 125 +++++++++++++++ ..._apps_datastore_items_request_data_type.rb | 26 ++++ ...lete_apps_datastore_item_response_array.rb | 125 +++++++++++++++ 18 files changed, 940 insertions(+), 2 deletions(-) create mode 100644 cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-OK-response.frozen create mode 100644 cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-OK-response.yml create mode 100644 examples/v2/actions-datastores/BulkDeleteDatastoreItems.rb create mode 100644 lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request.rb create mode 100644 lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/delete_apps_datastore_item_response_array.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3d27f6798ca1..17509b56882d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -6553,6 +6553,46 @@ components: description: The type of the object, must be `budget`. type: string type: object + BulkDeleteAppsDatastoreItemsRequest: + description: Request to delete items from a datastore. + properties: + data: + $ref: '#/components/schemas/BulkDeleteAppsDatastoreItemsRequestData' + type: object + BulkDeleteAppsDatastoreItemsRequestData: + description: Data wrapper containing the data needed to delete items from a + datastore. + properties: + attributes: + $ref: '#/components/schemas/BulkDeleteAppsDatastoreItemsRequestDataAttributes' + id: + description: ID for the datastore of the items to delete. + type: string + type: + $ref: '#/components/schemas/BulkDeleteAppsDatastoreItemsRequestDataType' + required: + - type + type: object + BulkDeleteAppsDatastoreItemsRequestDataAttributes: + description: Attributes of request data to delete items from a datastore. + properties: + item_keys: + description: List of primary keys identifying items to delete from datastore. + Up to 100 items can be deleted in a single request. + items: + type: string + maxItems: 100 + type: array + type: object + BulkDeleteAppsDatastoreItemsRequestDataType: + default: items + description: Items resource type. + enum: + - items + example: items + type: string + x-enum-varnames: + - ITEMS BulkMuteFindingsRequest: description: The new bulk mute finding request. properties: @@ -14869,6 +14909,17 @@ components: data: $ref: '#/components/schemas/DeleteAppsDatastoreItemResponseData' type: object + DeleteAppsDatastoreItemResponseArray: + description: The definition of `DeleteAppsDatastoreItemResponseArray` object. + properties: + data: + description: The `DeleteAppsDatastoreItemResponseArray` `data`. + items: + $ref: '#/components/schemas/DeleteAppsDatastoreItemResponseData' + type: array + required: + - data + type: object DeleteAppsDatastoreItemResponseData: description: Data containing the identifier of the datastore item that was successfully deleted. @@ -51257,6 +51308,57 @@ paths: permissions: - apps_datastore_write /api/v2/actions-datastores/{datastore_id}/items/bulk: + delete: + description: Deletes multiple items from a datastore by their keys in a single + operation. + operationId: BulkDeleteDatastoreItems + parameters: + - description: The ID of the datastore. + in: path + name: datastore_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkDeleteAppsDatastoreItemsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteAppsDatastoreItemResponseArray' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + summary: Bulk delete datastore items + tags: + - Actions Datastores + x-permission: + operator: OR + permissions: + - apps_datastore_write post: description: Creates or replaces multiple items in a datastore by their keys in a single operation. diff --git a/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Bad-Request-response.frozen b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..1a4af2a579c3 --- /dev/null +++ b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-09-29T19:31:22.205Z \ No newline at end of file diff --git a/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Bad-Request-response.yml b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..5c3cf73a93cb --- /dev/null +++ b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Bad-Request-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Mon, 29 Sep 2025 19:31:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"2b088869-d596-4103-9cff-038b5f81fc0c","type":"datastores"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 29 Sep 2025 19:31:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"item_keys":[]},"type":"items"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/2b088869-d596-4103-9cff-038b5f81fc0c/items/bulk + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","id":"61325aff-aaa7-4571-80e2-e87ed8ffb103","title":"missing + required field","detail":"at least one item key is required"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Mon, 29 Sep 2025 19:31:22 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/2b088869-d596-4103-9cff-038b5f81fc0c + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"2b088869-d596-4103-9cff-038b5f81fc0c","type":"datastores"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Not-Found-response.frozen b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..993c6b84a01e --- /dev/null +++ b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-09-29T19:31:56.639Z \ No newline at end of file diff --git a/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Not-Found-response.yml b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Not-Found-response.yml new file mode 100644 index 000000000000..1eac7dcad92a --- /dev/null +++ b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Mon, 29 Sep 2025 19:31:56 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"item_keys":["nonexistent"]},"type":"items"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/c1eb5bb8-726a-4e59-9a61-ccbb26f95329/items/bulk + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","id":"d53325f5-a7f3-4075-ace7-f8e22a25b72f","title":"datastore + not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-OK-response.frozen b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-OK-response.frozen new file mode 100644 index 000000000000..21a63d0927ac --- /dev/null +++ b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-09-29T19:32:10.669Z \ No newline at end of file diff --git a/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-OK-response.yml b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-OK-response.yml new file mode 100644 index 000000000000..ecbca6644f41 --- /dev/null +++ b/cassettes/features/v2/actions_datastores/Bulk-delete-datastore-items-returns-OK-response.yml @@ -0,0 +1,86 @@ +http_interactions: +- recorded_at: Mon, 29 Sep 2025 19:32:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"","name":"Test Datastore","org_access":"contributor","primary_column_name":"id","primary_key_generation_strategy":"none"},"type":"datastores"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c6bc5eee-04af-4d7e-97a5-57c9c4dc0b15","type":"datastores"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 29 Sep 2025 19:32:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"conflict_mode":"fail_on_conflict","values":[{"data":"test-value","id":"test-key"}]},"type":"items"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/actions-datastores/c6bc5eee-04af-4d7e-97a5-57c9c4dc0b15/items/bulk + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"8267c8c1-dfcd-4364-83e5-359c0ab302fc","type":"items"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 29 Sep 2025 19:32:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"item_keys":["test-key"]},"type":"items"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/c6bc5eee-04af-4d7e-97a5-57c9c4dc0b15/items/bulk + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"8267c8c1-dfcd-4364-83e5-359c0ab302fc","type":"items"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 29 Sep 2025 19:32:10 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions-datastores/c6bc5eee-04af-4d7e-97a5-57c9c4dc0b15 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c6bc5eee-04af-4d7e-97a5-57c9c4dc0b15","type":"datastores"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/actions-datastores/BulkDeleteDatastoreItems.rb b/examples/v2/actions-datastores/BulkDeleteDatastoreItems.rb new file mode 100644 index 000000000000..388112f3545a --- /dev/null +++ b/examples/v2/actions-datastores/BulkDeleteDatastoreItems.rb @@ -0,0 +1,19 @@ +# Bulk delete datastore items returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ActionsDatastoresAPI.new + +# there is a valid "datastore" in the system +DATASTORE_DATA_ID = ENV["DATASTORE_DATA_ID"] + +body = DatadogAPIClient::V2::BulkDeleteAppsDatastoreItemsRequest.new({ + data: DatadogAPIClient::V2::BulkDeleteAppsDatastoreItemsRequestData.new({ + attributes: DatadogAPIClient::V2::BulkDeleteAppsDatastoreItemsRequestDataAttributes.new({ + item_keys: [ + "test-key", + ], + }), + type: DatadogAPIClient::V2::BulkDeleteAppsDatastoreItemsRequestDataType::ITEMS, + }), +}) +p api_instance.bulk_delete_datastore_items(DATASTORE_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index bb9b639b4075..5cbf5c8ea60e 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -867,6 +867,10 @@ "datastore_id" => "String", "body" => "UpdateAppsDatastoreItemRequest", }, + "v2.BulkDeleteDatastoreItems" => { + "datastore_id" => "String", + "body" => "BulkDeleteAppsDatastoreItemsRequest", + }, "v2.BulkWriteDatastoreItems" => { "datastore_id" => "String", "body" => "BulkPutAppsDatastoreItemsRequest", diff --git a/features/v2/actions_datastores.feature b/features/v2/actions_datastores.feature index ed19da3aec27..a8cd02fe0529 100644 --- a/features/v2/actions_datastores.feature +++ b/features/v2/actions_datastores.feature @@ -4,9 +4,36 @@ Feature: Actions Datastores datastores owned by your organization. Background: - Given an instance of "ActionsDatastores" API - And a valid "apiKeyAuth" key in the system + Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system + And an instance of "ActionsDatastores" API + + @team:DataDog/app-builder-backend + Scenario: Bulk delete datastore items returns "Bad Request" response + Given new "BulkDeleteDatastoreItems" 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": {"item_keys": []}, "type": "items"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/app-builder-backend + Scenario: Bulk delete datastore items returns "Not Found" response + Given new "BulkDeleteDatastoreItems" request + And request contains "datastore_id" parameter with value "c1eb5bb8-726a-4e59-9a61-ccbb26f95329" + And body with value {"data": {"attributes": {"item_keys": ["nonexistent"]}, "type": "items"}} + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Bulk delete datastore items returns "OK" response + Given new "BulkDeleteDatastoreItems" 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_keys": ["test-key"]}, "type": "items"}} + When the request is sent + Then the response status is 200 OK @team:DataDog/app-builder-backend Scenario: Bulk write datastore items returns "Bad Request" response diff --git a/features/v2/undo.json b/features/v2/undo.json index 95d8a19dcbd2..c4c269d3cab9 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -54,6 +54,12 @@ "type": "idempotent" } }, + "BulkDeleteDatastoreItems": { + "tag": "Actions Datastores", + "undo": { + "type": "idempotent" + } + }, "BulkWriteDatastoreItems": { "tag": "Actions Datastores", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index f092fe16fdb9..31aa072fd693 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1285,6 +1285,10 @@ def overrides "v2.budget_entry" => "BudgetEntry", "v2.budget_with_entries" => "BudgetWithEntries", "v2.budget_with_entries_data" => "BudgetWithEntriesData", + "v2.bulk_delete_apps_datastore_items_request" => "BulkDeleteAppsDatastoreItemsRequest", + "v2.bulk_delete_apps_datastore_items_request_data" => "BulkDeleteAppsDatastoreItemsRequestData", + "v2.bulk_delete_apps_datastore_items_request_data_attributes" => "BulkDeleteAppsDatastoreItemsRequestDataAttributes", + "v2.bulk_delete_apps_datastore_items_request_data_type" => "BulkDeleteAppsDatastoreItemsRequestDataType", "v2.bulk_mute_findings_request" => "BulkMuteFindingsRequest", "v2.bulk_mute_findings_request_attributes" => "BulkMuteFindingsRequestAttributes", "v2.bulk_mute_findings_request_data" => "BulkMuteFindingsRequestData", @@ -1773,6 +1777,7 @@ def overrides "v2.delete_apps_datastore_item_request_data" => "DeleteAppsDatastoreItemRequestData", "v2.delete_apps_datastore_item_request_data_attributes" => "DeleteAppsDatastoreItemRequestDataAttributes", "v2.delete_apps_datastore_item_response" => "DeleteAppsDatastoreItemResponse", + "v2.delete_apps_datastore_item_response_array" => "DeleteAppsDatastoreItemResponseArray", "v2.delete_apps_datastore_item_response_data" => "DeleteAppsDatastoreItemResponseData", "v2.delete_apps_request" => "DeleteAppsRequest", "v2.delete_apps_request_data_items" => "DeleteAppsRequestDataItems", diff --git a/lib/datadog_api_client/v2/api/actions_datastores_api.rb b/lib/datadog_api_client/v2/api/actions_datastores_api.rb index e7c799fcd8d4..48af2540e4e4 100644 --- a/lib/datadog_api_client/v2/api/actions_datastores_api.rb +++ b/lib/datadog_api_client/v2/api/actions_datastores_api.rb @@ -23,6 +23,78 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Bulk delete datastore items. + # + # @see #bulk_delete_datastore_items_with_http_info + def bulk_delete_datastore_items(datastore_id, body, opts = {}) + data, _status_code, _headers = bulk_delete_datastore_items_with_http_info(datastore_id, body, opts) + data + end + + # Bulk delete datastore items. + # + # Deletes multiple items from a datastore by their keys in a single operation. + # + # @param datastore_id [String] The ID of the datastore. + # @param body [BulkDeleteAppsDatastoreItemsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(DeleteAppsDatastoreItemResponseArray, Integer, Hash)>] DeleteAppsDatastoreItemResponseArray data, response status code and response headers + def bulk_delete_datastore_items_with_http_info(datastore_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ActionsDatastoresAPI.bulk_delete_datastore_items ...' + end + # verify the required parameter 'datastore_id' is set + if @api_client.config.client_side_validation && datastore_id.nil? + fail ArgumentError, "Missing the required parameter 'datastore_id' when calling ActionsDatastoresAPI.bulk_delete_datastore_items" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ActionsDatastoresAPI.bulk_delete_datastore_items" + end + # resource path + local_var_path = '/api/v2/actions-datastores/{datastore_id}/items/bulk'.sub('{datastore_id}', CGI.escape(datastore_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'DeleteAppsDatastoreItemResponseArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :bulk_delete_datastore_items, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ActionsDatastoresAPI#bulk_delete_datastore_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Bulk write datastore items. # # @see #bulk_write_datastore_items_with_http_info diff --git a/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request.rb b/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request.rb new file mode 100644 index 000000000000..5fa2b96e3335 --- /dev/null +++ b/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to delete items from a datastore. + class BulkDeleteAppsDatastoreItemsRequest + include BaseGenericModel + + # Data wrapper containing the data needed to delete items from a datastore. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'BulkDeleteAppsDatastoreItemsRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::BulkDeleteAppsDatastoreItemsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data.rb b/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data.rb new file mode 100644 index 000000000000..8fbc3616f2b0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data wrapper containing the data needed to delete items from a datastore. + class BulkDeleteAppsDatastoreItemsRequestData + include BaseGenericModel + + # Attributes of request data to delete items from a datastore. + attr_accessor :attributes + + # ID for the datastore of the items to delete. + attr_accessor :id + + # Items resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'BulkDeleteAppsDatastoreItemsRequestDataAttributes', + :'id' => :'String', + :'type' => :'BulkDeleteAppsDatastoreItemsRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::BulkDeleteAppsDatastoreItemsRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data_attributes.rb b/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data_attributes.rb new file mode 100644 index 000000000000..888a757d5ce8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of request data to delete items from a datastore. + class BulkDeleteAppsDatastoreItemsRequestDataAttributes + include BaseGenericModel + + # List of primary keys identifying items to delete from datastore. Up to 100 items can be deleted in a single request. + attr_reader :item_keys + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'item_keys' => :'item_keys' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'item_keys' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::BulkDeleteAppsDatastoreItemsRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'item_keys') + if (value = attributes[:'item_keys']).is_a?(Array) + self.item_keys = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@item_keys.nil? && @item_keys.length > 100 + true + end + + # Custom attribute writer method with validation + # @param item_keys [Object] Object to be assigned + # @!visibility private + def item_keys=(item_keys) + if !item_keys.nil? && item_keys.length > 100 + fail ArgumentError, 'invalid value for "item_keys", number of items must be less than or equal to 100.' + end + @item_keys = item_keys + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + item_keys == o.item_keys && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [item_keys, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data_type.rb b/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data_type.rb new file mode 100644 index 000000000000..76df06430da0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/bulk_delete_apps_datastore_items_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Items resource type. + class BulkDeleteAppsDatastoreItemsRequestDataType + include BaseEnumModel + + ITEMS = "items".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/delete_apps_datastore_item_response_array.rb b/lib/datadog_api_client/v2/models/delete_apps_datastore_item_response_array.rb new file mode 100644 index 000000000000..d9a4a3735959 --- /dev/null +++ b/lib/datadog_api_client/v2/models/delete_apps_datastore_item_response_array.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `DeleteAppsDatastoreItemResponseArray` object. + class DeleteAppsDatastoreItemResponseArray + include BaseGenericModel + + # The `DeleteAppsDatastoreItemResponseArray` `data`. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeleteAppsDatastoreItemResponseArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end