diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a8908359f48..f39a404ba72 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/examples/v2/forms/CreateAndPublishForm.rb b/examples/v2/forms/CreateAndPublishForm.rb new file mode 100644 index 00000000000..a68a1715a77 --- /dev/null +++ b/examples/v2/forms/CreateAndPublishForm.rb @@ -0,0 +1,21 @@ +# Create and publish a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_and_publish_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +body = DatadogAPIClient::V2::FormCreateRequest.new({ + data: DatadogAPIClient::V2::FormDataRequest.new({ + attributes: DatadogAPIClient::V2::FormDataAttributesRequest.new({ + data_definition: {}, + description: "test description", + name: "test form happy path", + ui_definition: {}, + }), + id: "00000000-0000-0000-0000-000000000000", + type: DatadogAPIClient::V2::FormType::FORMS, + }), +}) +p api_instance.create_and_publish_form(body) diff --git a/examples/v2/forms/CreateForm.rb b/examples/v2/forms/CreateForm.rb new file mode 100644 index 00000000000..54eb3b6e8b0 --- /dev/null +++ b/examples/v2/forms/CreateForm.rb @@ -0,0 +1,21 @@ +# Create a new form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +body = DatadogAPIClient::V2::FormCreateRequest.new({ + data: DatadogAPIClient::V2::FormDataRequest.new({ + attributes: DatadogAPIClient::V2::FormDataAttributesRequest.new({ + data_definition: {}, + description: "test description", + name: "test form happy path", + ui_definition: {}, + }), + id: "00000000-0000-0000-0000-000000000000", + type: DatadogAPIClient::V2::FormType::FORMS, + }), +}) +p api_instance.create_form(body) diff --git a/examples/v2/forms/DeleteForm.rb b/examples/v2/forms/DeleteForm.rb new file mode 100644 index 00000000000..0ed6847b130 --- /dev/null +++ b/examples/v2/forms/DeleteForm.rb @@ -0,0 +1,8 @@ +# Delete a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new +p api_instance.delete_form("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/forms/GetForm.rb b/examples/v2/forms/GetForm.rb new file mode 100644 index 00000000000..16c16b9be9a --- /dev/null +++ b/examples/v2/forms/GetForm.rb @@ -0,0 +1,8 @@ +# Get a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new +p api_instance.get_form("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/forms/ListForms.rb b/examples/v2/forms/ListForms.rb new file mode 100644 index 00000000000..ce6472e4458 --- /dev/null +++ b/examples/v2/forms/ListForms.rb @@ -0,0 +1,8 @@ +# List all forms returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_forms".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new +p api_instance.list_forms() diff --git a/examples/v2/forms/PublishForm.rb b/examples/v2/forms/PublishForm.rb new file mode 100644 index 00000000000..9f73df03063 --- /dev/null +++ b/examples/v2/forms/PublishForm.rb @@ -0,0 +1,17 @@ +# Publish a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.publish_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +body = DatadogAPIClient::V2::FormPublicationRequest.new({ + data: DatadogAPIClient::V2::FormPublicationDataRequest.new({ + attributes: DatadogAPIClient::V2::FormPublicationAttributes.new({ + version: 1, + }), + type: DatadogAPIClient::V2::FormPublicationType::FORM_PUBLICATIONS, + }), +}) +p api_instance.publish_form("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/forms/SubmitForm.rb b/examples/v2/forms/SubmitForm.rb new file mode 100644 index 00000000000..9b75d0f2e1f --- /dev/null +++ b/examples/v2/forms/SubmitForm.rb @@ -0,0 +1,17 @@ +# Submit a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.submit_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +body = DatadogAPIClient::V2::FormSubmissionRequest.new({ + data: DatadogAPIClient::V2::FormSubmissionDataRequest.new({ + attributes: DatadogAPIClient::V2::FormSubmissionAttributes.new({ + submission_data: {}, + }), + type: DatadogAPIClient::V2::FormSubmissionType::FORM_SUBMISSIONS, + }), +}) +p api_instance.submit_form("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/forms/UpdateForm.rb b/examples/v2/forms/UpdateForm.rb new file mode 100644 index 00000000000..6553d5d2dd7 --- /dev/null +++ b/examples/v2/forms/UpdateForm.rb @@ -0,0 +1,21 @@ +# Update a form returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_form".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +body = DatadogAPIClient::V2::FormUpdateRequest.new({ + data: DatadogAPIClient::V2::FormUpdateDataRequest.new({ + attributes: DatadogAPIClient::V2::FormUpdateAttributes.new({ + form_update: DatadogAPIClient::V2::FormUpdateAttributesFormUpdate.new({ + description: "Updated description", + name: "New Form Name", + }), + }), + id: "00000000-0000-0000-0000-000000000000", + type: DatadogAPIClient::V2::FormType::FORMS, + }), +}) +p api_instance.update_form("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/forms/UpsertAndPublishFormVersion.rb b/examples/v2/forms/UpsertAndPublishFormVersion.rb new file mode 100644 index 00000000000..ed4a8b29c2f --- /dev/null +++ b/examples/v2/forms/UpsertAndPublishFormVersion.rb @@ -0,0 +1,25 @@ +# Upsert and publish a form version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.upsert_and_publish_form_version".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +body = DatadogAPIClient::V2::FormVersionRequest.new({ + data: DatadogAPIClient::V2::FormVersionDataRequest.new({ + attributes: DatadogAPIClient::V2::FormVersionAttributes.new({ + data_definition: { + "updated": "true", + }, + state: DatadogAPIClient::V2::FormVersionState::DRAFT, + ui_definition: {}, + upsert_params: DatadogAPIClient::V2::FormVersionUpsertParams.new({ + etag: "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", + match_policy: "none", + }), + }), + type: DatadogAPIClient::V2::FormVersionType::FORM_VERSIONS, + }), +}) +p api_instance.upsert_and_publish_form_version("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/forms/UpsertFormVersion.rb b/examples/v2/forms/UpsertFormVersion.rb new file mode 100644 index 00000000000..59e5b84a1c6 --- /dev/null +++ b/examples/v2/forms/UpsertFormVersion.rb @@ -0,0 +1,25 @@ +# Create a form version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.upsert_form_version".to_sym] = true +end +api_instance = DatadogAPIClient::V2::FormsAPI.new + +body = DatadogAPIClient::V2::FormVersionRequest.new({ + data: DatadogAPIClient::V2::FormVersionDataRequest.new({ + attributes: DatadogAPIClient::V2::FormVersionAttributes.new({ + data_definition: { + "updated": "true", + }, + state: DatadogAPIClient::V2::FormVersionState::DRAFT, + ui_definition: {}, + upsert_params: DatadogAPIClient::V2::FormVersionUpsertParams.new({ + etag: "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d", + match_policy: "none", + }), + }), + type: DatadogAPIClient::V2::FormVersionType::FORM_VERSIONS, + }), +}) +p api_instance.upsert_form_version("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f9f955f3192..172605272dd 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2087,6 +2087,43 @@ "v2.GetEvent" => { "event_id" => "String", }, + "v2.ListForms" => { + "name" => "String", + }, + "v2.CreateForm" => { + "body" => "FormCreateRequest", + }, + "v2.CreateAndPublishForm" => { + "body" => "FormCreateRequest", + }, + "v2.DeleteForm" => { + "form_id" => "UUID", + }, + "v2.GetForm" => { + "form_id" => "UUID", + "version" => "Integer", + "published_version" => "Boolean", + }, + "v2.UpdateForm" => { + "form_id" => "UUID", + "body" => "FormUpdateRequest", + }, + "v2.PublishForm" => { + "form_id" => "UUID", + "body" => "FormPublicationRequest", + }, + "v2.SubmitForm" => { + "form_id" => "UUID", + "body" => "FormSubmissionRequest", + }, + "v2.UpsertFormVersion" => { + "form_id" => "UUID", + "body" => "FormVersionRequest", + }, + "v2.UpsertAndPublishFormVersion" => { + "form_id" => "UUID", + "body" => "FormVersionRequest", + }, "v2.CreateHamrOrgConnection" => { "body" => "HamrOrgConnectionRequest", }, diff --git a/features/v2/forms.feature b/features/v2/forms.feature new file mode 100644 index 00000000000..4ef762ec992 --- /dev/null +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 7e549784ee6..8c5aa061097 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 1c3d360ecc9..c3b7d954570 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -247,6 +247,16 @@ def initialize "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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 8bcf2052b62..909437724d0 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2475,7 +2475,43 @@ def overrides "v2.fleet_schedule_response" => "FleetScheduleResponse", "v2.fleet_schedules_response" => "FleetSchedulesResponse", "v2.fleet_schedule_status" => "FleetScheduleStatus", + "v2.form_create_request" => "FormCreateRequest", + "v2.form_data_attributes_request" => "FormDataAttributesRequest", + "v2.form_data_attributes_response" => "FormDataAttributesResponse", + "v2.form_data_request" => "FormDataRequest", + "v2.form_data_response" => "FormDataResponse", + "v2.form_datastore_config" => "FormDatastoreConfig", + "v2.form_publication" => "FormPublication", + "v2.form_publication_attributes" => "FormPublicationAttributes", + "v2.form_publication_data_request" => "FormPublicationDataRequest", + "v2.form_publication_data_response" => "FormPublicationDataResponse", + "v2.form_publication_request" => "FormPublicationRequest", + "v2.form_publication_response" => "FormPublicationResponse", + "v2.form_publication_type" => "FormPublicationType", + "v2.form_response" => "FormResponse", + "v2.forms_list_response" => "FormsListResponse", + "v2.form_submission_attributes" => "FormSubmissionAttributes", + "v2.form_submission_data_request" => "FormSubmissionDataRequest", + "v2.form_submission_data_response" => "FormSubmissionDataResponse", + "v2.form_submission_request" => "FormSubmissionRequest", + "v2.form_submission_response" => "FormSubmissionResponse", + "v2.form_submission_type" => "FormSubmissionType", + "v2.form_type" => "FormType", "v2.formula_limit" => "FormulaLimit", + "v2.form_update_attributes" => "FormUpdateAttributes", + "v2.form_update_attributes_form_update" => "FormUpdateAttributesFormUpdate", + "v2.form_update_data_request" => "FormUpdateDataRequest", + "v2.form_update_request" => "FormUpdateRequest", + "v2.form_version" => "FormVersion", + "v2.form_version_attributes" => "FormVersionAttributes", + "v2.form_version_data_attributes_response" => "FormVersionDataAttributesResponse", + "v2.form_version_data_request" => "FormVersionDataRequest", + "v2.form_version_data_response" => "FormVersionDataResponse", + "v2.form_version_request" => "FormVersionRequest", + "v2.form_version_response" => "FormVersionResponse", + "v2.form_version_state" => "FormVersionState", + "v2.form_version_type" => "FormVersionType", + "v2.form_version_upsert_params" => "FormVersionUpsertParams", "v2.framework_handle_and_version_response_data" => "FrameworkHandleAndVersionResponseData", "v2.freshservice_api_key" => "FreshserviceAPIKey", "v2.freshservice_api_key_type" => "FreshserviceAPIKeyType", @@ -5263,6 +5299,7 @@ def overrides "v2.events_api" => "EventsAPI", "v2.fastly_integration_api" => "FastlyIntegrationAPI", "v2.fleet_automation_api" => "FleetAutomationAPI", + "v2.forms_api" => "FormsAPI", "v2.gcp_integration_api" => "GCPIntegrationAPI", "v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI", "v2.incident_services_api" => "IncidentServicesAPI", diff --git a/lib/datadog_api_client/v2/api/forms_api.rb b/lib/datadog_api_client/v2/api/forms_api.rb new file mode 100644 index 00000000000..5724251a2e1 --- /dev/null +++ b/lib/datadog_api_client/v2/api/forms_api.rb @@ -0,0 +1,776 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class FormsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create and publish a form. + # + # @see #create_and_publish_form_with_http_info + def create_and_publish_form(body, opts = {}) + data, _status_code, _headers = create_and_publish_form_with_http_info(body, opts) + data + end + + # Create and publish a form. + # + # Create a new form and publish it immediately. + # + # @param body [FormCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FormResponse, Integer, Hash)>] FormResponse data, response status code and response headers + def create_and_publish_form_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_and_publish_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_and_publish_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_and_publish_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.create_and_publish_form ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FormsAPI.create_and_publish_form" + end + # resource path + local_var_path = '/api/v2/forms/create_and_publish' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FormResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_and_publish_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#create_and_publish_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a new form. + # + # @see #create_form_with_http_info + def create_form(body, opts = {}) + data, _status_code, _headers = create_form_with_http_info(body, opts) + data + end + + # Create a new form. + # + # Create a new form with the specified configuration. + # + # @param body [FormCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FormResponse, Integer, Hash)>] FormResponse data, response status code and response headers + def create_form_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.create_form ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FormsAPI.create_form" + end + # resource path + local_var_path = '/api/v2/forms' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FormResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#create_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a form. + # + # @see #delete_form_with_http_info + def delete_form(form_id, opts = {}) + delete_form_with_http_info(form_id, opts) + nil + end + + # Delete a form. + # + # Delete a form by ID. + # + # @param form_id [UUID] The ID of the form. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_form_with_http_info(form_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.delete_form ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.delete_form" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#delete_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a form. + # + # @see #get_form_with_http_info + def get_form(form_id, opts = {}) + data, _status_code, _headers = get_form_with_http_info(form_id, opts) + data + end + + # Get a form. + # + # Get a form by ID. + # + # @param form_id [UUID] The ID of the form. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :version The version number of the form. + # @option opts [Boolean] :published_version Whether to get the published version. + # @return [Array<(FormResponse, Integer, Hash)>] FormResponse data, response status code and response headers + def get_form_with_http_info(form_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.get_form ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.get_form" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil? + query_params[:'published_version'] = opts[:'published_version'] if !opts[:'published_version'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'FormResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#get_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List all forms. + # + # @see #list_forms_with_http_info + def list_forms(opts = {}) + data, _status_code, _headers = list_forms_with_http_info(opts) + data + end + + # List all forms. + # + # Get a list of all forms. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :name Filter forms by name. + # @return [Array<(FormsListResponse, Integer, Hash)>] FormsListResponse data, response status code and response headers + def list_forms_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_forms".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_forms") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_forms")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.list_forms ...' + end + # resource path + local_var_path = '/api/v2/forms' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'FormsListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_forms, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#list_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Publish a form. + # + # @see #publish_form_with_http_info + def publish_form(form_id, body, opts = {}) + data, _status_code, _headers = publish_form_with_http_info(form_id, body, opts) + data + end + + # Publish a form. + # + # Publish a specific version of a form. + # + # @param form_id [UUID] The ID of the form. + # @param body [FormPublicationRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FormPublicationResponse, Integer, Hash)>] FormPublicationResponse data, response status code and response headers + def publish_form_with_http_info(form_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.publish_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.publish_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.publish_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.publish_form ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.publish_form" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FormsAPI.publish_form" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}/publish'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FormPublicationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :publish_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#publish_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Submit a form. + # + # @see #submit_form_with_http_info + def submit_form(form_id, body, opts = {}) + data, _status_code, _headers = submit_form_with_http_info(form_id, body, opts) + data + end + + # Submit a form. + # + # Submit data to a form. + # + # @param form_id [UUID] The ID of the form. + # @param body [FormSubmissionRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FormSubmissionResponse, Integer, Hash)>] FormSubmissionResponse data, response status code and response headers + def submit_form_with_http_info(form_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.submit_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.submit_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.submit_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.submit_form ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.submit_form" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FormsAPI.submit_form" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}/submit'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FormSubmissionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :submit_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#submit_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a form. + # + # @see #update_form_with_http_info + def update_form(form_id, body, opts = {}) + data, _status_code, _headers = update_form_with_http_info(form_id, body, opts) + data + end + + # Update a form. + # + # Update a form by ID. + # + # @param form_id [UUID] The ID of the form. + # @param body [FormUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FormResponse, Integer, Hash)>] FormResponse data, response status code and response headers + def update_form_with_http_info(form_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_form".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_form") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_form")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.update_form ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.update_form" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FormsAPI.update_form" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FormResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_form, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#update_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Upsert and publish a form version. + # + # @see #upsert_and_publish_form_version_with_http_info + def upsert_and_publish_form_version(form_id, body, opts = {}) + data, _status_code, _headers = upsert_and_publish_form_version_with_http_info(form_id, body, opts) + data + end + + # Upsert and publish a form version. + # + # Create or update a form version and publish it immediately. + # + # @param form_id [UUID] The ID of the form. + # @param body [FormVersionRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FormResponse, Integer, Hash)>] FormResponse data, response status code and response headers + def upsert_and_publish_form_version_with_http_info(form_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.upsert_and_publish_form_version".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upsert_and_publish_form_version") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upsert_and_publish_form_version")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.upsert_and_publish_form_version ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.upsert_and_publish_form_version" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FormsAPI.upsert_and_publish_form_version" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}/versions/upsert_and_publish'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FormResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :upsert_and_publish_form_version, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#upsert_and_publish_form_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a form version. + # + # @see #upsert_form_version_with_http_info + def upsert_form_version(form_id, body, opts = {}) + data, _status_code, _headers = upsert_form_version_with_http_info(form_id, body, opts) + data + end + + # Create a form version. + # + # Create or update a form version. + # + # @param form_id [UUID] The ID of the form. + # @param body [FormVersionRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FormVersionResponse, Integer, Hash)>] FormVersionResponse data, response status code and response headers + def upsert_form_version_with_http_info(form_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.upsert_form_version".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upsert_form_version") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upsert_form_version")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FormsAPI.upsert_form_version ...' + end + # verify the required parameter 'form_id' is set + if @api_client.config.client_side_validation && form_id.nil? + fail ArgumentError, "Missing the required parameter 'form_id' when calling FormsAPI.upsert_form_version" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FormsAPI.upsert_form_version" + end + # resource path + local_var_path = '/api/v2/forms/{form_id}/versions'.sub('{form_id}', CGI.escape(form_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FormVersionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :upsert_form_version, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FormsAPI#upsert_form_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_create_request.rb b/lib/datadog_api_client/v2/models/form_create_request.rb new file mode 100644 index 00000000000..fe092e15a03 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for creating a form. + class FormCreateRequest + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FormDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_data_attributes_request.rb b/lib/datadog_api_client/v2/models/form_data_attributes_request.rb new file mode 100644 index 00000000000..a929fe6db8d --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_data_attributes_request.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a form. + class FormDataAttributesRequest + include BaseGenericModel + + # The data definition for the form. + attr_reader :data_definition + + # The description of the form. + attr_reader :description + + # The name of the form. + attr_reader :name + + # The UI definition for the form. + attr_reader :ui_definition + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_definition' => :'data_definition', + :'description' => :'description', + :'name' => :'name', + :'ui_definition' => :'ui_definition' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_definition' => :'Object', + :'description' => :'String', + :'name' => :'String', + :'ui_definition' => :'Object' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_definition') + self.data_definition = attributes[:'data_definition'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'ui_definition') + self.ui_definition = attributes[:'ui_definition'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_definition.nil? + return false if @description.nil? + return false if @name.nil? + return false if @ui_definition.nil? + true + end + + # Custom attribute writer method with validation + # @param data_definition [Object] Object to be assigned + # @!visibility private + def data_definition=(data_definition) + if data_definition.nil? + fail ArgumentError, 'invalid value for "data_definition", data_definition cannot be nil.' + end + @data_definition = data_definition + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param ui_definition [Object] Object to be assigned + # @!visibility private + def ui_definition=(ui_definition) + if ui_definition.nil? + fail ArgumentError, 'invalid value for "ui_definition", ui_definition cannot be nil.' + end + @ui_definition = ui_definition + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_definition == o.data_definition && + description == o.description && + name == o.name && + ui_definition == o.ui_definition && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_definition, description, name, ui_definition, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_data_attributes_response.rb b/lib/datadog_api_client/v2/models/form_data_attributes_response.rb new file mode 100644 index 00000000000..d710ec92abb --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_data_attributes_response.rb @@ -0,0 +1,290 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a form. + class FormDataAttributesResponse + include BaseGenericModel + + # Creation timestamp. + attr_reader :created_at + + # Configuration for the form's associated datastore. + attr_reader :datastore_config + + # The description of the form. + attr_reader :description + + # Last modification timestamp. + attr_reader :modified_at + + # The name of the form. + attr_reader :name + + # The organization ID. + attr_reader :org_id + + # Publication information for the form. + attr_accessor :publication + + # The ID of the user who created the form. + attr_reader :user_id + + # The UUID of the user who created the form. + attr_reader :user_uuid + + # Version information for the form. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'datastore_config' => :'FormDatastoreConfig', + :'description' => :'String', + :'modified_at' => :'Time', + :'name' => :'String', + :'org_id' => :'Integer', + :'publication' => :'FormPublication', + :'user_id' => :'Integer', + :'user_uuid' => :'UUID', + :'version' => :'FormVersion' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'datastore_config') + self.datastore_config = attributes[:'datastore_config'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'publication') + self.publication = attributes[:'publication'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_uuid') + self.user_uuid = attributes[:'user_uuid'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @datastore_config.nil? + return false if @description.nil? + return false if @modified_at.nil? + return false if @name.nil? + return false if @org_id.nil? + return false if @user_id.nil? + return false if @user_uuid.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param datastore_config [Object] Object to be assigned + # @!visibility private + def datastore_config=(datastore_config) + if datastore_config.nil? + fail ArgumentError, 'invalid value for "datastore_config", datastore_config cannot be nil.' + end + @datastore_config = datastore_config + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param user_id [Object] Object to be assigned + # @!visibility private + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'invalid value for "user_id", user_id cannot be nil.' + end + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param user_uuid [Object] Object to be assigned + # @!visibility private + def user_uuid=(user_uuid) + if user_uuid.nil? + fail ArgumentError, 'invalid value for "user_uuid", user_uuid cannot be nil.' + end + @user_uuid = user_uuid + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + datastore_config == o.datastore_config && + description == o.description && + modified_at == o.modified_at && + name == o.name && + org_id == o.org_id && + publication == o.publication && + user_id == o.user_id && + user_uuid == o.user_uuid && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, datastore_config, description, modified_at, name, org_id, publication, user_id, user_uuid, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_data_request.rb b/lib/datadog_api_client/v2/models/form_data_request.rb new file mode 100644 index 00000000000..4521c402ede --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_data_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormDataRequest + include BaseGenericModel + + # Attributes for creating a form. + attr_reader :attributes + + # The form identifier. + attr_accessor :id + + # Type for forms. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FormDataAttributesRequest', + :'id' => :'UUID', + :'type' => :'FormType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_data_response.rb b/lib/datadog_api_client/v2/models/form_data_response.rb new file mode 100644 index 00000000000..117785b2d47 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_data_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormDataResponse + include BaseGenericModel + + # Attributes of a form. + attr_reader :attributes + + # The form identifier. + attr_reader :id + + # Type for forms. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FormDataAttributesResponse', + :'id' => :'UUID', + :'type' => :'FormType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_datastore_config.rb b/lib/datadog_api_client/v2/models/form_datastore_config.rb new file mode 100644 index 00000000000..8b12b6dc086 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_datastore_config.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Configuration for the form's associated datastore. + class FormDatastoreConfig + include BaseGenericModel + + # The unique identifier of the datastore. + attr_reader :datastore_id + + # The name of the primary key column. + attr_reader :primary_column_name + + # The strategy used for generating primary keys. + attr_reader :primary_key_generation_strategy + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'datastore_id' => :'datastore_id', + :'primary_column_name' => :'primary_column_name', + :'primary_key_generation_strategy' => :'primary_key_generation_strategy' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'datastore_id' => :'UUID', + :'primary_column_name' => :'String', + :'primary_key_generation_strategy' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormDatastoreConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'datastore_id') + self.datastore_id = attributes[:'datastore_id'] + end + + if attributes.key?(:'primary_column_name') + self.primary_column_name = attributes[:'primary_column_name'] + end + + if attributes.key?(:'primary_key_generation_strategy') + self.primary_key_generation_strategy = attributes[:'primary_key_generation_strategy'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @datastore_id.nil? + return false if @primary_column_name.nil? + return false if @primary_key_generation_strategy.nil? + true + end + + # Custom attribute writer method with validation + # @param datastore_id [Object] Object to be assigned + # @!visibility private + def datastore_id=(datastore_id) + if datastore_id.nil? + fail ArgumentError, 'invalid value for "datastore_id", datastore_id cannot be nil.' + end + @datastore_id = datastore_id + end + + # Custom attribute writer method with validation + # @param primary_column_name [Object] Object to be assigned + # @!visibility private + def primary_column_name=(primary_column_name) + if primary_column_name.nil? + fail ArgumentError, 'invalid value for "primary_column_name", primary_column_name cannot be nil.' + end + @primary_column_name = primary_column_name + end + + # Custom attribute writer method with validation + # @param primary_key_generation_strategy [Object] Object to be assigned + # @!visibility private + def primary_key_generation_strategy=(primary_key_generation_strategy) + if primary_key_generation_strategy.nil? + fail ArgumentError, 'invalid value for "primary_key_generation_strategy", primary_key_generation_strategy cannot be nil.' + end + @primary_key_generation_strategy = primary_key_generation_strategy + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + datastore_id == o.datastore_id && + primary_column_name == o.primary_column_name && + primary_key_generation_strategy == o.primary_key_generation_strategy && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [datastore_id, primary_column_name, primary_key_generation_strategy, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_publication.rb b/lib/datadog_api_client/v2/models/form_publication.rb new file mode 100644 index 00000000000..88c8c24b5fb --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_publication.rb @@ -0,0 +1,269 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Publication information for the form. + class FormPublication + include BaseGenericModel + + # Creation timestamp. + attr_reader :created_at + + # The form identifier. + attr_reader :form_id + + # The version of the form that was published. + attr_accessor :form_version + + # The unique identifier of the publication. + attr_reader :id + + # Last modification timestamp. + attr_reader :modified_at + + # The organization ID. + attr_reader :org_id + + # The publication sequence number. + attr_accessor :publish_seq + + # The ID of the user who published. + attr_reader :user_id + + # The UUID of the user who published. + attr_reader :user_uuid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'form_id' => :'UUID', + :'form_version' => :'Integer', + :'id' => :'String', + :'modified_at' => :'Time', + :'org_id' => :'Integer', + :'publish_seq' => :'Integer', + :'user_id' => :'Integer', + :'user_uuid' => :'UUID' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormPublication` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'form_id') + self.form_id = attributes[:'form_id'] + end + + if attributes.key?(:'form_version') + self.form_version = attributes[:'form_version'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'publish_seq') + self.publish_seq = attributes[:'publish_seq'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_uuid') + self.user_uuid = attributes[:'user_uuid'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @form_id.nil? + return false if @id.nil? + return false if @modified_at.nil? + return false if @org_id.nil? + return false if @user_id.nil? + return false if @user_uuid.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param form_id [Object] Object to be assigned + # @!visibility private + def form_id=(form_id) + if form_id.nil? + fail ArgumentError, 'invalid value for "form_id", form_id cannot be nil.' + end + @form_id = form_id + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param user_id [Object] Object to be assigned + # @!visibility private + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'invalid value for "user_id", user_id cannot be nil.' + end + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param user_uuid [Object] Object to be assigned + # @!visibility private + def user_uuid=(user_uuid) + if user_uuid.nil? + fail ArgumentError, 'invalid value for "user_uuid", user_uuid cannot be nil.' + end + @user_uuid = user_uuid + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + form_id == o.form_id && + form_version == o.form_version && + id == o.id && + modified_at == o.modified_at && + org_id == o.org_id && + publish_seq == o.publish_seq && + user_id == o.user_id && + user_uuid == o.user_uuid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, form_id, form_version, id, modified_at, org_id, publish_seq, user_id, user_uuid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_publication_attributes.rb b/lib/datadog_api_client/v2/models/form_publication_attributes.rb new file mode 100644 index 00000000000..f4b01688e67 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_publication_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormPublicationAttributes + include BaseGenericModel + + # The version number to publish. + attr_reader :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'version' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormPublicationAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @version.nil? + true + end + + # Custom attribute writer method with validation + # @param version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + @version = version + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_publication_data_request.rb b/lib/datadog_api_client/v2/models/form_publication_data_request.rb new file mode 100644 index 00000000000..4c087f19c19 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_publication_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormPublicationDataRequest + include BaseGenericModel + + # + attr_reader :attributes + + # Type for form publications. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FormPublicationAttributes', + :'type' => :'FormPublicationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormPublicationDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_publication_data_response.rb b/lib/datadog_api_client/v2/models/form_publication_data_response.rb new file mode 100644 index 00000000000..3a5db8f4ded --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_publication_data_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormPublicationDataResponse + include BaseGenericModel + + # Publication information for the form. + attr_reader :attributes + + # The publication identifier. + attr_reader :id + + # Type for form publications. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FormPublication', + :'id' => :'String', + :'type' => :'FormPublicationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormPublicationDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_publication_request.rb b/lib/datadog_api_client/v2/models/form_publication_request.rb new file mode 100644 index 00000000000..1f922535525 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_publication_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for publishing a form. + class FormPublicationRequest + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FormPublicationDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormPublicationRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_publication_response.rb b/lib/datadog_api_client/v2/models/form_publication_response.rb new file mode 100644 index 00000000000..93a2d29af74 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_publication_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a form publication. + class FormPublicationResponse + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FormPublicationDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormPublicationResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_publication_type.rb b/lib/datadog_api_client/v2/models/form_publication_type.rb new file mode 100644 index 00000000000..b69af0fd2a9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_publication_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type for form publications. + class FormPublicationType + include BaseEnumModel + + FORM_PUBLICATIONS = "form_publications".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/form_response.rb b/lib/datadog_api_client/v2/models/form_response.rb new file mode 100644 index 00000000000..d4e829f0ea5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single form. + class FormResponse + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FormDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_submission_attributes.rb b/lib/datadog_api_client/v2/models/form_submission_attributes.rb new file mode 100644 index 00000000000..2a33f38b054 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_submission_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormSubmissionAttributes + include BaseGenericModel + + # The data submitted with the form. + attr_reader :submission_data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'submission_data' => :'submission_data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'submission_data' => :'Object' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormSubmissionAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'submission_data') + self.submission_data = attributes[:'submission_data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @submission_data.nil? + true + end + + # Custom attribute writer method with validation + # @param submission_data [Object] Object to be assigned + # @!visibility private + def submission_data=(submission_data) + if submission_data.nil? + fail ArgumentError, 'invalid value for "submission_data", submission_data cannot be nil.' + end + @submission_data = submission_data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + submission_data == o.submission_data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [submission_data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_submission_data_request.rb b/lib/datadog_api_client/v2/models/form_submission_data_request.rb new file mode 100644 index 00000000000..dd046886b88 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_submission_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormSubmissionDataRequest + include BaseGenericModel + + # + attr_reader :attributes + + # Type for form submissions. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FormSubmissionAttributes', + :'type' => :'FormSubmissionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormSubmissionDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_submission_data_response.rb b/lib/datadog_api_client/v2/models/form_submission_data_response.rb new file mode 100644 index 00000000000..1f25fdcae06 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_submission_data_response.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormSubmissionDataResponse + include BaseGenericModel + + # The submission identifier. + attr_reader :id + + # Type for form submissions. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'FormSubmissionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormSubmissionDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_submission_request.rb b/lib/datadog_api_client/v2/models/form_submission_request.rb new file mode 100644 index 00000000000..162c5fa63a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_submission_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for submitting a form. + class FormSubmissionRequest + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FormSubmissionDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormSubmissionRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_submission_response.rb b/lib/datadog_api_client/v2/models/form_submission_response.rb new file mode 100644 index 00000000000..b12271693f2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_submission_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a form submission. + class FormSubmissionResponse + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FormSubmissionDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormSubmissionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_submission_type.rb b/lib/datadog_api_client/v2/models/form_submission_type.rb new file mode 100644 index 00000000000..898753f39a2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_submission_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type for form submissions. + class FormSubmissionType + include BaseEnumModel + + FORM_SUBMISSIONS = "form_submissions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/form_type.rb b/lib/datadog_api_client/v2/models/form_type.rb new file mode 100644 index 00000000000..eaad68ee8ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type for forms. + class FormType + include BaseEnumModel + + FORMS = "forms".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/form_update_attributes.rb b/lib/datadog_api_client/v2/models/form_update_attributes.rb new file mode 100644 index 00000000000..cb3f918b496 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_update_attributes.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating a form. + class FormUpdateAttributes + include BaseGenericModel + + # Update parameters for the form. + attr_accessor :form_update + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'form_update' => :'form_update' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'form_update' => :'FormUpdateAttributesFormUpdate' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'form_update') + self.form_update = attributes[:'form_update'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + form_update == o.form_update && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [form_update, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_update_attributes_form_update.rb b/lib/datadog_api_client/v2/models/form_update_attributes_form_update.rb new file mode 100644 index 00000000000..490090a0558 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_update_attributes_form_update.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update parameters for the form. + class FormUpdateAttributesFormUpdate + include BaseGenericModel + + # The updated description of the form. + attr_accessor :description + + # The updated name of the form. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormUpdateAttributesFormUpdate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_update_data_request.rb b/lib/datadog_api_client/v2/models/form_update_data_request.rb new file mode 100644 index 00000000000..1d427d7de10 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_update_data_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormUpdateDataRequest + include BaseGenericModel + + # Attributes for updating a form. + attr_reader :attributes + + # The form identifier. + attr_accessor :id + + # Type for forms. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FormUpdateAttributes', + :'id' => :'UUID', + :'type' => :'FormType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormUpdateDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_update_request.rb b/lib/datadog_api_client/v2/models/form_update_request.rb new file mode 100644 index 00000000000..571beef3fe1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for updating a form. + class FormUpdateRequest + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FormUpdateDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_version.rb b/lib/datadog_api_client/v2/models/form_version.rb new file mode 100644 index 00000000000..2b7d4552b88 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version.rb @@ -0,0 +1,300 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Version information for the form. + class FormVersion + include BaseGenericModel + + # Creation timestamp. + attr_reader :created_at + + # The data definition for the form. + attr_reader :data_definition + + # Signature of the form definition. + attr_accessor :definition_signature + + # The entity tag for the version. + attr_accessor :etag + + # The unique identifier of the form version. + attr_reader :id + + # Last modification timestamp. + attr_reader :modified_at + + # The state of the form version. + attr_reader :state + + # The UI definition for the form. + attr_reader :ui_definition + + # The ID of the user who created the version. + attr_reader :user_id + + # The UUID of the user who created the version. + attr_reader :user_uuid + + # The version number. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'data_definition' => :'Object', + :'definition_signature' => :'String', + :'etag' => :'String', + :'id' => :'String', + :'modified_at' => :'Time', + :'state' => :'FormVersionState', + :'ui_definition' => :'Object', + :'user_id' => :'Integer', + :'user_uuid' => :'UUID', + :'version' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormVersion` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'data_definition') + self.data_definition = attributes[:'data_definition'] + end + + if attributes.key?(:'definition_signature') + self.definition_signature = attributes[:'definition_signature'] + end + + if attributes.key?(:'etag') + self.etag = attributes[:'etag'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'ui_definition') + self.ui_definition = attributes[:'ui_definition'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_uuid') + self.user_uuid = attributes[:'user_uuid'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @data_definition.nil? + return false if @id.nil? + return false if @modified_at.nil? + return false if @state.nil? + return false if @ui_definition.nil? + return false if @user_id.nil? + return false if @user_uuid.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param data_definition [Object] Object to be assigned + # @!visibility private + def data_definition=(data_definition) + if data_definition.nil? + fail ArgumentError, 'invalid value for "data_definition", data_definition cannot be nil.' + end + @data_definition = data_definition + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param state [Object] Object to be assigned + # @!visibility private + def state=(state) + if state.nil? + fail ArgumentError, 'invalid value for "state", state cannot be nil.' + end + @state = state + end + + # Custom attribute writer method with validation + # @param ui_definition [Object] Object to be assigned + # @!visibility private + def ui_definition=(ui_definition) + if ui_definition.nil? + fail ArgumentError, 'invalid value for "ui_definition", ui_definition cannot be nil.' + end + @ui_definition = ui_definition + end + + # Custom attribute writer method with validation + # @param user_id [Object] Object to be assigned + # @!visibility private + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'invalid value for "user_id", user_id cannot be nil.' + end + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param user_uuid [Object] Object to be assigned + # @!visibility private + def user_uuid=(user_uuid) + if user_uuid.nil? + fail ArgumentError, 'invalid value for "user_uuid", user_uuid cannot be nil.' + end + @user_uuid = user_uuid + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + data_definition == o.data_definition && + definition_signature == o.definition_signature && + etag == o.etag && + id == o.id && + modified_at == o.modified_at && + state == o.state && + ui_definition == o.ui_definition && + user_id == o.user_id && + user_uuid == o.user_uuid && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, data_definition, definition_signature, etag, id, modified_at, state, ui_definition, user_id, user_uuid, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_attributes.rb b/lib/datadog_api_client/v2/models/form_version_attributes.rb new file mode 100644 index 00000000000..a513f23ff1d --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_attributes.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormVersionAttributes + include BaseGenericModel + + # The data definition for the form. + attr_reader :data_definition + + # The state of the form version. + attr_accessor :state + + # The UI definition for the form. + attr_reader :ui_definition + + # Parameters for upserting a form version. + attr_reader :upsert_params + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_definition' => :'data_definition', + :'state' => :'state', + :'ui_definition' => :'ui_definition', + :'upsert_params' => :'upsert_params' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_definition' => :'Object', + :'state' => :'FormVersionState', + :'ui_definition' => :'Object', + :'upsert_params' => :'FormVersionUpsertParams' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormVersionAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_definition') + self.data_definition = attributes[:'data_definition'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'ui_definition') + self.ui_definition = attributes[:'ui_definition'] + end + + if attributes.key?(:'upsert_params') + self.upsert_params = attributes[:'upsert_params'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_definition.nil? + return false if @ui_definition.nil? + return false if @upsert_params.nil? + true + end + + # Custom attribute writer method with validation + # @param data_definition [Object] Object to be assigned + # @!visibility private + def data_definition=(data_definition) + if data_definition.nil? + fail ArgumentError, 'invalid value for "data_definition", data_definition cannot be nil.' + end + @data_definition = data_definition + end + + # Custom attribute writer method with validation + # @param ui_definition [Object] Object to be assigned + # @!visibility private + def ui_definition=(ui_definition) + if ui_definition.nil? + fail ArgumentError, 'invalid value for "ui_definition", ui_definition cannot be nil.' + end + @ui_definition = ui_definition + end + + # Custom attribute writer method with validation + # @param upsert_params [Object] Object to be assigned + # @!visibility private + def upsert_params=(upsert_params) + if upsert_params.nil? + fail ArgumentError, 'invalid value for "upsert_params", upsert_params cannot be nil.' + end + @upsert_params = upsert_params + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_definition == o.data_definition && + state == o.state && + ui_definition == o.ui_definition && + upsert_params == o.upsert_params && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_definition, state, ui_definition, upsert_params, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_data_attributes_response.rb b/lib/datadog_api_client/v2/models/form_version_data_attributes_response.rb new file mode 100644 index 00000000000..79830c0f5bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_data_attributes_response.rb @@ -0,0 +1,312 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a form version. + class FormVersionDataAttributesResponse + include BaseGenericModel + + # Creation timestamp. + attr_reader :created_at + + # The data definition for the form. + attr_reader :data_definition + + # Signature of the form definition. + attr_reader :definition_signature + + # The entity tag for the version. + attr_reader :etag + + # Last modification timestamp. + attr_reader :modified_at + + # The state of the form version. + attr_reader :state + + # The UI definition for the form. + attr_reader :ui_definition + + # The ID of the user who created the version. + attr_reader :user_id + + # The UUID of the user who created the version. + attr_reader :user_uuid + + # The version number. + attr_reader :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'data_definition' => :'Object', + :'definition_signature' => :'String', + :'etag' => :'String', + :'modified_at' => :'Time', + :'state' => :'FormVersionState', + :'ui_definition' => :'Object', + :'user_id' => :'Integer', + :'user_uuid' => :'UUID', + :'version' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormVersionDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'data_definition') + self.data_definition = attributes[:'data_definition'] + end + + if attributes.key?(:'definition_signature') + self.definition_signature = attributes[:'definition_signature'] + end + + if attributes.key?(:'etag') + self.etag = attributes[:'etag'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'ui_definition') + self.ui_definition = attributes[:'ui_definition'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_uuid') + self.user_uuid = attributes[:'user_uuid'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @data_definition.nil? + return false if @definition_signature.nil? + return false if @etag.nil? + return false if @modified_at.nil? + return false if @state.nil? + return false if @ui_definition.nil? + return false if @user_id.nil? + return false if @user_uuid.nil? + return false if @version.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param data_definition [Object] Object to be assigned + # @!visibility private + def data_definition=(data_definition) + if data_definition.nil? + fail ArgumentError, 'invalid value for "data_definition", data_definition cannot be nil.' + end + @data_definition = data_definition + end + + # Custom attribute writer method with validation + # @param definition_signature [Object] Object to be assigned + # @!visibility private + def definition_signature=(definition_signature) + if definition_signature.nil? + fail ArgumentError, 'invalid value for "definition_signature", definition_signature cannot be nil.' + end + @definition_signature = definition_signature + end + + # Custom attribute writer method with validation + # @param etag [Object] Object to be assigned + # @!visibility private + def etag=(etag) + if etag.nil? + fail ArgumentError, 'invalid value for "etag", etag cannot be nil.' + end + @etag = etag + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param state [Object] Object to be assigned + # @!visibility private + def state=(state) + if state.nil? + fail ArgumentError, 'invalid value for "state", state cannot be nil.' + end + @state = state + end + + # Custom attribute writer method with validation + # @param ui_definition [Object] Object to be assigned + # @!visibility private + def ui_definition=(ui_definition) + if ui_definition.nil? + fail ArgumentError, 'invalid value for "ui_definition", ui_definition cannot be nil.' + end + @ui_definition = ui_definition + end + + # Custom attribute writer method with validation + # @param user_id [Object] Object to be assigned + # @!visibility private + def user_id=(user_id) + if user_id.nil? + fail ArgumentError, 'invalid value for "user_id", user_id cannot be nil.' + end + @user_id = user_id + end + + # Custom attribute writer method with validation + # @param user_uuid [Object] Object to be assigned + # @!visibility private + def user_uuid=(user_uuid) + if user_uuid.nil? + fail ArgumentError, 'invalid value for "user_uuid", user_uuid cannot be nil.' + end + @user_uuid = user_uuid + end + + # Custom attribute writer method with validation + # @param version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + @version = version + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + data_definition == o.data_definition && + definition_signature == o.definition_signature && + etag == o.etag && + modified_at == o.modified_at && + state == o.state && + ui_definition == o.ui_definition && + user_id == o.user_id && + user_uuid == o.user_uuid && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, data_definition, definition_signature, etag, modified_at, state, ui_definition, user_id, user_uuid, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_data_request.rb b/lib/datadog_api_client/v2/models/form_version_data_request.rb new file mode 100644 index 00000000000..173cf0c154e --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormVersionDataRequest + include BaseGenericModel + + # + attr_reader :attributes + + # Type for form versions. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FormVersionAttributes', + :'type' => :'FormVersionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormVersionDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_data_response.rb b/lib/datadog_api_client/v2/models/form_version_data_response.rb new file mode 100644 index 00000000000..964491f4a9e --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_data_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FormVersionDataResponse + include BaseGenericModel + + # Attributes of a form version. + attr_reader :attributes + + # The version identifier. + attr_reader :id + + # Type for form versions. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FormVersionDataAttributesResponse', + :'id' => :'String', + :'type' => :'FormVersionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormVersionDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_request.rb b/lib/datadog_api_client/v2/models/form_version_request.rb new file mode 100644 index 00000000000..376ed27af69 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for creating or updating a form version. + class FormVersionRequest + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FormVersionDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormVersionRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_response.rb b/lib/datadog_api_client/v2/models/form_version_response.rb new file mode 100644 index 00000000000..c6a4c6e2f1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a form version. + class FormVersionResponse + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FormVersionDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormVersionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_state.rb b/lib/datadog_api_client/v2/models/form_version_state.rb new file mode 100644 index 00000000000..704609f8541 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_state.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The state of the form version. + class FormVersionState + include BaseEnumModel + + DRAFT = "draft".freeze + FROZEN = "frozen".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_type.rb b/lib/datadog_api_client/v2/models/form_version_type.rb new file mode 100644 index 00000000000..a5ca08f17b5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type for form versions. + class FormVersionType + include BaseEnumModel + + FORM_VERSIONS = "form_versions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/form_version_upsert_params.rb b/lib/datadog_api_client/v2/models/form_version_upsert_params.rb new file mode 100644 index 00000000000..68c02ea59ac --- /dev/null +++ b/lib/datadog_api_client/v2/models/form_version_upsert_params.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Parameters for upserting a form version. + class FormVersionUpsertParams + include BaseGenericModel + + # The entity tag for conflict detection. + attr_accessor :etag + + # The match policy for upserting. + attr_accessor :match_policy + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'etag' => :'etag', + :'match_policy' => :'match_policy' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'etag' => :'String', + :'match_policy' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormVersionUpsertParams` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'etag') + self.etag = attributes[:'etag'] + end + + if attributes.key?(:'match_policy') + self.match_policy = attributes[:'match_policy'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + etag == o.etag && + match_policy == o.match_policy && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [etag, match_policy, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/forms_list_response.rb b/lib/datadog_api_client/v2/models/forms_list_response.rb new file mode 100644 index 00000000000..8f9fa952234 --- /dev/null +++ b/lib/datadog_api_client/v2/models/forms_list_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of forms. + class FormsListResponse + include BaseGenericModel + + # An array of forms. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FormsListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end