diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a8908359f4..f39a404ba7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -25383,6 +25383,592 @@ components: required: - data type: object + FormCreateRequest: + description: Request for creating a form. + properties: + data: + $ref: '#/components/schemas/FormDataRequest' + required: + - data + type: object + FormDataAttributesRequest: + description: Attributes for creating a form. + properties: + data_definition: + description: The data definition for the form. + example: {} + type: object + description: + description: The description of the form. + example: test description + type: string + name: + description: The name of the form. + example: test form happy path + type: string + ui_definition: + description: The UI definition for the form. + example: {} + type: object + required: + - name + - description + - data_definition + - ui_definition + type: object + FormDataAttributesResponse: + description: Attributes of a form. + properties: + created_at: + description: Creation timestamp. + example: '2026-01-13T17:14:57.877323Z' + format: date-time + type: string + datastore_config: + $ref: '#/components/schemas/FormDatastoreConfig' + description: + description: The description of the form. + example: test description + type: string + modified_at: + description: Last modification timestamp. + example: '2026-01-13T17:14:57.877323Z' + format: date-time + type: string + name: + description: The name of the form. + example: test form happy path + type: string + org_id: + description: The organization ID. + example: 2 + format: int64 + type: integer + publication: + $ref: '#/components/schemas/FormPublication' + user_id: + description: The ID of the user who created the form. + example: 1 + format: int64 + type: integer + user_uuid: + description: The UUID of the user who created the form. + example: 7a35d794-2294-44f7-97e4-689e593cedbe + format: uuid + type: string + version: + $ref: '#/components/schemas/FormVersion' + required: + - org_id + - name + - description + - datastore_config + - created_at + - modified_at + - user_id + - user_uuid + type: object + FormDataRequest: + properties: + attributes: + $ref: '#/components/schemas/FormDataAttributesRequest' + id: + description: The form identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: '#/components/schemas/FormType' + required: + - type + - attributes + type: object + FormDataResponse: + properties: + attributes: + $ref: '#/components/schemas/FormDataAttributesResponse' + id: + description: The form identifier. + example: 62172096-f84c-453f-a8ee-5d768fef1b19 + format: uuid + type: string + type: + $ref: '#/components/schemas/FormType' + required: + - id + - type + - attributes + type: object + FormDatastoreConfig: + description: Configuration for the form's associated datastore. + properties: + datastore_id: + description: The unique identifier of the datastore. + example: 6883d0d5-edf6-49b1-8848-47427d3fb84b + format: uuid + type: string + primary_column_name: + description: The name of the primary key column. + example: id + type: string + primary_key_generation_strategy: + description: The strategy used for generating primary keys. + example: uuid + type: string + required: + - datastore_id + - primary_column_name + - primary_key_generation_strategy + type: object + FormPublication: + description: Publication information for the form. + properties: + created_at: + description: Creation timestamp. + example: '2026-01-13T17:14:55.62611Z' + format: date-time + type: string + form_id: + description: The form identifier. + example: 10084e11-8789-4363-b0c8-4e8275a7e1cf + format: uuid + type: string + form_version: + description: The version of the form that was published. + example: 1 + format: int64 + type: integer + id: + description: The unique identifier of the publication. + example: '2' + type: string + modified_at: + description: Last modification timestamp. + example: '2026-01-13T17:14:55.62611Z' + format: date-time + type: string + org_id: + description: The organization ID. + example: 2 + format: int64 + type: integer + publish_seq: + description: The publication sequence number. + example: 1 + format: int64 + type: integer + user_id: + description: The ID of the user who published. + example: 10001 + format: int64 + type: integer + user_uuid: + description: The UUID of the user who published. + example: 78533ca4-048c-4f4a-b6dd-964669a84436 + format: uuid + type: string + required: + - id + - org_id + - form_id + - created_at + - modified_at + - user_id + - user_uuid + type: object + FormPublicationAttributes: + properties: + version: + description: The version number to publish. + example: 1 + format: int64 + type: integer + required: + - version + type: object + FormPublicationDataRequest: + properties: + attributes: + $ref: '#/components/schemas/FormPublicationAttributes' + type: + $ref: '#/components/schemas/FormPublicationType' + required: + - type + - attributes + type: object + FormPublicationDataResponse: + properties: + attributes: + $ref: '#/components/schemas/FormPublication' + id: + description: The publication identifier. + example: '21' + type: string + type: + $ref: '#/components/schemas/FormPublicationType' + required: + - id + - type + - attributes + type: object + FormPublicationRequest: + description: Request for publishing a form. + properties: + data: + $ref: '#/components/schemas/FormPublicationDataRequest' + required: + - data + type: object + FormPublicationResponse: + description: Response for a form publication. + properties: + data: + $ref: '#/components/schemas/FormPublicationDataResponse' + required: + - data + type: object + FormPublicationType: + description: Type for form publications. + enum: + - form_publications + example: form_publications + type: string + x-enum-varnames: + - FORM_PUBLICATIONS + FormResponse: + description: Response containing a single form. + properties: + data: + $ref: '#/components/schemas/FormDataResponse' + required: + - data + type: object + FormSubmissionAttributes: + properties: + submission_data: + description: The data submitted with the form. + example: {} + type: object + required: + - submission_data + type: object + FormSubmissionDataRequest: + properties: + attributes: + $ref: '#/components/schemas/FormSubmissionAttributes' + type: + $ref: '#/components/schemas/FormSubmissionType' + required: + - type + - attributes + type: object + FormSubmissionDataResponse: + properties: + id: + description: The submission identifier. + example: edb9a20e-34d4-48d7-9bbd-bb6beaf01729 + format: uuid + type: string + type: + $ref: '#/components/schemas/FormSubmissionType' + required: + - id + - type + type: object + FormSubmissionRequest: + description: Request for submitting a form. + properties: + data: + $ref: '#/components/schemas/FormSubmissionDataRequest' + required: + - data + type: object + FormSubmissionResponse: + description: Response for a form submission. + properties: + data: + $ref: '#/components/schemas/FormSubmissionDataResponse' + required: + - data + type: object + FormSubmissionType: + description: Type for form submissions. + enum: + - form_submissions + example: form_submissions + type: string + x-enum-varnames: + - FORM_SUBMISSIONS + FormType: + description: Type for forms. + enum: + - forms + example: forms + type: string + x-enum-varnames: + - FORMS + FormUpdateAttributes: + description: Attributes for updating a form. + properties: + form_update: + $ref: '#/components/schemas/FormUpdateAttributesFormUpdate' + type: object + FormUpdateAttributesFormUpdate: + description: Update parameters for the form. + properties: + description: + description: The updated description of the form. + example: Updated description + type: string + name: + description: The updated name of the form. + example: New Form Name + type: string + type: object + FormUpdateDataRequest: + properties: + attributes: + $ref: '#/components/schemas/FormUpdateAttributes' + id: + description: The form identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: '#/components/schemas/FormType' + required: + - type + - attributes + type: object + FormUpdateRequest: + description: Request for updating a form. + properties: + data: + $ref: '#/components/schemas/FormUpdateDataRequest' + required: + - data + type: object + FormVersion: + description: Version information for the form. + properties: + created_at: + description: Creation timestamp. + example: '2026-01-13T17:14:57.877323Z' + format: date-time + type: string + data_definition: + description: The data definition for the form. + example: {} + type: object + definition_signature: + description: Signature of the form definition. + example: '{"signature":"555f403cfc78022f3a8dfeee0d00bcda1aaa64a7e63bb605f01d4b39d3634214","version":1}' + type: string + etag: + description: The entity tag for the version. + example: b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d + type: string + id: + description: The unique identifier of the form version. + example: '6' + type: string + modified_at: + description: Last modification timestamp. + example: '2026-01-13T17:14:57.877323Z' + format: date-time + type: string + state: + $ref: '#/components/schemas/FormVersionState' + ui_definition: + description: The UI definition for the form. + example: {} + type: object + user_id: + description: The ID of the user who created the version. + example: 1 + format: int64 + type: integer + user_uuid: + description: The UUID of the user who created the version. + example: 7a35d794-2294-44f7-97e4-689e593cedbe + format: uuid + type: string + version: + description: The version number. + example: 1 + format: int64 + type: integer + required: + - id + - state + - data_definition + - ui_definition + - created_at + - modified_at + - user_id + - user_uuid + type: object + FormVersionAttributes: + properties: + data_definition: + description: The data definition for the form. + example: + updated: 'true' + type: object + state: + $ref: '#/components/schemas/FormVersionState' + ui_definition: + description: The UI definition for the form. + example: {} + type: object + upsert_params: + $ref: '#/components/schemas/FormVersionUpsertParams' + required: + - data_definition + - ui_definition + - upsert_params + type: object + FormVersionDataAttributesResponse: + description: Attributes of a form version. + properties: + created_at: + description: Creation timestamp. + example: '2026-01-13T17:14:58.915007Z' + format: date-time + type: string + data_definition: + description: The data definition for the form. + example: + updated: 'true' + type: object + definition_signature: + description: Signature of the form definition. + example: '{"signature":"c5f07b59cd4b5e431264d68a7e2e2d804c4eb515c006ab87e9bb7a04f1e711b6","version":1}' + type: string + etag: + description: The entity tag for the version. + example: d601c99730cb76542157e9e9eb3f1b41890f6af333d7d018baf56cfbbc1e2acc + type: string + modified_at: + description: Last modification timestamp. + example: '2026-01-13T17:14:58.923633Z' + format: date-time + type: string + state: + $ref: '#/components/schemas/FormVersionState' + ui_definition: + description: The UI definition for the form. + example: {} + type: object + user_id: + description: The ID of the user who created the version. + example: 1 + format: int64 + type: integer + user_uuid: + description: The UUID of the user who created the version. + example: 7a35d794-2294-44f7-97e4-689e593cedbe + format: uuid + type: string + version: + description: The version number. + example: 2 + format: int64 + type: integer + required: + - created_at + - data_definition + - definition_signature + - etag + - modified_at + - state + - ui_definition + - user_id + - user_uuid + - version + type: object + FormVersionDataRequest: + properties: + attributes: + $ref: '#/components/schemas/FormVersionAttributes' + type: + $ref: '#/components/schemas/FormVersionType' + required: + - type + - attributes + type: object + FormVersionDataResponse: + properties: + attributes: + $ref: '#/components/schemas/FormVersionDataAttributesResponse' + id: + description: The version identifier. + example: '46' + type: string + type: + $ref: '#/components/schemas/FormVersionType' + required: + - id + - type + - attributes + type: object + FormVersionRequest: + description: Request for creating or updating a form version. + properties: + data: + $ref: '#/components/schemas/FormVersionDataRequest' + required: + - data + type: object + FormVersionResponse: + description: Response for a form version. + properties: + data: + $ref: '#/components/schemas/FormVersionDataResponse' + required: + - data + type: object + FormVersionState: + description: The state of the form version. + enum: + - draft + - frozen + example: draft + type: string + x-enum-varnames: + - DRAFT + - FROZEN + FormVersionType: + description: Type for form versions. + enum: + - form_versions + example: form_versions + type: string + x-enum-varnames: + - FORM_VERSIONS + FormVersionUpsertParams: + description: Parameters for upserting a form version. + properties: + etag: + description: The entity tag for conflict detection. + example: b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d + type: string + match_policy: + description: The match policy for upserting. + example: none + type: string + type: object + FormsListResponse: + description: Response containing a list of forms. + properties: + data: + description: An array of forms. + items: + $ref: '#/components/schemas/FormDataResponse' + type: array + required: + - data + type: object FormulaLimit: description: 'Message for specifying limits to the number of values returned by a query. @@ -77367,6 +77953,462 @@ paths: operator: OR permissions: - events_read + /api/v2/forms: + get: + description: Get a list of all forms. + operationId: ListForms + parameters: + - description: Filter forms by name. + in: query + name: name + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FormsListResponse' + 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 + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List all forms + 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 a new form with the specified configuration. + operationId: CreateForm + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FormCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FormResponse' + 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 + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a new form + 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/create_and_publish: + post: + description: Create a new form and publish it immediately. + operationId: CreateAndPublishForm + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FormCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FormResponse' + 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 + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create and publish a form + 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}: + delete: + description: Delete a form by ID. + operationId: DeleteForm + parameters: + - description: The ID of the form. + in: path + name: form_id + required: true + schema: + format: uuid + type: string + responses: + '200': + 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 + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a form + 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/).' + get: + description: Get a form by ID. + operationId: GetForm + parameters: + - description: The ID of the form. + in: path + name: form_id + required: true + schema: + format: uuid + type: string + - description: The version number of the form. + in: query + name: version + required: false + schema: + type: integer + - description: Whether to get the published version. + in: query + name: published_version + required: false + schema: + type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FormResponse' + 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: Get a form + 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/).' + patch: + description: Update a form by ID. + operationId: UpdateForm + parameters: + - description: The ID of the form. + in: path + name: form_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FormUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FormResponse' + 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: Update a form + 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}/publish: + post: + description: Publish a specific version of a form. + operationId: PublishForm + parameters: + - description: The ID of the form. + in: path + name: form_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FormPublicationRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FormPublicationResponse' + 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: Publish a form + 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}/submit: + post: + description: Submit data to a form. + operationId: SubmitForm + parameters: + - description: The ID of the form. + in: path + name: form_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FormSubmissionRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FormSubmissionResponse' + 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: Submit a form + 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: + post: + description: Create or update a form version. + operationId: UpsertFormVersion + parameters: + - description: The ID of the form. + in: path + name: form_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FormVersionRequest' + required: true + responses: + '200': + content: + application/json: + 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 + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a form 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: Create or update a form version and publish it immediately. + operationId: UpsertAndPublishFormVersion + parameters: + - description: The ID of the form. + in: path + name: form_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FormVersionRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FormResponse' + 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 + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Upsert and publish a form 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/hamr: get: description: 'Retrieve the High Availability Multi-Region (HAMR) organization @@ -102521,6 +103563,8 @@ tags: - Upgrade the Datadog Agent to specific versions' name: Fleet Automation +- description: Create and manage forms for collecting data from users. + name: Forms - description: 'Configure your Datadog-Google Cloud Platform (GCP) integration directly through the Datadog API. Read more about the [Datadog-Google Cloud Platform integration](https://docs.datadoghq.com/integrations/google_cloud_platform).' diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 44f19cd202..34f73aa18a 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -270,6 +270,13 @@ datadog\_api\_client.v2.api.fleet\_automation\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.forms\_api module +--------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.forms_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.gcp\_integration\_api module -------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index fe0c2aa3ef..f45797c0d8 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -10518,6 +10518,251 @@ datadog\_api\_client.v2.model.fleet\_schedules\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.form\_create\_request module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_data\_attributes\_request module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_data_attributes_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_data\_attributes\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_data_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_data\_request module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_data\_response module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_datastore\_config module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.form_datastore_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_publication module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.form_publication + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_publication\_attributes module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.form_publication_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_publication\_data\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_publication_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_publication\_data\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_publication_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_publication\_request module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_publication_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_publication\_response module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_publication_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_publication\_type module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.form_publication_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_response module +--------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_submission\_attributes module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_submission_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_submission\_data\_request module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_submission_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_submission\_data\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_submission_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_submission\_request module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_submission_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_submission\_response module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_submission_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_submission\_type module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_submission_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_type module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_update\_attributes module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_update\_attributes\_form\_update module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_update_attributes_form_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_update\_data\_request module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_update_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_update\_request module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_version\_attributes module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_version_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_version\_data\_attributes\_response module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.form_version_data_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_version\_data\_request module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_version_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_version\_data\_response module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.form_version_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_version\_request module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_version_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_version\_response module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.form_version_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_version\_state module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_version_state + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_version\_type module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.form_version_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.form\_version\_upsert\_params module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.form_version_upsert_params + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.forms\_list\_response module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.forms_list_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.formula\_limit module --------------------------------------------------- diff --git a/examples/v2/forms/CreateAndPublishForm.py b/examples/v2/forms/CreateAndPublishForm.py new file mode 100644 index 0000000000..3d6d911a10 --- /dev/null +++ b/examples/v2/forms/CreateAndPublishForm.py @@ -0,0 +1,32 @@ +""" +Create and publish a form returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi +from datadog_api_client.v2.model.form_create_request import FormCreateRequest +from datadog_api_client.v2.model.form_data_attributes_request import FormDataAttributesRequest +from datadog_api_client.v2.model.form_data_request import FormDataRequest +from datadog_api_client.v2.model.form_type import FormType +from uuid import UUID + +body = FormCreateRequest( + data=FormDataRequest( + attributes=FormDataAttributesRequest( + data_definition=dict(), + description="test description", + name="test form happy path", + ui_definition=dict(), + ), + id=UUID("00000000-0000-0000-0000-000000000000"), + type=FormType.FORMS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_and_publish_form"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.create_and_publish_form(body=body) + + print(response) diff --git a/examples/v2/forms/CreateForm.py b/examples/v2/forms/CreateForm.py new file mode 100644 index 0000000000..543e70d1b2 --- /dev/null +++ b/examples/v2/forms/CreateForm.py @@ -0,0 +1,32 @@ +""" +Create a new form returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi +from datadog_api_client.v2.model.form_create_request import FormCreateRequest +from datadog_api_client.v2.model.form_data_attributes_request import FormDataAttributesRequest +from datadog_api_client.v2.model.form_data_request import FormDataRequest +from datadog_api_client.v2.model.form_type import FormType +from uuid import UUID + +body = FormCreateRequest( + data=FormDataRequest( + attributes=FormDataAttributesRequest( + data_definition=dict(), + description="test description", + name="test form happy path", + ui_definition=dict(), + ), + id=UUID("00000000-0000-0000-0000-000000000000"), + type=FormType.FORMS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_form"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.create_form(body=body) + + print(response) diff --git a/examples/v2/forms/DeleteForm.py b/examples/v2/forms/DeleteForm.py new file mode 100644 index 0000000000..8e500cad87 --- /dev/null +++ b/examples/v2/forms/DeleteForm.py @@ -0,0 +1,15 @@ +""" +Delete a form 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["delete_form"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + api_instance.delete_form( + form_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) diff --git a/examples/v2/forms/GetForm.py b/examples/v2/forms/GetForm.py new file mode 100644 index 0000000000..424121d86a --- /dev/null +++ b/examples/v2/forms/GetForm.py @@ -0,0 +1,17 @@ +""" +Get a form 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["get_form"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.get_form( + form_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + ) + + print(response) diff --git a/examples/v2/forms/ListForms.py b/examples/v2/forms/ListForms.py new file mode 100644 index 0000000000..008f81f96b --- /dev/null +++ b/examples/v2/forms/ListForms.py @@ -0,0 +1,14 @@ +""" +List all forms returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi + +configuration = Configuration() +configuration.unstable_operations["list_forms"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.list_forms() + + print(response) diff --git a/examples/v2/forms/PublishForm.py b/examples/v2/forms/PublishForm.py new file mode 100644 index 0000000000..57706ed1ca --- /dev/null +++ b/examples/v2/forms/PublishForm.py @@ -0,0 +1,28 @@ +""" +Publish a form returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi +from datadog_api_client.v2.model.form_publication_attributes import FormPublicationAttributes +from datadog_api_client.v2.model.form_publication_data_request import FormPublicationDataRequest +from datadog_api_client.v2.model.form_publication_request import FormPublicationRequest +from datadog_api_client.v2.model.form_publication_type import FormPublicationType +from uuid import UUID + +body = FormPublicationRequest( + data=FormPublicationDataRequest( + attributes=FormPublicationAttributes( + version=1, + ), + type=FormPublicationType.FORM_PUBLICATIONS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["publish_form"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.publish_form(form_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body=body) + + print(response) diff --git a/examples/v2/forms/SubmitForm.py b/examples/v2/forms/SubmitForm.py new file mode 100644 index 0000000000..3a5513f544 --- /dev/null +++ b/examples/v2/forms/SubmitForm.py @@ -0,0 +1,28 @@ +""" +Submit a form returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi +from datadog_api_client.v2.model.form_submission_attributes import FormSubmissionAttributes +from datadog_api_client.v2.model.form_submission_data_request import FormSubmissionDataRequest +from datadog_api_client.v2.model.form_submission_request import FormSubmissionRequest +from datadog_api_client.v2.model.form_submission_type import FormSubmissionType +from uuid import UUID + +body = FormSubmissionRequest( + data=FormSubmissionDataRequest( + attributes=FormSubmissionAttributes( + submission_data=dict(), + ), + type=FormSubmissionType.FORM_SUBMISSIONS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["submit_form"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.submit_form(form_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body=body) + + print(response) diff --git a/examples/v2/forms/UpdateForm.py b/examples/v2/forms/UpdateForm.py new file mode 100644 index 0000000000..62ccca038d --- /dev/null +++ b/examples/v2/forms/UpdateForm.py @@ -0,0 +1,33 @@ +""" +Update a form returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi +from datadog_api_client.v2.model.form_type import FormType +from datadog_api_client.v2.model.form_update_attributes import FormUpdateAttributes +from datadog_api_client.v2.model.form_update_attributes_form_update import FormUpdateAttributesFormUpdate +from datadog_api_client.v2.model.form_update_data_request import FormUpdateDataRequest +from datadog_api_client.v2.model.form_update_request import FormUpdateRequest +from uuid import UUID + +body = FormUpdateRequest( + data=FormUpdateDataRequest( + attributes=FormUpdateAttributes( + form_update=FormUpdateAttributesFormUpdate( + description="Updated description", + name="New Form Name", + ), + ), + id=UUID("00000000-0000-0000-0000-000000000000"), + type=FormType.FORMS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_form"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.update_form(form_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body=body) + + print(response) diff --git a/examples/v2/forms/UpsertAndPublishFormVersion.py b/examples/v2/forms/UpsertAndPublishFormVersion.py new file mode 100644 index 0000000000..7beaa4376d --- /dev/null +++ b/examples/v2/forms/UpsertAndPublishFormVersion.py @@ -0,0 +1,38 @@ +""" +Upsert and publish a form version returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi +from datadog_api_client.v2.model.form_version_attributes import FormVersionAttributes +from datadog_api_client.v2.model.form_version_data_request import FormVersionDataRequest +from datadog_api_client.v2.model.form_version_request import FormVersionRequest +from datadog_api_client.v2.model.form_version_state import FormVersionState +from datadog_api_client.v2.model.form_version_type import FormVersionType +from datadog_api_client.v2.model.form_version_upsert_params import FormVersionUpsertParams +from uuid import UUID + +body = FormVersionRequest( + data=FormVersionDataRequest( + attributes=FormVersionAttributes( + data_definition=dict([("updated", "true")]), + state=FormVersionState.DRAFT, + ui_definition=dict(), + upsert_params=FormVersionUpsertParams( + etag="b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", + match_policy="none", + ), + ), + type=FormVersionType.FORM_VERSIONS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["upsert_and_publish_form_version"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.upsert_and_publish_form_version( + form_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body=body + ) + + print(response) diff --git a/examples/v2/forms/UpsertFormVersion.py b/examples/v2/forms/UpsertFormVersion.py new file mode 100644 index 0000000000..af46db0559 --- /dev/null +++ b/examples/v2/forms/UpsertFormVersion.py @@ -0,0 +1,36 @@ +""" +Create a form version returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.forms_api import FormsApi +from datadog_api_client.v2.model.form_version_attributes import FormVersionAttributes +from datadog_api_client.v2.model.form_version_data_request import FormVersionDataRequest +from datadog_api_client.v2.model.form_version_request import FormVersionRequest +from datadog_api_client.v2.model.form_version_state import FormVersionState +from datadog_api_client.v2.model.form_version_type import FormVersionType +from datadog_api_client.v2.model.form_version_upsert_params import FormVersionUpsertParams +from uuid import UUID + +body = FormVersionRequest( + data=FormVersionDataRequest( + attributes=FormVersionAttributes( + data_definition=dict([("updated", "true")]), + state=FormVersionState.DRAFT, + ui_definition=dict(), + upsert_params=FormVersionUpsertParams( + etag="b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", + match_policy="none", + ), + ), + type=FormVersionType.FORM_VERSIONS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["upsert_form_version"] = True +with ApiClient(configuration) as api_client: + api_instance = FormsApi(api_client) + response = api_instance.upsert_form_version(form_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index f4ec0cd2a5..29ade73b7e 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -305,6 +305,16 @@ def __init__( "v2.get_deployment_rule": False, "v2.update_deployment_gate": False, "v2.update_deployment_rule": False, + "v2.create_and_publish_form": False, + "v2.create_form": False, + "v2.delete_form": False, + "v2.get_form": False, + "v2.list_forms": False, + "v2.publish_form": False, + "v2.submit_form": False, + "v2.update_form": False, + "v2.upsert_and_publish_form_version": False, + "v2.upsert_form_version": False, "v2.create_hamr_org_connection": False, "v2.get_hamr_org_connection": False, "v2.create_global_incident_handle": False, diff --git a/src/datadog_api_client/v2/api/forms_api.py b/src/datadog_api_client/v2/api/forms_api.py new file mode 100644 index 0000000000..34ce083d4d --- /dev/null +++ b/src/datadog_api_client/v2/api/forms_api.py @@ -0,0 +1,486 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, + UUID, +) +from datadog_api_client.v2.model.forms_list_response import FormsListResponse +from datadog_api_client.v2.model.form_response import FormResponse +from datadog_api_client.v2.model.form_create_request import FormCreateRequest +from datadog_api_client.v2.model.form_update_request import FormUpdateRequest +from datadog_api_client.v2.model.form_publication_response import FormPublicationResponse +from datadog_api_client.v2.model.form_publication_request import FormPublicationRequest +from datadog_api_client.v2.model.form_submission_response import FormSubmissionResponse +from datadog_api_client.v2.model.form_submission_request import FormSubmissionRequest +from datadog_api_client.v2.model.form_version_response import FormVersionResponse +from datadog_api_client.v2.model.form_version_request import FormVersionRequest + + +class FormsApi: + """ + Create and manage forms for collecting data from users. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_and_publish_form_endpoint = _Endpoint( + settings={ + "response_type": (FormResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/create_and_publish", + "operation_id": "create_and_publish_form", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (FormCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_form_endpoint = _Endpoint( + settings={ + "response_type": (FormResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms", + "operation_id": "create_form", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (FormCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_form_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/{form_id}", + "operation_id": "delete_form", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "form_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "form_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_form_endpoint = _Endpoint( + settings={ + "response_type": (FormResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/{form_id}", + "operation_id": "get_form", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "form_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "form_id", + "location": "path", + }, + "version": { + "openapi_types": (int,), + "attribute": "version", + "location": "query", + }, + "published_version": { + "openapi_types": (bool,), + "attribute": "published_version", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_forms_endpoint = _Endpoint( + settings={ + "response_type": (FormsListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms", + "operation_id": "list_forms", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "name": { + "openapi_types": (str,), + "attribute": "name", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._publish_form_endpoint = _Endpoint( + settings={ + "response_type": (FormPublicationResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/{form_id}/publish", + "operation_id": "publish_form", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "form_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "form_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (FormPublicationRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._submit_form_endpoint = _Endpoint( + settings={ + "response_type": (FormSubmissionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/{form_id}/submit", + "operation_id": "submit_form", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "form_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "form_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (FormSubmissionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_form_endpoint = _Endpoint( + settings={ + "response_type": (FormResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/{form_id}", + "operation_id": "update_form", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "form_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "form_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (FormUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._upsert_and_publish_form_version_endpoint = _Endpoint( + settings={ + "response_type": (FormResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/{form_id}/versions/upsert_and_publish", + "operation_id": "upsert_and_publish_form_version", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "form_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "form_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (FormVersionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._upsert_form_version_endpoint = _Endpoint( + settings={ + "response_type": (FormVersionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/forms/{form_id}/versions", + "operation_id": "upsert_form_version", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "form_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "form_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (FormVersionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_and_publish_form( + self, + body: FormCreateRequest, + ) -> FormResponse: + """Create and publish a form. + + Create a new form and publish it immediately. + + :type body: FormCreateRequest + :rtype: FormResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_and_publish_form_endpoint.call_with_http_info(**kwargs) + + def create_form( + self, + body: FormCreateRequest, + ) -> FormResponse: + """Create a new form. + + Create a new form with the specified configuration. + + :type body: FormCreateRequest + :rtype: FormResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_form_endpoint.call_with_http_info(**kwargs) + + def delete_form( + self, + form_id: UUID, + ) -> None: + """Delete a form. + + Delete a form by ID. + + :param form_id: The ID of the form. + :type form_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["form_id"] = form_id + + return self._delete_form_endpoint.call_with_http_info(**kwargs) + + def get_form( + self, + form_id: UUID, + *, + version: Union[int, UnsetType] = unset, + published_version: Union[bool, UnsetType] = unset, + ) -> FormResponse: + """Get a form. + + Get a form by ID. + + :param form_id: The ID of the form. + :type form_id: UUID + :param version: The version number of the form. + :type version: int, optional + :param published_version: Whether to get the published version. + :type published_version: bool, optional + :rtype: FormResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["form_id"] = form_id + + if version is not unset: + kwargs["version"] = version + + if published_version is not unset: + kwargs["published_version"] = published_version + + return self._get_form_endpoint.call_with_http_info(**kwargs) + + def list_forms( + self, + *, + name: Union[str, UnsetType] = unset, + ) -> FormsListResponse: + """List all forms. + + Get a list of all forms. + + :param name: Filter forms by name. + :type name: str, optional + :rtype: FormsListResponse + """ + kwargs: Dict[str, Any] = {} + if name is not unset: + kwargs["name"] = name + + return self._list_forms_endpoint.call_with_http_info(**kwargs) + + def publish_form( + self, + form_id: UUID, + body: FormPublicationRequest, + ) -> FormPublicationResponse: + """Publish a form. + + Publish a specific version of a form. + + :param form_id: The ID of the form. + :type form_id: UUID + :type body: FormPublicationRequest + :rtype: FormPublicationResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["form_id"] = form_id + + kwargs["body"] = body + + return self._publish_form_endpoint.call_with_http_info(**kwargs) + + def submit_form( + self, + form_id: UUID, + body: FormSubmissionRequest, + ) -> FormSubmissionResponse: + """Submit a form. + + Submit data to a form. + + :param form_id: The ID of the form. + :type form_id: UUID + :type body: FormSubmissionRequest + :rtype: FormSubmissionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["form_id"] = form_id + + kwargs["body"] = body + + return self._submit_form_endpoint.call_with_http_info(**kwargs) + + def update_form( + self, + form_id: UUID, + body: FormUpdateRequest, + ) -> FormResponse: + """Update a form. + + Update a form by ID. + + :param form_id: The ID of the form. + :type form_id: UUID + :type body: FormUpdateRequest + :rtype: FormResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["form_id"] = form_id + + kwargs["body"] = body + + return self._update_form_endpoint.call_with_http_info(**kwargs) + + def upsert_and_publish_form_version( + self, + form_id: UUID, + body: FormVersionRequest, + ) -> FormResponse: + """Upsert and publish a form version. + + Create or update a form version and publish it immediately. + + :param form_id: The ID of the form. + :type form_id: UUID + :type body: FormVersionRequest + :rtype: FormResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["form_id"] = form_id + + kwargs["body"] = body + + return self._upsert_and_publish_form_version_endpoint.call_with_http_info(**kwargs) + + def upsert_form_version( + self, + form_id: UUID, + body: FormVersionRequest, + ) -> FormVersionResponse: + """Create a form version. + + Create or update a form version. + + :param form_id: The ID of the form. + :type form_id: UUID + :type body: FormVersionRequest + :rtype: FormVersionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["form_id"] = form_id + + kwargs["body"] = body + + return self._upsert_form_version_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 210ab0dd47..fa41da72e6 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -36,6 +36,7 @@ from datadog_api_client.v2.api.events_api import EventsApi from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi +from datadog_api_client.v2.api.forms_api import FormsApi from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi from datadog_api_client.v2.api.high_availability_multi_region_api import HighAvailabilityMultiRegionApi from datadog_api_client.v2.api.ip_allowlist_api import IPAllowlistApi @@ -135,6 +136,7 @@ "EventsApi", "FastlyIntegrationApi", "FleetAutomationApi", + "FormsApi", "GCPIntegrationApi", "HighAvailabilityMultiRegionApi", "IPAllowlistApi", diff --git a/src/datadog_api_client/v2/model/form_create_request.py b/src/datadog_api_client/v2/model/form_create_request.py new file mode 100644 index 0000000000..c7e0c18697 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_create_request.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.form_data_request import FormDataRequest + + +class FormCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_data_request import FormDataRequest + + return { + "data": (FormDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FormDataRequest, **kwargs): + """ + Request for creating a form. + + :param data: + :type data: FormDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/form_data_attributes_request.py b/src/datadog_api_client/v2/model/form_data_attributes_request.py new file mode 100644 index 0000000000..db9131a3a0 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_data_attributes_request.py @@ -0,0 +1,51 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class FormDataAttributesRequest(ModelNormal): + @cached_property + def openapi_types(_): + return { + "data_definition": (dict,), + "description": (str,), + "name": (str,), + "ui_definition": (dict,), + } + + attribute_map = { + "data_definition": "data_definition", + "description": "description", + "name": "name", + "ui_definition": "ui_definition", + } + + def __init__(self_, data_definition: dict, description: str, name: str, ui_definition: dict, **kwargs): + """ + Attributes for creating a form. + + :param data_definition: The data definition for the form. + :type data_definition: dict + + :param description: The description of the form. + :type description: str + + :param name: The name of the form. + :type name: str + + :param ui_definition: The UI definition for the form. + :type ui_definition: dict + """ + super().__init__(kwargs) + + self_.data_definition = data_definition + self_.description = description + self_.name = name + self_.ui_definition = ui_definition diff --git a/src/datadog_api_client/v2/model/form_data_attributes_response.py b/src/datadog_api_client/v2/model/form_data_attributes_response.py new file mode 100644 index 0000000000..1621d9c4fe --- /dev/null +++ b/src/datadog_api_client/v2/model/form_data_attributes_response.py @@ -0,0 +1,117 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_datastore_config import FormDatastoreConfig + from datadog_api_client.v2.model.form_publication import FormPublication + from datadog_api_client.v2.model.form_version import FormVersion + + +class FormDataAttributesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_datastore_config import FormDatastoreConfig + from datadog_api_client.v2.model.form_publication import FormPublication + from datadog_api_client.v2.model.form_version import FormVersion + + return { + "created_at": (datetime,), + "datastore_config": (FormDatastoreConfig,), + "description": (str,), + "modified_at": (datetime,), + "name": (str,), + "org_id": (int,), + "publication": (FormPublication,), + "user_id": (int,), + "user_uuid": (UUID,), + "version": (FormVersion,), + } + + attribute_map = { + "created_at": "created_at", + "datastore_config": "datastore_config", + "description": "description", + "modified_at": "modified_at", + "name": "name", + "org_id": "org_id", + "publication": "publication", + "user_id": "user_id", + "user_uuid": "user_uuid", + "version": "version", + } + + def __init__( + self_, + created_at: datetime, + datastore_config: FormDatastoreConfig, + description: str, + modified_at: datetime, + name: str, + org_id: int, + user_id: int, + user_uuid: UUID, + publication: Union[FormPublication, UnsetType] = unset, + version: Union[FormVersion, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a form. + + :param created_at: Creation timestamp. + :type created_at: datetime + + :param datastore_config: Configuration for the form's associated datastore. + :type datastore_config: FormDatastoreConfig + + :param description: The description of the form. + :type description: str + + :param modified_at: Last modification timestamp. + :type modified_at: datetime + + :param name: The name of the form. + :type name: str + + :param org_id: The organization ID. + :type org_id: int + + :param publication: Publication information for the form. + :type publication: FormPublication, optional + + :param user_id: The ID of the user who created the form. + :type user_id: int + + :param user_uuid: The UUID of the user who created the form. + :type user_uuid: UUID + + :param version: Version information for the form. + :type version: FormVersion, optional + """ + if publication is not unset: + kwargs["publication"] = publication + if version is not unset: + kwargs["version"] = version + super().__init__(kwargs) + + self_.created_at = created_at + self_.datastore_config = datastore_config + self_.description = description + self_.modified_at = modified_at + self_.name = name + self_.org_id = org_id + self_.user_id = user_id + self_.user_uuid = user_uuid diff --git a/src/datadog_api_client/v2/model/form_data_request.py b/src/datadog_api_client/v2/model/form_data_request.py new file mode 100644 index 0000000000..80752727d4 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_data_request.py @@ -0,0 +1,60 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_data_attributes_request import FormDataAttributesRequest + from datadog_api_client.v2.model.form_type import FormType + + +class FormDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_data_attributes_request import FormDataAttributesRequest + from datadog_api_client.v2.model.form_type import FormType + + return { + "attributes": (FormDataAttributesRequest,), + "id": (UUID,), + "type": (FormType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: FormDataAttributesRequest, type: FormType, id: Union[UUID, UnsetType] = unset, **kwargs + ): + """ + + + :param attributes: Attributes for creating a form. + :type attributes: FormDataAttributesRequest + + :param id: The form identifier. + :type id: UUID, optional + + :param type: Type for forms. + :type type: FormType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/form_data_response.py b/src/datadog_api_client/v2/model/form_data_response.py new file mode 100644 index 0000000000..f5b6d1b69c --- /dev/null +++ b/src/datadog_api_client/v2/model/form_data_response.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_data_attributes_response import FormDataAttributesResponse + from datadog_api_client.v2.model.form_type import FormType + + +class FormDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_data_attributes_response import FormDataAttributesResponse + from datadog_api_client.v2.model.form_type import FormType + + return { + "attributes": (FormDataAttributesResponse,), + "id": (UUID,), + "type": (FormType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: FormDataAttributesResponse, id: UUID, type: FormType, **kwargs): + """ + + + :param attributes: Attributes of a form. + :type attributes: FormDataAttributesResponse + + :param id: The form identifier. + :type id: UUID + + :param type: Type for forms. + :type type: FormType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/form_datastore_config.py b/src/datadog_api_client/v2/model/form_datastore_config.py new file mode 100644 index 0000000000..2f857cd45e --- /dev/null +++ b/src/datadog_api_client/v2/model/form_datastore_config.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +class FormDatastoreConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "datastore_id": (UUID,), + "primary_column_name": (str,), + "primary_key_generation_strategy": (str,), + } + + attribute_map = { + "datastore_id": "datastore_id", + "primary_column_name": "primary_column_name", + "primary_key_generation_strategy": "primary_key_generation_strategy", + } + + def __init__(self_, datastore_id: UUID, primary_column_name: str, primary_key_generation_strategy: str, **kwargs): + """ + Configuration for the form's associated datastore. + + :param datastore_id: The unique identifier of the datastore. + :type datastore_id: UUID + + :param primary_column_name: The name of the primary key column. + :type primary_column_name: str + + :param primary_key_generation_strategy: The strategy used for generating primary keys. + :type primary_key_generation_strategy: str + """ + super().__init__(kwargs) + + self_.datastore_id = datastore_id + self_.primary_column_name = primary_column_name + self_.primary_key_generation_strategy = primary_key_generation_strategy diff --git a/src/datadog_api_client/v2/model/form_publication.py b/src/datadog_api_client/v2/model/form_publication.py new file mode 100644 index 0000000000..61664ec1fd --- /dev/null +++ b/src/datadog_api_client/v2/model/form_publication.py @@ -0,0 +1,100 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, + UUID, +) + + +class FormPublication(ModelNormal): + @cached_property + def openapi_types(_): + return { + "created_at": (datetime,), + "form_id": (UUID,), + "form_version": (int,), + "id": (str,), + "modified_at": (datetime,), + "org_id": (int,), + "publish_seq": (int,), + "user_id": (int,), + "user_uuid": (UUID,), + } + + attribute_map = { + "created_at": "created_at", + "form_id": "form_id", + "form_version": "form_version", + "id": "id", + "modified_at": "modified_at", + "org_id": "org_id", + "publish_seq": "publish_seq", + "user_id": "user_id", + "user_uuid": "user_uuid", + } + + def __init__( + self_, + created_at: datetime, + form_id: UUID, + id: str, + modified_at: datetime, + org_id: int, + user_id: int, + user_uuid: UUID, + form_version: Union[int, UnsetType] = unset, + publish_seq: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Publication information for the form. + + :param created_at: Creation timestamp. + :type created_at: datetime + + :param form_id: The form identifier. + :type form_id: UUID + + :param form_version: The version of the form that was published. + :type form_version: int, optional + + :param id: The unique identifier of the publication. + :type id: str + + :param modified_at: Last modification timestamp. + :type modified_at: datetime + + :param org_id: The organization ID. + :type org_id: int + + :param publish_seq: The publication sequence number. + :type publish_seq: int, optional + + :param user_id: The ID of the user who published. + :type user_id: int + + :param user_uuid: The UUID of the user who published. + :type user_uuid: UUID + """ + if form_version is not unset: + kwargs["form_version"] = form_version + if publish_seq is not unset: + kwargs["publish_seq"] = publish_seq + super().__init__(kwargs) + + self_.created_at = created_at + self_.form_id = form_id + self_.id = id + self_.modified_at = modified_at + self_.org_id = org_id + self_.user_id = user_id + self_.user_uuid = user_uuid diff --git a/src/datadog_api_client/v2/model/form_publication_attributes.py b/src/datadog_api_client/v2/model/form_publication_attributes.py new file mode 100644 index 0000000000..1e2ccfaebc --- /dev/null +++ b/src/datadog_api_client/v2/model/form_publication_attributes.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class FormPublicationAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "version": (int,), + } + + attribute_map = { + "version": "version", + } + + def __init__(self_, version: int, **kwargs): + """ + + + :param version: The version number to publish. + :type version: int + """ + super().__init__(kwargs) + + self_.version = version diff --git a/src/datadog_api_client/v2/model/form_publication_data_request.py b/src/datadog_api_client/v2/model/form_publication_data_request.py new file mode 100644 index 0000000000..2705d03dea --- /dev/null +++ b/src/datadog_api_client/v2/model/form_publication_data_request.py @@ -0,0 +1,48 @@ +# 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.form_publication_attributes import FormPublicationAttributes + from datadog_api_client.v2.model.form_publication_type import FormPublicationType + + +class FormPublicationDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_publication_attributes import FormPublicationAttributes + from datadog_api_client.v2.model.form_publication_type import FormPublicationType + + return { + "attributes": (FormPublicationAttributes,), + "type": (FormPublicationType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: FormPublicationAttributes, type: FormPublicationType, **kwargs): + """ + + + :param attributes: + :type attributes: FormPublicationAttributes + + :param type: Type for form publications. + :type type: FormPublicationType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/form_publication_data_response.py b/src/datadog_api_client/v2/model/form_publication_data_response.py new file mode 100644 index 0000000000..14c80e852c --- /dev/null +++ b/src/datadog_api_client/v2/model/form_publication_data_response.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.form_publication import FormPublication + from datadog_api_client.v2.model.form_publication_type import FormPublicationType + + +class FormPublicationDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_publication import FormPublication + from datadog_api_client.v2.model.form_publication_type import FormPublicationType + + return { + "attributes": (FormPublication,), + "id": (str,), + "type": (FormPublicationType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: FormPublication, id: str, type: FormPublicationType, **kwargs): + """ + + + :param attributes: Publication information for the form. + :type attributes: FormPublication + + :param id: The publication identifier. + :type id: str + + :param type: Type for form publications. + :type type: FormPublicationType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/form_publication_request.py b/src/datadog_api_client/v2/model/form_publication_request.py new file mode 100644 index 0000000000..dfd83976d4 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_publication_request.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.form_publication_data_request import FormPublicationDataRequest + + +class FormPublicationRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_publication_data_request import FormPublicationDataRequest + + return { + "data": (FormPublicationDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FormPublicationDataRequest, **kwargs): + """ + Request for publishing a form. + + :param data: + :type data: FormPublicationDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/form_publication_response.py b/src/datadog_api_client/v2/model/form_publication_response.py new file mode 100644 index 0000000000..7236581e5d --- /dev/null +++ b/src/datadog_api_client/v2/model/form_publication_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.form_publication_data_response import FormPublicationDataResponse + + +class FormPublicationResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_publication_data_response import FormPublicationDataResponse + + return { + "data": (FormPublicationDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FormPublicationDataResponse, **kwargs): + """ + Response for a form publication. + + :param data: + :type data: FormPublicationDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/form_publication_type.py b/src/datadog_api_client/v2/model/form_publication_type.py new file mode 100644 index 0000000000..ea01ffff2a --- /dev/null +++ b/src/datadog_api_client/v2/model/form_publication_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 FormPublicationType(ModelSimple): + """ + Type for form publications. + + :param value: If omitted defaults to "form_publications". Must be one of ["form_publications"]. + :type value: str + """ + + allowed_values = { + "form_publications", + } + FORM_PUBLICATIONS: ClassVar["FormPublicationType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FormPublicationType.FORM_PUBLICATIONS = FormPublicationType("form_publications") diff --git a/src/datadog_api_client/v2/model/form_response.py b/src/datadog_api_client/v2/model/form_response.py new file mode 100644 index 0000000000..7ad4254685 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_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.form_data_response import FormDataResponse + + +class FormResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_data_response import FormDataResponse + + return { + "data": (FormDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FormDataResponse, **kwargs): + """ + Response containing a single form. + + :param data: + :type data: FormDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/form_submission_attributes.py b/src/datadog_api_client/v2/model/form_submission_attributes.py new file mode 100644 index 0000000000..0c50479e17 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_submission_attributes.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class FormSubmissionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "submission_data": (dict,), + } + + attribute_map = { + "submission_data": "submission_data", + } + + def __init__(self_, submission_data: dict, **kwargs): + """ + + + :param submission_data: The data submitted with the form. + :type submission_data: dict + """ + super().__init__(kwargs) + + self_.submission_data = submission_data diff --git a/src/datadog_api_client/v2/model/form_submission_data_request.py b/src/datadog_api_client/v2/model/form_submission_data_request.py new file mode 100644 index 0000000000..4dd37c77e7 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_submission_data_request.py @@ -0,0 +1,48 @@ +# 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.form_submission_attributes import FormSubmissionAttributes + from datadog_api_client.v2.model.form_submission_type import FormSubmissionType + + +class FormSubmissionDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_submission_attributes import FormSubmissionAttributes + from datadog_api_client.v2.model.form_submission_type import FormSubmissionType + + return { + "attributes": (FormSubmissionAttributes,), + "type": (FormSubmissionType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: FormSubmissionAttributes, type: FormSubmissionType, **kwargs): + """ + + + :param attributes: + :type attributes: FormSubmissionAttributes + + :param type: Type for form submissions. + :type type: FormSubmissionType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/form_submission_data_response.py b/src/datadog_api_client/v2/model/form_submission_data_response.py new file mode 100644 index 0000000000..ad46292105 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_submission_data_response.py @@ -0,0 +1,47 @@ +# 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, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_submission_type import FormSubmissionType + + +class FormSubmissionDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_submission_type import FormSubmissionType + + return { + "id": (UUID,), + "type": (FormSubmissionType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: UUID, type: FormSubmissionType, **kwargs): + """ + + + :param id: The submission identifier. + :type id: UUID + + :param type: Type for form submissions. + :type type: FormSubmissionType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/form_submission_request.py b/src/datadog_api_client/v2/model/form_submission_request.py new file mode 100644 index 0000000000..2c3f5757c4 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_submission_request.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.form_submission_data_request import FormSubmissionDataRequest + + +class FormSubmissionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_submission_data_request import FormSubmissionDataRequest + + return { + "data": (FormSubmissionDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FormSubmissionDataRequest, **kwargs): + """ + Request for submitting a form. + + :param data: + :type data: FormSubmissionDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/form_submission_response.py b/src/datadog_api_client/v2/model/form_submission_response.py new file mode 100644 index 0000000000..5f46ad976e --- /dev/null +++ b/src/datadog_api_client/v2/model/form_submission_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.form_submission_data_response import FormSubmissionDataResponse + + +class FormSubmissionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_submission_data_response import FormSubmissionDataResponse + + return { + "data": (FormSubmissionDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FormSubmissionDataResponse, **kwargs): + """ + Response for a form submission. + + :param data: + :type data: FormSubmissionDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/form_submission_type.py b/src/datadog_api_client/v2/model/form_submission_type.py new file mode 100644 index 0000000000..cff4b17298 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_submission_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 FormSubmissionType(ModelSimple): + """ + Type for form submissions. + + :param value: If omitted defaults to "form_submissions". Must be one of ["form_submissions"]. + :type value: str + """ + + allowed_values = { + "form_submissions", + } + FORM_SUBMISSIONS: ClassVar["FormSubmissionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FormSubmissionType.FORM_SUBMISSIONS = FormSubmissionType("form_submissions") diff --git a/src/datadog_api_client/v2/model/form_type.py b/src/datadog_api_client/v2/model/form_type.py new file mode 100644 index 0000000000..ee1ab41608 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_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 FormType(ModelSimple): + """ + Type for forms. + + :param value: If omitted defaults to "forms". Must be one of ["forms"]. + :type value: str + """ + + allowed_values = { + "forms", + } + FORMS: ClassVar["FormType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FormType.FORMS = FormType("forms") diff --git a/src/datadog_api_client/v2/model/form_update_attributes.py b/src/datadog_api_client/v2/model/form_update_attributes.py new file mode 100644 index 0000000000..dc3fe7d1c0 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_update_attributes.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_update_attributes_form_update import FormUpdateAttributesFormUpdate + + +class FormUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_update_attributes_form_update import FormUpdateAttributesFormUpdate + + return { + "form_update": (FormUpdateAttributesFormUpdate,), + } + + attribute_map = { + "form_update": "form_update", + } + + def __init__(self_, form_update: Union[FormUpdateAttributesFormUpdate, UnsetType] = unset, **kwargs): + """ + Attributes for updating a form. + + :param form_update: Update parameters for the form. + :type form_update: FormUpdateAttributesFormUpdate, optional + """ + if form_update is not unset: + kwargs["form_update"] = form_update + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/form_update_attributes_form_update.py b/src/datadog_api_client/v2/model/form_update_attributes_form_update.py new file mode 100644 index 0000000000..d007cbc58a --- /dev/null +++ b/src/datadog_api_client/v2/model/form_update_attributes_form_update.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class FormUpdateAttributesFormUpdate(ModelNormal): + @cached_property + def openapi_types(_): + return { + "description": (str,), + "name": (str,), + } + + attribute_map = { + "description": "description", + "name": "name", + } + + def __init__(self_, description: Union[str, UnsetType] = unset, name: Union[str, UnsetType] = unset, **kwargs): + """ + Update parameters for the form. + + :param description: The updated description of the form. + :type description: str, optional + + :param name: The updated name of the form. + :type name: str, optional + """ + if description is not unset: + kwargs["description"] = description + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/form_update_data_request.py b/src/datadog_api_client/v2/model/form_update_data_request.py new file mode 100644 index 0000000000..086f18d8bc --- /dev/null +++ b/src/datadog_api_client/v2/model/form_update_data_request.py @@ -0,0 +1,58 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_update_attributes import FormUpdateAttributes + from datadog_api_client.v2.model.form_type import FormType + + +class FormUpdateDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_update_attributes import FormUpdateAttributes + from datadog_api_client.v2.model.form_type import FormType + + return { + "attributes": (FormUpdateAttributes,), + "id": (UUID,), + "type": (FormType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: FormUpdateAttributes, type: FormType, id: Union[UUID, UnsetType] = unset, **kwargs): + """ + + + :param attributes: Attributes for updating a form. + :type attributes: FormUpdateAttributes + + :param id: The form identifier. + :type id: UUID, optional + + :param type: Type for forms. + :type type: FormType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/form_update_request.py b/src/datadog_api_client/v2/model/form_update_request.py new file mode 100644 index 0000000000..efa29e7b3b --- /dev/null +++ b/src/datadog_api_client/v2/model/form_update_request.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.form_update_data_request import FormUpdateDataRequest + + +class FormUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_update_data_request import FormUpdateDataRequest + + return { + "data": (FormUpdateDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FormUpdateDataRequest, **kwargs): + """ + Request for updating a form. + + :param data: + :type data: FormUpdateDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/form_version.py b/src/datadog_api_client/v2/model/form_version.py new file mode 100644 index 0000000000..62d5074fc7 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version.py @@ -0,0 +1,121 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_version_state import FormVersionState + + +class FormVersion(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_version_state import FormVersionState + + return { + "created_at": (datetime,), + "data_definition": (dict,), + "definition_signature": (str,), + "etag": (str,), + "id": (str,), + "modified_at": (datetime,), + "state": (FormVersionState,), + "ui_definition": (dict,), + "user_id": (int,), + "user_uuid": (UUID,), + "version": (int,), + } + + attribute_map = { + "created_at": "created_at", + "data_definition": "data_definition", + "definition_signature": "definition_signature", + "etag": "etag", + "id": "id", + "modified_at": "modified_at", + "state": "state", + "ui_definition": "ui_definition", + "user_id": "user_id", + "user_uuid": "user_uuid", + "version": "version", + } + + def __init__( + self_, + created_at: datetime, + data_definition: dict, + id: str, + modified_at: datetime, + state: FormVersionState, + ui_definition: dict, + user_id: int, + user_uuid: UUID, + definition_signature: Union[str, UnsetType] = unset, + etag: Union[str, UnsetType] = unset, + version: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Version information for the form. + + :param created_at: Creation timestamp. + :type created_at: datetime + + :param data_definition: The data definition for the form. + :type data_definition: dict + + :param definition_signature: Signature of the form definition. + :type definition_signature: str, optional + + :param etag: The entity tag for the version. + :type etag: str, optional + + :param id: The unique identifier of the form version. + :type id: str + + :param modified_at: Last modification timestamp. + :type modified_at: datetime + + :param state: The state of the form version. + :type state: FormVersionState + + :param ui_definition: The UI definition for the form. + :type ui_definition: dict + + :param user_id: The ID of the user who created the version. + :type user_id: int + + :param user_uuid: The UUID of the user who created the version. + :type user_uuid: UUID + + :param version: The version number. + :type version: int, optional + """ + if definition_signature is not unset: + kwargs["definition_signature"] = definition_signature + if etag is not unset: + kwargs["etag"] = etag + if version is not unset: + kwargs["version"] = version + super().__init__(kwargs) + + self_.created_at = created_at + self_.data_definition = data_definition + self_.id = id + self_.modified_at = modified_at + self_.state = state + self_.ui_definition = ui_definition + self_.user_id = user_id + self_.user_uuid = user_uuid diff --git a/src/datadog_api_client/v2/model/form_version_attributes.py b/src/datadog_api_client/v2/model/form_version_attributes.py new file mode 100644 index 0000000000..7b2bd84f68 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_attributes.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_version_state import FormVersionState + from datadog_api_client.v2.model.form_version_upsert_params import FormVersionUpsertParams + + +class FormVersionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_version_state import FormVersionState + from datadog_api_client.v2.model.form_version_upsert_params import FormVersionUpsertParams + + return { + "data_definition": (dict,), + "state": (FormVersionState,), + "ui_definition": (dict,), + "upsert_params": (FormVersionUpsertParams,), + } + + attribute_map = { + "data_definition": "data_definition", + "state": "state", + "ui_definition": "ui_definition", + "upsert_params": "upsert_params", + } + + def __init__( + self_, + data_definition: dict, + ui_definition: dict, + upsert_params: FormVersionUpsertParams, + state: Union[FormVersionState, UnsetType] = unset, + **kwargs, + ): + """ + + + :param data_definition: The data definition for the form. + :type data_definition: dict + + :param state: The state of the form version. + :type state: FormVersionState, optional + + :param ui_definition: The UI definition for the form. + :type ui_definition: dict + + :param upsert_params: Parameters for upserting a form version. + :type upsert_params: FormVersionUpsertParams + """ + if state is not unset: + kwargs["state"] = state + super().__init__(kwargs) + + self_.data_definition = data_definition + self_.ui_definition = ui_definition + self_.upsert_params = upsert_params diff --git a/src/datadog_api_client/v2/model/form_version_data_attributes_response.py b/src/datadog_api_client/v2/model/form_version_data_attributes_response.py new file mode 100644 index 0000000000..6ea30353ce --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_data_attributes_response.py @@ -0,0 +1,109 @@ +# 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, + datetime, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_version_state import FormVersionState + + +class FormVersionDataAttributesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_version_state import FormVersionState + + return { + "created_at": (datetime,), + "data_definition": (dict,), + "definition_signature": (str,), + "etag": (str,), + "modified_at": (datetime,), + "state": (FormVersionState,), + "ui_definition": (dict,), + "user_id": (int,), + "user_uuid": (UUID,), + "version": (int,), + } + + attribute_map = { + "created_at": "created_at", + "data_definition": "data_definition", + "definition_signature": "definition_signature", + "etag": "etag", + "modified_at": "modified_at", + "state": "state", + "ui_definition": "ui_definition", + "user_id": "user_id", + "user_uuid": "user_uuid", + "version": "version", + } + + def __init__( + self_, + created_at: datetime, + data_definition: dict, + definition_signature: str, + etag: str, + modified_at: datetime, + state: FormVersionState, + ui_definition: dict, + user_id: int, + user_uuid: UUID, + version: int, + **kwargs, + ): + """ + Attributes of a form version. + + :param created_at: Creation timestamp. + :type created_at: datetime + + :param data_definition: The data definition for the form. + :type data_definition: dict + + :param definition_signature: Signature of the form definition. + :type definition_signature: str + + :param etag: The entity tag for the version. + :type etag: str + + :param modified_at: Last modification timestamp. + :type modified_at: datetime + + :param state: The state of the form version. + :type state: FormVersionState + + :param ui_definition: The UI definition for the form. + :type ui_definition: dict + + :param user_id: The ID of the user who created the version. + :type user_id: int + + :param user_uuid: The UUID of the user who created the version. + :type user_uuid: UUID + + :param version: The version number. + :type version: int + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.data_definition = data_definition + self_.definition_signature = definition_signature + self_.etag = etag + self_.modified_at = modified_at + self_.state = state + self_.ui_definition = ui_definition + self_.user_id = user_id + self_.user_uuid = user_uuid + self_.version = version diff --git a/src/datadog_api_client/v2/model/form_version_data_request.py b/src/datadog_api_client/v2/model/form_version_data_request.py new file mode 100644 index 0000000000..99a1b0b63b --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_data_request.py @@ -0,0 +1,48 @@ +# 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.form_version_attributes import FormVersionAttributes + from datadog_api_client.v2.model.form_version_type import FormVersionType + + +class FormVersionDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_version_attributes import FormVersionAttributes + from datadog_api_client.v2.model.form_version_type import FormVersionType + + return { + "attributes": (FormVersionAttributes,), + "type": (FormVersionType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: FormVersionAttributes, type: FormVersionType, **kwargs): + """ + + + :param attributes: + :type attributes: FormVersionAttributes + + :param type: Type for form versions. + :type type: FormVersionType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/form_version_data_response.py b/src/datadog_api_client/v2/model/form_version_data_response.py new file mode 100644 index 0000000000..1ea7cffe7f --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_data_response.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.form_version_data_attributes_response import FormVersionDataAttributesResponse + from datadog_api_client.v2.model.form_version_type import FormVersionType + + +class FormVersionDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_version_data_attributes_response import FormVersionDataAttributesResponse + from datadog_api_client.v2.model.form_version_type import FormVersionType + + return { + "attributes": (FormVersionDataAttributesResponse,), + "id": (str,), + "type": (FormVersionType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: FormVersionDataAttributesResponse, id: str, type: FormVersionType, **kwargs): + """ + + + :param attributes: Attributes of a form version. + :type attributes: FormVersionDataAttributesResponse + + :param id: The version identifier. + :type id: str + + :param type: Type for form versions. + :type type: FormVersionType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/form_version_request.py b/src/datadog_api_client/v2/model/form_version_request.py new file mode 100644 index 0000000000..ce22221d26 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_request.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.form_version_data_request import FormVersionDataRequest + + +class FormVersionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_version_data_request import FormVersionDataRequest + + return { + "data": (FormVersionDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FormVersionDataRequest, **kwargs): + """ + Request for creating or updating a form version. + + :param data: + :type data: FormVersionDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/form_version_response.py b/src/datadog_api_client/v2/model/form_version_response.py new file mode 100644 index 0000000000..184504d269 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_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.form_version_data_response import FormVersionDataResponse + + +class FormVersionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_version_data_response import FormVersionDataResponse + + return { + "data": (FormVersionDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: FormVersionDataResponse, **kwargs): + """ + Response for a form version. + + :param data: + :type data: FormVersionDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/form_version_state.py b/src/datadog_api_client/v2/model/form_version_state.py new file mode 100644 index 0000000000..692e8ea289 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_state.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FormVersionState(ModelSimple): + """ + The state of the form version. + + :param value: Must be one of ["draft", "frozen"]. + :type value: str + """ + + allowed_values = { + "draft", + "frozen", + } + DRAFT: ClassVar["FormVersionState"] + FROZEN: ClassVar["FormVersionState"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FormVersionState.DRAFT = FormVersionState("draft") +FormVersionState.FROZEN = FormVersionState("frozen") diff --git a/src/datadog_api_client/v2/model/form_version_type.py b/src/datadog_api_client/v2/model/form_version_type.py new file mode 100644 index 0000000000..37e8bd2a23 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_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 FormVersionType(ModelSimple): + """ + Type for form versions. + + :param value: If omitted defaults to "form_versions". Must be one of ["form_versions"]. + :type value: str + """ + + allowed_values = { + "form_versions", + } + FORM_VERSIONS: ClassVar["FormVersionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FormVersionType.FORM_VERSIONS = FormVersionType("form_versions") diff --git a/src/datadog_api_client/v2/model/form_version_upsert_params.py b/src/datadog_api_client/v2/model/form_version_upsert_params.py new file mode 100644 index 0000000000..c80ec56bf6 --- /dev/null +++ b/src/datadog_api_client/v2/model/form_version_upsert_params.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class FormVersionUpsertParams(ModelNormal): + @cached_property + def openapi_types(_): + return { + "etag": (str,), + "match_policy": (str,), + } + + attribute_map = { + "etag": "etag", + "match_policy": "match_policy", + } + + def __init__(self_, etag: Union[str, UnsetType] = unset, match_policy: Union[str, UnsetType] = unset, **kwargs): + """ + Parameters for upserting a form version. + + :param etag: The entity tag for conflict detection. + :type etag: str, optional + + :param match_policy: The match policy for upserting. + :type match_policy: str, optional + """ + if etag is not unset: + kwargs["etag"] = etag + if match_policy is not unset: + kwargs["match_policy"] = match_policy + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/forms_list_response.py b/src/datadog_api_client/v2/model/forms_list_response.py new file mode 100644 index 0000000000..5f01b1cbd5 --- /dev/null +++ b/src/datadog_api_client/v2/model/forms_list_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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.form_data_response import FormDataResponse + + +class FormsListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.form_data_response import FormDataResponse + + return { + "data": ([FormDataResponse],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[FormDataResponse], **kwargs): + """ + Response containing a list of forms. + + :param data: An array of forms. + :type data: [FormDataResponse] + """ + 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 400d568fb4..8bc2939aef 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2043,6 +2043,42 @@ from datadog_api_client.v2.model.fleet_schedule_response import FleetScheduleResponse from datadog_api_client.v2.model.fleet_schedule_status import FleetScheduleStatus from datadog_api_client.v2.model.fleet_schedules_response import FleetSchedulesResponse +from datadog_api_client.v2.model.form_create_request import FormCreateRequest +from datadog_api_client.v2.model.form_data_attributes_request import FormDataAttributesRequest +from datadog_api_client.v2.model.form_data_attributes_response import FormDataAttributesResponse +from datadog_api_client.v2.model.form_data_request import FormDataRequest +from datadog_api_client.v2.model.form_data_response import FormDataResponse +from datadog_api_client.v2.model.form_datastore_config import FormDatastoreConfig +from datadog_api_client.v2.model.form_publication import FormPublication +from datadog_api_client.v2.model.form_publication_attributes import FormPublicationAttributes +from datadog_api_client.v2.model.form_publication_data_request import FormPublicationDataRequest +from datadog_api_client.v2.model.form_publication_data_response import FormPublicationDataResponse +from datadog_api_client.v2.model.form_publication_request import FormPublicationRequest +from datadog_api_client.v2.model.form_publication_response import FormPublicationResponse +from datadog_api_client.v2.model.form_publication_type import FormPublicationType +from datadog_api_client.v2.model.form_response import FormResponse +from datadog_api_client.v2.model.form_submission_attributes import FormSubmissionAttributes +from datadog_api_client.v2.model.form_submission_data_request import FormSubmissionDataRequest +from datadog_api_client.v2.model.form_submission_data_response import FormSubmissionDataResponse +from datadog_api_client.v2.model.form_submission_request import FormSubmissionRequest +from datadog_api_client.v2.model.form_submission_response import FormSubmissionResponse +from datadog_api_client.v2.model.form_submission_type import FormSubmissionType +from datadog_api_client.v2.model.form_type import FormType +from datadog_api_client.v2.model.form_update_attributes import FormUpdateAttributes +from datadog_api_client.v2.model.form_update_attributes_form_update import FormUpdateAttributesFormUpdate +from datadog_api_client.v2.model.form_update_data_request import FormUpdateDataRequest +from datadog_api_client.v2.model.form_update_request import FormUpdateRequest +from datadog_api_client.v2.model.form_version import FormVersion +from datadog_api_client.v2.model.form_version_attributes import FormVersionAttributes +from datadog_api_client.v2.model.form_version_data_attributes_response import FormVersionDataAttributesResponse +from datadog_api_client.v2.model.form_version_data_request import FormVersionDataRequest +from datadog_api_client.v2.model.form_version_data_response import FormVersionDataResponse +from datadog_api_client.v2.model.form_version_request import FormVersionRequest +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 +from datadog_api_client.v2.model.form_version_upsert_params import FormVersionUpsertParams +from datadog_api_client.v2.model.forms_list_response import FormsListResponse from datadog_api_client.v2.model.formula_limit import FormulaLimit from datadog_api_client.v2.model.framework_handle_and_version_response_data import FrameworkHandleAndVersionResponseData from datadog_api_client.v2.model.freshservice_api_key import FreshserviceAPIKey @@ -7471,6 +7507,42 @@ "FleetScheduleResponse", "FleetScheduleStatus", "FleetSchedulesResponse", + "FormCreateRequest", + "FormDataAttributesRequest", + "FormDataAttributesResponse", + "FormDataRequest", + "FormDataResponse", + "FormDatastoreConfig", + "FormPublication", + "FormPublicationAttributes", + "FormPublicationDataRequest", + "FormPublicationDataResponse", + "FormPublicationRequest", + "FormPublicationResponse", + "FormPublicationType", + "FormResponse", + "FormSubmissionAttributes", + "FormSubmissionDataRequest", + "FormSubmissionDataResponse", + "FormSubmissionRequest", + "FormSubmissionResponse", + "FormSubmissionType", + "FormType", + "FormUpdateAttributes", + "FormUpdateAttributesFormUpdate", + "FormUpdateDataRequest", + "FormUpdateRequest", + "FormVersion", + "FormVersionAttributes", + "FormVersionDataAttributesResponse", + "FormVersionDataRequest", + "FormVersionDataResponse", + "FormVersionRequest", + "FormVersionResponse", + "FormVersionState", + "FormVersionType", + "FormVersionUpsertParams", + "FormsListResponse", "FormulaLimit", "FrameworkHandleAndVersionResponseData", "FreshserviceAPIKey", diff --git a/tests/v2/features/forms.feature b/tests/v2/features/forms.feature new file mode 100644 index 0000000000..4ef762ec99 --- /dev/null +++ b/tests/v2/features/forms.feature @@ -0,0 +1,229 @@ +@endpoint(forms) @endpoint(forms-v2) +Feature: Forms + Create and manage forms for collecting data from users. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Forms" API + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create a form version returns "Bad Request" response + Given operation "UpsertFormVersion" enabled + And new "UpsertFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_definition": {"updated": "true"}, "state": "draft", "ui_definition": {}, "upsert_params": {"etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", "match_policy": "none"}}, "type": "form_versions"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create a form version returns "Conflict" response + Given operation "UpsertFormVersion" enabled + And new "UpsertFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_definition": {"updated": "true"}, "state": "draft", "ui_definition": {}, "upsert_params": {"etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", "match_policy": "none"}}, "type": "form_versions"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create a form version returns "OK" response + Given operation "UpsertFormVersion" enabled + And new "UpsertFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_definition": {"updated": "true"}, "state": "draft", "ui_definition": {}, "upsert_params": {"etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", "match_policy": "none"}}, "type": "form_versions"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create a new form returns "Bad Request" response + Given operation "CreateForm" enabled + And new "CreateForm" request + And body with value {"data": {"attributes": {"data_definition": {}, "description": "test description", "name": "test form happy path", "ui_definition": {}}, "id": "00000000-0000-0000-0000-000000000000", "type": "forms"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create a new form returns "OK" response + Given operation "CreateForm" enabled + And new "CreateForm" request + And body with value {"data": {"attributes": {"data_definition": {}, "description": "test description", "name": "test form happy path", "ui_definition": {}}, "id": "00000000-0000-0000-0000-000000000000", "type": "forms"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create and publish a form returns "Bad Request" response + Given operation "CreateAndPublishForm" enabled + And new "CreateAndPublishForm" request + And body with value {"data": {"attributes": {"data_definition": {}, "description": "test description", "name": "test form happy path", "ui_definition": {}}, "id": "00000000-0000-0000-0000-000000000000", "type": "forms"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create and publish a form returns "OK" response + Given operation "CreateAndPublishForm" enabled + And new "CreateAndPublishForm" request + And body with value {"data": {"attributes": {"data_definition": {}, "description": "test description", "name": "test form happy path", "ui_definition": {}}, "id": "00000000-0000-0000-0000-000000000000", "type": "forms"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Delete a form returns "Bad Request" response + Given operation "DeleteForm" enabled + And new "DeleteForm" 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: Delete a form returns "OK" response + Given operation "DeleteForm" enabled + And new "DeleteForm" 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: Get a form returns "Bad Request" response + Given operation "GetForm" enabled + And new "GetForm" 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: Get a form returns "Not Found" response + Given operation "GetForm" enabled + And new "GetForm" 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: Get a form returns "OK" response + Given operation "GetForm" enabled + And new "GetForm" 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 all forms returns "Bad Request" response + Given operation "ListForms" enabled + And new "ListForms" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List all forms returns "OK" response + Given operation "ListForms" enabled + And new "ListForms" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Publish a form returns "Bad Request" response + Given operation "PublishForm" enabled + And new "PublishForm" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"version": 1}, "type": "form_publications"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Publish a form returns "Not Found" response + Given operation "PublishForm" enabled + And new "PublishForm" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"version": 1}, "type": "form_publications"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Publish a form returns "OK" response + Given operation "PublishForm" enabled + And new "PublishForm" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"version": 1}, "type": "form_publications"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Submit a form returns "Bad Request" response + Given operation "SubmitForm" enabled + And new "SubmitForm" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"submission_data": {}}, "type": "form_submissions"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Submit a form returns "Not Found" response + Given operation "SubmitForm" enabled + And new "SubmitForm" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"submission_data": {}}, "type": "form_submissions"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Submit a form returns "OK" response + Given operation "SubmitForm" enabled + And new "SubmitForm" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"submission_data": {}}, "type": "form_submissions"}} + 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 + And new "UpdateForm" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"form_update": {"description": "Updated description", "name": "New Form Name"}}, "id": "00000000-0000-0000-0000-000000000000", "type": "forms"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update a form returns "Not Found" response + Given operation "UpdateForm" enabled + And new "UpdateForm" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"form_update": {"description": "Updated description", "name": "New Form Name"}}, "id": "00000000-0000-0000-0000-000000000000", "type": "forms"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update a form returns "OK" response + Given operation "UpdateForm" enabled + And new "UpdateForm" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"form_update": {"description": "Updated description", "name": "New Form Name"}}, "id": "00000000-0000-0000-0000-000000000000", "type": "forms"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Upsert and publish a form version returns "Bad Request" response + Given operation "UpsertAndPublishFormVersion" enabled + And new "UpsertAndPublishFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_definition": {"updated": "true"}, "state": "draft", "ui_definition": {}, "upsert_params": {"etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", "match_policy": "none"}}, "type": "form_versions"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Upsert and publish a form version returns "Conflict" response + Given operation "UpsertAndPublishFormVersion" enabled + And new "UpsertAndPublishFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_definition": {"updated": "true"}, "state": "draft", "ui_definition": {}, "upsert_params": {"etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", "match_policy": "none"}}, "type": "form_versions"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Upsert and publish a form version returns "OK" response + Given operation "UpsertAndPublishFormVersion" enabled + And new "UpsertAndPublishFormVersion" request + And request contains "form_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"data_definition": {"updated": "true"}, "state": "draft", "ui_definition": {}, "upsert_params": {"etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", "match_policy": "none"}}, "type": "form_versions"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 7e549784ee..8c5aa06109 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1616,6 +1616,80 @@ "type": "safe" } }, + "ListForms": { + "tag": "Forms", + "undo": { + "type": "safe" + } + }, + "CreateForm": { + "tag": "Forms", + "undo": { + "operationId": "DeleteForm", + "parameters": [ + { + "name": "form_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "CreateAndPublishForm": { + "tag": "Forms", + "undo": { + "operationId": "DeleteForm", + "parameters": [ + { + "name": "form_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteForm": { + "tag": "Forms", + "undo": { + "type": "idempotent" + } + }, + "GetForm": { + "tag": "Forms", + "undo": { + "type": "safe" + } + }, + "UpdateForm": { + "tag": "Forms", + "undo": { + "type": "idempotent" + } + }, + "PublishForm": { + "tag": "Forms", + "undo": { + "type": "unsafe" + } + }, + "SubmitForm": { + "tag": "Forms", + "undo": { + "type": "unsafe" + } + }, + "UpsertFormVersion": { + "tag": "Forms", + "undo": { + "type": "unsafe" + } + }, + "UpsertAndPublishFormVersion": { + "tag": "Forms", + "undo": { + "type": "unsafe" + } + }, "GetHamrOrgConnection": { "tag": "High Availability MultiRegion", "undo": {