From 3f2e17ffa3eb755c9090fc8a203cc522bc67cedd Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 22 Jul 2026 14:46:12 +0000 Subject: [PATCH] Regenerate client from commit 61e9439 of spec repo --- .generator/schemas/v2/openapi.yaml | 212 +++++++++++++++++- examples/v2/forms/ListFormVersions.rb | 8 + examples/v2/forms/RevertFormVersion.rb | 8 + features/scenarios_model_mapping.rb | 7 + features/v2/forms.feature | 60 +++++ features/v2/undo.json | 12 + lib/datadog_api_client/configuration.rb | 2 + lib/datadog_api_client/inflector.rb | 4 + lib/datadog_api_client/v2/api/forms_api.rb | 154 ++++++++++++- .../v2/models/form_data_attributes.rb | 3 +- .../v2/models/form_version_attributes.rb | 12 +- .../v2/models/form_version_list_type.rb | 26 +++ .../v2/models/list_form_versions_data.rb | 165 ++++++++++++++ .../list_form_versions_data_attributes.rb | 125 +++++++++++ .../v2/models/list_form_versions_response.rb | 123 ++++++++++ 15 files changed, 912 insertions(+), 9 deletions(-) create mode 100644 examples/v2/forms/ListFormVersions.rb create mode 100644 examples/v2/forms/RevertFormVersion.rb create mode 100644 lib/datadog_api_client/v2/models/form_version_list_type.rb create mode 100644 lib/datadog_api_client/v2/models/list_form_versions_data.rb create mode 100644 lib/datadog_api_client/v2/models/list_form_versions_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/list_form_versions_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 90e1196820ee..c193f8dae537 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -39804,7 +39804,9 @@ components: nullable: true type: string has_submitted: - description: Whether the current user has already submitted this form. Only present for forms with `single_response` set to `true`. + description: |- + Whether the current user has already submitted this form. Only present for forms with + `single_response` set to `true`. nullable: true type: boolean idp_survey: @@ -40119,6 +40121,10 @@ components: example: b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d nullable: true type: string + has_ever_been_published: + description: Whether this version number has ever appeared in the form's publication history. + example: true + type: boolean id: description: The ID of the form version. example: "126" @@ -40175,6 +40181,15 @@ components: - type - attributes type: object + FormVersionListType: + default: form_version_lists + description: The resource type for a list of form versions. + enum: + - form_version_lists + example: form_version_lists + type: string + x-enum-varnames: + - FORM_VERSION_LISTS FormVersionResponse: description: A response containing a single form version. properties: @@ -58917,6 +58932,41 @@ components: - data - meta type: object + ListFormVersionsData: + description: A list-of-form-versions resource object. + properties: + attributes: + $ref: "#/components/schemas/ListFormVersionsDataAttributes" + id: + description: The ID of the form. + example: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + type: string + type: + $ref: "#/components/schemas/FormVersionListType" + required: + - id + - type + - attributes + type: object + ListFormVersionsDataAttributes: + description: The attributes for a list of form versions. + properties: + versions: + description: The list of versions for the form. + items: + $ref: "#/components/schemas/FormVersionAttributes" + type: array + required: + - versions + type: object + ListFormVersionsResponse: + description: A response containing the list of versions for a form. + properties: + data: + $ref: "#/components/schemas/ListFormVersionsData" + required: + - data + type: object ListHistoricalJobsResponse: description: List of historical jobs. properties: @@ -139209,7 +139259,9 @@ paths: **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: - description: Create a new form. The form is created in draft mode and must be published before it can be used. This also creates a new datastore for form responses and links it to the form. + description: |- + Create a new form. The form is created in draft mode and must be published before it can be used. This + also creates a new datastore for form responses and links it to the form. operationId: CreateForm requestBody: content: @@ -139283,7 +139335,9 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/forms/create_and_publish: post: - description: Creates a new form and immediately publishes its initial version. This also creates a new datastore for form responses and links it to the form. + description: |- + Creates a new form and immediately publishes its initial version. This also creates a new datastore for + form responses and links it to the form. operationId: CreateAndPublishForm requestBody: content: @@ -139413,7 +139467,9 @@ paths: schema: format: uuid type: string - - description: The version of the form to retrieve. Use 'latest' for the most recent draft, 'published' for the last published version, or a specific version number. + - description: |- + The version of the form to retrieve. Use 'latest' for the most recent draft, 'published' for the + last published version, or a specific version number. in: query name: version required: false @@ -139720,6 +139776,72 @@ paths: **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/forms/{form_id}/versions: + get: + description: List all versions of a form. + operationId: ListFormVersions + parameters: + - description: The ID of the form. + example: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + in: path + name: form_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + versions: + - created_at: "2026-05-29T20:06:14.895921Z" + data_definition: {} + definition_signature: >- + {"signature":"b7f312957a80cea2c8c9950532b205a90a3f8a7ebb7e52fc25437a25d903d545", "version":1} + etag: b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d + has_ever_been_published: true + id: "126" + modified_at: "2026-05-29T20:06:14.949163Z" + state: draft + ui_definition: {} + user_id: 10001 + user_uuid: 1fc709aa-be19-4539-a47d-52a30d78a978 + version: 2 + id: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + type: form_version_lists + schema: + $ref: "#/components/schemas/ListFormVersionsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List form versions + tags: + - Forms + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- Create or update the latest draft version of a form. The `upsert_params` field controls @@ -139763,7 +139885,8 @@ paths: created_at: "2026-05-29T20:06:14.895921Z" data_definition: $ref: "#/components/schemas/FormDataDefinition" - definition_signature: '{"signature":"b7f312957a80cea2c8c9950532b205a90a3f8a7ebb7e52fc25437a25d903d545","version":1}' + definition_signature: >- + {"signature":"b7f312957a80cea2c8c9950532b205a90a3f8a7ebb7e52fc25437a25d903d545", "version":1} etag: b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d modified_at: "2026-05-29T20:06:14.949163Z" state: draft @@ -139802,6 +139925,85 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/forms/{form_id}/versions/revert: + post: + description: Revert a form to a prior version by creating a new draft version copied from it. + operationId: RevertFormVersion + parameters: + - description: The ID of the form. + example: 22f6006a-2302-4926-9396-d2dfcf7b0b34 + in: path + name: form_id + required: true + schema: + format: uuid + type: string + - description: The version number to revert to. + example: 1 + in: query + name: version + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-29T20:10:14.895921Z" + data_definition: + $ref: "#/components/schemas/FormDataDefinition" + definition_signature: >- + {"signature":"c8f312957a80cea2c8c9950532b205a90a3f8a7ebb7e52fc25437a25d903d545", "version":1} + etag: c61f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d + modified_at: "2026-05-29T20:10:14.949163Z" + state: draft + ui_definition: {} + user_id: 10001 + user_uuid: 1fc709aa-be19-4539-a47d-52a30d78a978 + version: 3 + id: "127" + type: form_versions + schema: + $ref: "#/components/schemas/FormVersionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Revert a form to a prior version + tags: + - Forms + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/forms/{form_id}/versions/upsert_and_publish: post: description: Upsert the latest form version and publish it in a single atomic transaction. diff --git a/examples/v2/forms/ListFormVersions.rb b/examples/v2/forms/ListFormVersions.rb new file mode 100644 index 000000000000..114a859a60c9 --- /dev/null +++ b/examples/v2/forms/ListFormVersions.rb @@ -0,0 +1,8 @@ +# List form versions returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_form_versions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new +p api_instance.list_form_versions("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/forms/RevertFormVersion.rb b/examples/v2/forms/RevertFormVersion.rb new file mode 100644 index 000000000000..15b6ccc5ae9d --- /dev/null +++ b/examples/v2/forms/RevertFormVersion.rb @@ -0,0 +1,8 @@ +# Revert a form to a prior version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.revert_form_version".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new +p api_instance.revert_form_version("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", 9223372036854775807) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 422ed8b0de7c..d4410c2ba2e6 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3409,10 +3409,17 @@ "form_id" => "UUID", "body" => "PublishFormRequest", }, + "v2.ListFormVersions" => { + "form_id" => "UUID", + }, "v2.UpsertFormVersion" => { "form_id" => "UUID", "body" => "UpsertFormVersionRequest", }, + "v2.RevertFormVersion" => { + "form_id" => "UUID", + "version" => "Integer", + }, "v2.UpsertAndPublishFormVersion" => { "form_id" => "UUID", "body" => "UpsertAndPublishFormVersionRequest", diff --git a/features/v2/forms.feature b/features/v2/forms.feature index eb380d0f845a..26c3af40da8f 100644 --- a/features/v2/forms.feature +++ b/features/v2/forms.feature @@ -143,6 +143,30 @@ Feature: Forms And the response "data.type" is equal to "forms" And the response "data.attributes.name" is equal to "{{ unique }}" + @generated @skip @team:DataDog/app-builder-backend + Scenario: List form versions returns "Bad Request" response + Given operation "ListFormVersions" enabled + And new "ListFormVersions" request + And request contains "form_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List form versions returns "Not Found" response + Given operation "ListFormVersions" enabled + And new "ListFormVersions" request + And request contains "form_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List form versions returns "OK" response + Given operation "ListFormVersions" enabled + And new "ListFormVersions" request + And request contains "form_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend Scenario: List forms returns "Bad Request" response Given operation "ListForms" enabled @@ -189,6 +213,42 @@ Feature: Forms When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert a form to a prior version returns "Bad Request" response + Given operation "RevertFormVersion" enabled + And new "RevertFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert a form to a prior version returns "Conflict" response + Given operation "RevertFormVersion" enabled + And new "RevertFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert a form to a prior version returns "Not Found" response + Given operation "RevertFormVersion" enabled + And new "RevertFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert a form to a prior version returns "OK" response + Given operation "RevertFormVersion" enabled + And new "RevertFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend Scenario: Update a form returns "Bad Request" response Given operation "UpdateForm" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index e72767d8e0d5..437f8944b51b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2792,12 +2792,24 @@ "type": "idempotent" } }, + "ListFormVersions": { + "tag": "Forms", + "undo": { + "type": "safe" + } + }, "UpsertFormVersion": { "tag": "Forms", "undo": { "type": "idempotent" } }, + "RevertFormVersion": { + "tag": "Forms", + "undo": { + "type": "unsafe" + } + }, "UpsertAndPublishFormVersion": { "tag": "Forms", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 03e3dca8a1d1..0550e48f4697 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -453,7 +453,9 @@ def initialize "v2.delete_form": false, "v2.get_form": false, "v2.list_forms": false, + "v2.list_form_versions": false, "v2.publish_form": false, + "v2.revert_form_version": false, "v2.update_form": false, "v2.upsert_and_publish_form_version": false, "v2.upsert_form_version": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7e745a19486c..b952d41e932b 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3434,6 +3434,7 @@ def overrides "v2.form_update_attributes" => "FormUpdateAttributes", "v2.form_version_attributes" => "FormVersionAttributes", "v2.form_version_data" => "FormVersionData", + "v2.form_version_list_type" => "FormVersionListType", "v2.form_version_response" => "FormVersionResponse", "v2.form_version_state" => "FormVersionState", "v2.form_version_type" => "FormVersionType", @@ -4191,6 +4192,9 @@ def overrides "v2.list_findings_meta" => "ListFindingsMeta", "v2.list_findings_page" => "ListFindingsPage", "v2.list_findings_response" => "ListFindingsResponse", + "v2.list_form_versions_data" => "ListFormVersionsData", + "v2.list_form_versions_data_attributes" => "ListFormVersionsDataAttributes", + "v2.list_form_versions_response" => "ListFormVersionsResponse", "v2.list_historical_jobs_response" => "ListHistoricalJobsResponse", "v2.list_integrations_response" => "ListIntegrationsResponse", "v2.list_interface_tags_response" => "ListInterfaceTagsResponse", diff --git a/lib/datadog_api_client/v2/api/forms_api.rb b/lib/datadog_api_client/v2/api/forms_api.rb index e0a1db29b6d5..c7118176257b 100644 --- a/lib/datadog_api_client/v2/api/forms_api.rb +++ b/lib/datadog_api_client/v2/api/forms_api.rb @@ -111,7 +111,8 @@ def create_and_publish_form(body, opts = {}) # Create and publish a form. # - # Creates a new form and immediately publishes its initial version. This also creates a new datastore for form responses and links it to the form. + # Creates a new form and immediately publishes its initial version. This also creates a new datastore for + # form responses and links it to the form. # # @param body [CreateFormRequest] # @param opts [Hash] the optional parameters @@ -184,7 +185,8 @@ def create_form(body, opts = {}) # Create a form. # - # Create a new form. The form is created in draft mode and must be published before it can be used. This also creates a new datastore for form responses and links it to the form. + # Create a new form. The form is created in draft mode and must be published before it can be used. This + # also creates a new datastore for form responses and links it to the form. # # @param body [CreateFormRequest] # @param opts [Hash] the optional parameters @@ -457,6 +459,77 @@ def list_forms_with_http_info(opts = {}) return data, status_code, headers end + # List form versions. + # + # @see #list_form_versions_with_http_info + def list_form_versions(form_id, opts = {}) + data, _status_code, _headers = list_form_versions_with_http_info(form_id, opts) + data + end + + # List form versions. + # + # List all versions of a form. + # + # @param form_id [UUID] The ID of the form. + # @param opts [Hash] the optional parameters + # @return [Array<(ListFormVersionsResponse, Integer, Hash)>] ListFormVersionsResponse data, response status code and response headers + def list_form_versions_with_http_info(form_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_form_versions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_form_versions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_form_versions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.list_form_versions ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.list_form_versions" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}/versions'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListFormVersionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_form_versions, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#list_form_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Publish a form version. # # @see #publish_form_with_http_info @@ -535,6 +608,83 @@ def publish_form_with_http_info(form_id, body, opts = {}) return data, status_code, headers end + # Revert a form to a prior version. + # + # @see #revert_form_version_with_http_info + def revert_form_version(form_id, version, opts = {}) + data, _status_code, _headers = revert_form_version_with_http_info(form_id, version, opts) + data + end + + # Revert a form to a prior version. + # + # Revert a form to a prior version by creating a new draft version copied from it. + # + # @param form_id [UUID] The ID of the form. + # @param version [Integer] The version number to revert to. + # @param opts [Hash] the optional parameters + # @return [Array<(FormVersionResponse, Integer, Hash)>] FormVersionResponse data, response status code and response headers + def revert_form_version_with_http_info(form_id, version, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.revert_form_version".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.revert_form_version") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.revert_form_version")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.revert_form_version ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.revert_form_version" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling FormsAPI.revert_form_version" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}/versions/revert'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'version'] = version + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'FormVersionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :revert_form_version, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#revert_form_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a form. # # @see #update_form_with_http_info diff --git a/lib/datadog_api_client/v2/models/form_data_attributes.rb b/lib/datadog_api_client/v2/models/form_data_attributes.rb index e0268bb42330..ae9fa0131247 100644 --- a/lib/datadog_api_client/v2/models/form_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/form_data_attributes.rb @@ -39,7 +39,8 @@ class FormDataAttributes # The date and time at which the form stops accepting responses. attr_accessor :end_date - # Whether the current user has already submitted this form. Only present for forms with `single_response` set to `true`. + # Whether the current user has already submitted this form. Only present for forms with + # `single_response` set to `true`. attr_accessor :has_submitted # Whether the form is an IDP survey. diff --git a/lib/datadog_api_client/v2/models/form_version_attributes.rb b/lib/datadog_api_client/v2/models/form_version_attributes.rb index da7e67b49850..1724791a1dc6 100644 --- a/lib/datadog_api_client/v2/models/form_version_attributes.rb +++ b/lib/datadog_api_client/v2/models/form_version_attributes.rb @@ -33,6 +33,9 @@ class FormVersionAttributes # The ETag for optimistic concurrency control. attr_accessor :etag + # Whether this version number has ever appeared in the form's publication history. + attr_accessor :has_ever_been_published + # The ID of the form version. attr_accessor :id @@ -64,6 +67,7 @@ def self.attribute_map :'data_definition' => :'data_definition', :'definition_signature' => :'definition_signature', :'etag' => :'etag', + :'has_ever_been_published' => :'has_ever_been_published', :'id' => :'id', :'modified_at' => :'modified_at', :'state' => :'state', @@ -82,6 +86,7 @@ def self.openapi_types :'data_definition' => :'FormDataDefinition', :'definition_signature' => :'String', :'etag' => :'String', + :'has_ever_been_published' => :'Boolean', :'id' => :'String', :'modified_at' => :'Time', :'state' => :'FormVersionState', @@ -134,6 +139,10 @@ def initialize(attributes = {}) self.etag = attributes[:'etag'] end + if attributes.key?(:'has_ever_been_published') + self.has_ever_been_published = attributes[:'has_ever_been_published'] + end + if attributes.key?(:'id') self.id = attributes[:'id'] end @@ -299,6 +308,7 @@ def ==(o) data_definition == o.data_definition && definition_signature == o.definition_signature && etag == o.etag && + has_ever_been_published == o.has_ever_been_published && id == o.id && modified_at == o.modified_at && state == o.state && @@ -313,7 +323,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created_at, data_definition, definition_signature, etag, id, modified_at, state, ui_definition, user_id, user_uuid, version, additional_properties].hash + [created_at, data_definition, definition_signature, etag, has_ever_been_published, id, modified_at, state, ui_definition, user_id, user_uuid, version, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/form_version_list_type.rb b/lib/datadog_api_client/v2/models/form_version_list_type.rb new file mode 100644 index 000000000000..c7a0f2e9f852 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_list_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type for a list of form versions. + class FormVersionListType + include BaseEnumModel + + FORM_VERSION_LISTS = "form_version_lists".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/list_form_versions_data.rb b/lib/datadog_api_client/v2/models/list_form_versions_data.rb new file mode 100644 index 000000000000..bdfb87a40c6d --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_form_versions_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A list-of-form-versions resource object. + class ListFormVersionsData + include BaseGenericModel + + # The attributes for a list of form versions. + attr_reader :attributes + + # The ID of the form. + attr_reader :id + + # The resource type for a list of form versions. + 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' => :'ListFormVersionsDataAttributes', + :'id' => :'String', + :'type' => :'FormVersionListType' + } + 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::ListFormVersionsData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_form_versions_data_attributes.rb b/lib/datadog_api_client/v2/models/list_form_versions_data_attributes.rb new file mode 100644 index 000000000000..0e0385b6f908 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_form_versions_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 + # The attributes for a list of form versions. + class ListFormVersionsDataAttributes + include BaseGenericModel + + # The list of versions for the form. + attr_reader :versions + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'versions' => :'versions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'versions' => :'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::ListFormVersionsDataAttributes` 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?(:'versions') + if (value = attributes[:'versions']).is_a?(Array) + self.versions = 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 @versions.nil? + true + end + + # Custom attribute writer method with validation + # @param versions [Object] Object to be assigned + # @!visibility private + def versions=(versions) + if versions.nil? + fail ArgumentError, 'invalid value for "versions", versions cannot be nil.' + end + @versions = versions + 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 && + versions == o.versions && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [versions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_form_versions_response.rb b/lib/datadog_api_client/v2/models/list_form_versions_response.rb new file mode 100644 index 000000000000..2c4b0ce10c39 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_form_versions_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A response containing the list of versions for a form. + class ListFormVersionsResponse + include BaseGenericModel + + # A list-of-form-versions resource object. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ListFormVersionsData' + } + 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::ListFormVersionsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end