diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 85f3c28c11..456f053356 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: @@ -139534,7 +139584,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: @@ -139608,7 +139660,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: @@ -139738,7 +139792,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 @@ -140045,6 +140101,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 @@ -140088,7 +140210,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 @@ -140127,6 +140250,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/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index d613073e4e..938e58501b 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -15971,6 +15971,13 @@ datadog\_api\_client.v2.model.form\_version\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.form\_version\_list\_type module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_version_list_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.form\_version\_response module ------------------------------------------------------------ @@ -21326,6 +21333,27 @@ datadog\_api\_client.v2.model.list\_findings\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_form\_versions\_data module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_form_versions_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_form\_versions\_data\_attributes module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_form_versions_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_form\_versions\_response module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_form_versions_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_historical\_jobs\_response module --------------------------------------------------------------------- diff --git a/examples/v2/forms/ListFormVersions.py b/examples/v2/forms/ListFormVersions.py new file mode 100644 index 0000000000..aad18955fb --- /dev/null +++ b/examples/v2/forms/ListFormVersions.py @@ -0,0 +1,17 @@ +""" +List form versions returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["list_form_versions"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.list_form_versions( + form_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/forms/RevertFormVersion.py b/examples/v2/forms/RevertFormVersion.py new file mode 100644 index 0000000000..37d2995997 --- /dev/null +++ b/examples/v2/forms/RevertFormVersion.py @@ -0,0 +1,18 @@ +""" +Revert a form to a prior version returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["revert_form_version"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.revert_form_version( + form_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + version=9223372036854775807, + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index fbb2249e6b..307a688686 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -512,7 +512,9 @@ def __init__( "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/src/datadog_api_client/v2/api/forms_api.py b/src/datadog_api_client/v2/api/forms_api.py index e2439b0563..918422121b 100644 --- a/src/datadog_api_client/v2/api/forms_api.py +++ b/src/datadog_api_client/v2/api/forms_api.py @@ -20,6 +20,7 @@ from datadog_api_client.v2.model.clone_form_request import CloneFormRequest from datadog_api_client.v2.model.form_publication_response import FormPublicationResponse from datadog_api_client.v2.model.publish_form_request import PublishFormRequest +from datadog_api_client.v2.model.list_form_versions_response import ListFormVersionsResponse from datadog_api_client.v2.model.form_version_response import FormVersionResponse from datadog_api_client.v2.model.upsert_form_version_request import UpsertFormVersionRequest from datadog_api_client.v2.model.upsert_and_publish_form_version_request import UpsertAndPublishFormVersionRequest @@ -169,6 +170,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_form_versions_endpoint = _Endpoint( + settings={ + "response_type": (ListFormVersionsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/{form_id}/versions", + "operation_id": "list_form_versions", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "form_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "form_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._publish_form_endpoint = _Endpoint( settings={ "response_type": (FormPublicationResponse,), @@ -195,6 +219,35 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._revert_form_version_endpoint = _Endpoint( + settings={ + "response_type": (FormVersionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/{form_id}/versions/revert", + "operation_id": "revert_form_version", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "form_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "form_id", + "location": "path", + }, + "version": { + "required": True, + "openapi_types": (int,), + "attribute": "version", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._update_form_endpoint = _Endpoint( settings={ "response_type": (FormResponse,), @@ -300,7 +353,8 @@ def create_and_publish_form( ) -> FormResponse: """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. :type body: CreateFormRequest :rtype: FormResponse @@ -316,7 +370,8 @@ def create_form( ) -> FormResponse: """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. :type body: CreateFormRequest :rtype: FormResponse @@ -355,7 +410,8 @@ def get_form( :param form_id: The ID of the form. :type form_id: UUID - :param version: 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. + :param version: 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. :type version: str, optional :rtype: FormResponse """ @@ -379,6 +435,23 @@ def list_forms( kwargs: Dict[str, Any] = {} return self._list_forms_endpoint.call_with_http_info(**kwargs) + def list_form_versions( + self, + form_id: UUID, + ) -> ListFormVersionsResponse: + """List form versions. + + List all versions of a form. + + :param form_id: The ID of the form. + :type form_id: UUID + :rtype: ListFormVersionsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["form_id"] = form_id + + return self._list_form_versions_endpoint.call_with_http_info(**kwargs) + def publish_form( self, form_id: UUID, @@ -400,6 +473,28 @@ def publish_form( return self._publish_form_endpoint.call_with_http_info(**kwargs) + def revert_form_version( + self, + form_id: UUID, + version: int, + ) -> FormVersionResponse: + """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: The ID of the form. + :type form_id: UUID + :param version: The version number to revert to. + :type version: int + :rtype: FormVersionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["form_id"] = form_id + + kwargs["version"] = version + + return self._revert_form_version_endpoint.call_with_http_info(**kwargs) + def update_form( self, form_id: UUID, diff --git a/src/datadog_api_client/v2/model/form_data_attributes.py b/src/datadog_api_client/v2/model/form_data_attributes.py index 285e74bd4b..901f5052e9 100644 --- a/src/datadog_api_client/v2/model/form_data_attributes.py +++ b/src/datadog_api_client/v2/model/form_data_attributes.py @@ -111,7 +111,8 @@ def __init__( :param end_date: The date and time at which the form stops accepting responses. :type end_date: datetime, none_type, optional - :param has_submitted: Whether the current user has already submitted this form. Only present for forms with ``single_response`` set to ``true``. + :param has_submitted: Whether the current user has already submitted this form. Only present for forms with + ``single_response`` set to ``true``. :type has_submitted: bool, none_type, optional :param idp_survey: Whether the form is an IDP survey. diff --git a/src/datadog_api_client/v2/model/form_version_attributes.py b/src/datadog_api_client/v2/model/form_version_attributes.py index c5a92d9c7a..93677f5dcf 100644 --- a/src/datadog_api_client/v2/model/form_version_attributes.py +++ b/src/datadog_api_client/v2/model/form_version_attributes.py @@ -34,6 +34,7 @@ def openapi_types(_): "data_definition": (FormDataDefinition,), "definition_signature": (str,), "etag": (str, none_type), + "has_ever_been_published": (bool,), "id": (str,), "modified_at": (datetime,), "state": (FormVersionState,), @@ -48,6 +49,7 @@ def openapi_types(_): "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", @@ -69,6 +71,7 @@ def __init__( user_id: int, user_uuid: UUID, version: int, + has_ever_been_published: Union[bool, UnsetType] = unset, id: Union[str, UnsetType] = unset, **kwargs, ): @@ -87,6 +90,9 @@ def __init__( :param etag: The ETag for optimistic concurrency control. :type etag: str, none_type + :param has_ever_been_published: Whether this version number has ever appeared in the form's publication history. + :type has_ever_been_published: bool, optional + :param id: The ID of the form version. :type id: str, optional @@ -108,6 +114,8 @@ def __init__( :param version: The sequential version number. :type version: int """ + if has_ever_been_published is not unset: + kwargs["has_ever_been_published"] = has_ever_been_published if id is not unset: kwargs["id"] = id super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/form_version_list_type.py b/src/datadog_api_client/v2/model/form_version_list_type.py new file mode 100644 index 0000000000..038a80b5cc --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_list_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FormVersionListType(ModelSimple): + """ + The resource type for a list of form versions. + + :param value: If omitted defaults to "form_version_lists". Must be one of ["form_version_lists"]. + :type value: str + """ + + allowed_values = { + "form_version_lists", + } + FORM_VERSION_LISTS: ClassVar["FormVersionListType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FormVersionListType.FORM_VERSION_LISTS = FormVersionListType("form_version_lists") diff --git a/src/datadog_api_client/v2/model/list_form_versions_data.py b/src/datadog_api_client/v2/model/list_form_versions_data.py new file mode 100644 index 0000000000..275d3c63aa --- /dev/null +++ b/src/datadog_api_client/v2/model/list_form_versions_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.list_form_versions_data_attributes import ListFormVersionsDataAttributes + from datadog_api_client.v2.model.form_version_list_type import FormVersionListType + + +class ListFormVersionsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.list_form_versions_data_attributes import ListFormVersionsDataAttributes + from datadog_api_client.v2.model.form_version_list_type import FormVersionListType + + return { + "attributes": (ListFormVersionsDataAttributes,), + "id": (str,), + "type": (FormVersionListType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: ListFormVersionsDataAttributes, id: str, type: FormVersionListType, **kwargs): + """ + A list-of-form-versions resource object. + + :param attributes: The attributes for a list of form versions. + :type attributes: ListFormVersionsDataAttributes + + :param id: The ID of the form. + :type id: str + + :param type: The resource type for a list of form versions. + :type type: FormVersionListType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/list_form_versions_data_attributes.py b/src/datadog_api_client/v2/model/list_form_versions_data_attributes.py new file mode 100644 index 0000000000..0e5df76ba1 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_form_versions_data_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_version_attributes import FormVersionAttributes + + +class ListFormVersionsDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_version_attributes import FormVersionAttributes + + return { + "versions": ([FormVersionAttributes],), + } + + attribute_map = { + "versions": "versions", + } + + def __init__(self_, versions: List[FormVersionAttributes], **kwargs): + """ + The attributes for a list of form versions. + + :param versions: The list of versions for the form. + :type versions: [FormVersionAttributes] + """ + super().__init__(kwargs) + + self_.versions = versions diff --git a/src/datadog_api_client/v2/model/list_form_versions_response.py b/src/datadog_api_client/v2/model/list_form_versions_response.py new file mode 100644 index 0000000000..fcba2e458e --- /dev/null +++ b/src/datadog_api_client/v2/model/list_form_versions_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.list_form_versions_data import ListFormVersionsData + + +class ListFormVersionsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.list_form_versions_data import ListFormVersionsData + + return { + "data": (ListFormVersionsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ListFormVersionsData, **kwargs): + """ + A response containing the list of versions for a form. + + :param data: A list-of-form-versions resource object. + :type data: ListFormVersionsData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 381475e69e..804dba11be 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2987,6 +2987,7 @@ from datadog_api_client.v2.model.form_update_attributes import FormUpdateAttributes from datadog_api_client.v2.model.form_version_attributes import FormVersionAttributes from datadog_api_client.v2.model.form_version_data import FormVersionData +from datadog_api_client.v2.model.form_version_list_type import FormVersionListType from datadog_api_client.v2.model.form_version_response import FormVersionResponse from datadog_api_client.v2.model.form_version_state import FormVersionState from datadog_api_client.v2.model.form_version_type import FormVersionType @@ -4506,6 +4507,9 @@ from datadog_api_client.v2.model.list_findings_meta import ListFindingsMeta from datadog_api_client.v2.model.list_findings_page import ListFindingsPage from datadog_api_client.v2.model.list_findings_response import ListFindingsResponse +from datadog_api_client.v2.model.list_form_versions_data import ListFormVersionsData +from datadog_api_client.v2.model.list_form_versions_data_attributes import ListFormVersionsDataAttributes +from datadog_api_client.v2.model.list_form_versions_response import ListFormVersionsResponse from datadog_api_client.v2.model.list_historical_jobs_response import ListHistoricalJobsResponse from datadog_api_client.v2.model.list_integrations_response import ListIntegrationsResponse from datadog_api_client.v2.model.list_interface_tags_response import ListInterfaceTagsResponse @@ -12232,6 +12236,7 @@ "FormUpdateAttributes", "FormVersionAttributes", "FormVersionData", + "FormVersionListType", "FormVersionResponse", "FormVersionState", "FormVersionType", @@ -13375,6 +13380,9 @@ "ListFindingsMeta", "ListFindingsPage", "ListFindingsResponse", + "ListFormVersionsData", + "ListFormVersionsDataAttributes", + "ListFormVersionsResponse", "ListHistoricalJobsResponse", "ListIntegrationsResponse", "ListInterfaceTagsResponse", diff --git a/tests/v2/features/forms.feature b/tests/v2/features/forms.feature index eb380d0f84..26c3af40da 100644 --- a/tests/v2/features/forms.feature +++ b/tests/v2/features/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/tests/v2/features/undo.json b/tests/v2/features/undo.json index 10ae8ac71d..0963371483 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2810,12 +2810,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": {