diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e301432aca72..21ddd5b34deb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -823,6 +823,14 @@ components: example: f9ec96b0-8c8a-4b0a-9b0a-1b2c3d4e5f6a format: uuid type: string + OrgIdQuery: + description: The organization ID + in: query + name: orgId + required: true + schema: + format: uuid + type: string PageNumber: description: Specific page number to return. in: query @@ -853,6 +861,13 @@ components: example: 10 format: int64 type: integer + ParentId: + description: The ID of the parent workflow + in: path + name: parent_id + required: true + schema: + type: string ProductName: description: Name of the product to be deleted, either `logs` or `rum`. in: path @@ -67176,6 +67191,154 @@ components: type: string writeOnly: true type: object + WorkflowFavoriteRequest: + properties: + data: + $ref: '#/components/schemas/WorkflowFavoriteRequestData' + required: + - data + type: object + WorkflowFavoriteRequestAttributes: + properties: + favorite: + description: Whether to mark the workflow as favorite (true) or unfavorite + (false) + example: true + type: boolean + required: + - favorite + type: object + WorkflowFavoriteRequestData: + properties: + attributes: + $ref: '#/components/schemas/WorkflowFavoriteRequestAttributes' + type: + $ref: '#/components/schemas/WorkflowFavoriteRequestType' + required: + - type + - attributes + type: object + WorkflowFavoriteRequestType: + description: The type for workflow favorite request + enum: + - workflow_favorite_request + example: workflow_favorite_request + type: string + x-enum-varnames: + - WORKFLOW_FAVORITE_REQUEST + WorkflowHeadlessExecutionConfig: + properties: + connections: + description: List of connections to use for the workflow execution + items: + $ref: '#/components/schemas/WorkflowHeadlessExecutionConnection' + type: array + inputs: + additionalProperties: {} + description: Input parameters for the workflow execution + example: {} + type: object + required: + - connections + - inputs + type: object + WorkflowHeadlessExecutionConnection: + properties: + connection_id: + description: The ID of the connection + example: 11111111-1111-1111-1111-111111111111 + format: uuid + type: string + label: + description: The label for the connection + example: INTEGRATION_DATADOG + type: string + required: + - label + - connection_id + type: object + WorkflowHeadlessExecutionRequest: + properties: + data: + $ref: '#/components/schemas/WorkflowHeadlessExecutionRequestData' + required: + - data + type: object + WorkflowHeadlessExecutionRequestAttributes: + properties: + config: + $ref: '#/components/schemas/WorkflowHeadlessExecutionConfig' + template_id: + description: The ID of the workflow template to execute + example: template-789 + type: string + required: + - template_id + - config + type: object + WorkflowHeadlessExecutionRequestData: + properties: + attributes: + $ref: '#/components/schemas/WorkflowHeadlessExecutionRequestAttributes' + id: + description: The ID of the parent workflow + example: '1234' + type: string + type: + $ref: '#/components/schemas/WorkflowHeadlessExecutionRequestType' + required: + - type + - id + - attributes + type: object + WorkflowHeadlessExecutionRequestType: + description: The type for workflow headless execution request + enum: + - workflow_headless_execution_request + example: workflow_headless_execution_request + type: string + x-enum-varnames: + - WORKFLOW_HEADLESS_EXECUTION_REQUEST + WorkflowHeadlessExecutionResponse: + properties: + data: + $ref: '#/components/schemas/WorkflowHeadlessExecutionResponseData' + required: + - data + type: object + WorkflowHeadlessExecutionResponseAttributes: + properties: + instance_id: + description: The ID of the workflow instance that was created + example: instance-abc + format: uuid + type: string + required: + - instance_id + type: object + WorkflowHeadlessExecutionResponseData: + properties: + attributes: + $ref: '#/components/schemas/WorkflowHeadlessExecutionResponseAttributes' + id: + description: The ID of the parent workflow + example: '1234' + type: string + type: + $ref: '#/components/schemas/WorkflowHeadlessExecutionResponseType' + required: + - type + - id + - attributes + type: object + WorkflowHeadlessExecutionResponseType: + description: The type for workflow headless execution response + enum: + - workflow_headless_execution + example: workflow_headless_execution + type: string + x-enum-varnames: + - WORKFLOW_HEADLESS_EXECUTION WorkflowInstanceCreateMeta: description: Additional information for creating a workflow instance. properties: @@ -67281,6 +67444,58 @@ components: type: string x-enum-varnames: - USERS + WorkflowWebhookExecutionResponse: + properties: + data: + $ref: '#/components/schemas/WorkflowWebhookExecutionResponseData' + required: + - data + type: object + WorkflowWebhookExecutionResponseAttributes: + properties: + instance_id: + description: The ID of the workflow instance that was created + example: instance-456 + format: uuid + type: string + workflow_id: + description: The ID of the workflow that was executed + example: aa76b482-0c00-4f1c-9b63-7a20f7bf41f8 + format: uuid + type: string + required: + - workflow_id + - instance_id + type: object + WorkflowWebhookExecutionResponseData: + properties: + attributes: + $ref: '#/components/schemas/WorkflowWebhookExecutionResponseAttributes' + id: + description: The unique identifier of the execution + example: execution-123 + type: string + type: + $ref: '#/components/schemas/WorkflowWebhookExecutionResponseType' + required: + - type + - id + - attributes + type: object + WorkflowWebhookExecutionResponseType: + description: The type for workflow webhook execution response + enum: + - workflow_webhook_execution + example: workflow_webhook_execution + type: string + x-enum-varnames: + - WORKFLOW_WEBHOOK_EXECUTION + WorkflowWebhookPayload: + additionalProperties: {} + description: GitHub webhook payload + example: + foo: bar + type: object WorklflowCancelInstanceResponse: description: Information about the canceled instance. properties: @@ -102407,6 +102622,72 @@ paths: operator: OR permissions: - teams_read + /api/v2/workflow_headless/{parent_id}/instances: + post: + description: 'Execute a headless workflow instance from a template. This endpoint + creates and executes + + a workflow instance based on a template configuration. + + + **Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + operationId: ExecuteWorkflowFromTemplate + parameters: + - $ref: '#/components/parameters/ParentId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowHeadlessExecutionRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowHeadlessExecutionResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Execute a workflow from a template + tags: + - Workflow Automation + x-permission: + operator: OR + permissions: + - connections_resolve + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/workflows: post: description: Create a new workflow, returning the workflow ID. This API requires @@ -102583,6 +102864,60 @@ paths: operator: OR permissions: - workflows_write + /api/v2/workflows/{workflow_id}/favorite: + put: + description: 'Mark a workflow as favorite or unfavorite for the authenticated + user. + + + **Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + operationId: UpdateWorkflowFavorite + parameters: + - $ref: '#/components/parameters/WorkflowId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowFavoriteRequest' + required: true + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update workflow favorite status + tags: + - Workflow Automation + x-permission: + operator: OR + permissions: + - workflows_read + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/workflows/{workflow_id}/instances: get: description: List all instances of a given workflow. This API requires a [registered @@ -102724,6 +103059,96 @@ paths: operator: OR permissions: - workflows_run + /api/v2/workflows/{workflow_id}/webhook: + post: + description: 'Execute a workflow triggered by a GitHub webhook. This endpoint + validates the GitHub webhook signature + + and the GitHub user agent before executing the workflow. + + + This endpoint requires: + + - Valid GitHub webhook signature in the X-Hub-Signature-256 header + + - GitHub user agent in the User-Agent header + + - Valid organization ID in the orgId query parameter + + - Valid workflow ID in the path + + + **Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + operationId: ExecuteWorkflowFromWebhook + parameters: + - $ref: '#/components/parameters/WorkflowId' + - $ref: '#/components/parameters/OrgIdQuery' + - description: GitHub webhook signature for payload validation + in: header + name: X-Hub-Signature-256 + required: true + schema: + example: sha256=abcdef123456... + type: string + - description: Must start with "GitHub-Hookshot/" + in: header + name: User-Agent + required: true + schema: + example: GitHub-Hookshot/abc123 + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowWebhookPayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowWebhookExecutionResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + summary: Execute a workflow from a webhook + tags: + - Workflow Automation + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - connections_resolve + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' security: - apiKeyAuth: [] appKeyAuth: [] diff --git a/examples/v2/workflow-automation/ExecuteWorkflowFromTemplate.rb b/examples/v2/workflow-automation/ExecuteWorkflowFromTemplate.rb new file mode 100644 index 000000000000..5696315dbc4c --- /dev/null +++ b/examples/v2/workflow-automation/ExecuteWorkflowFromTemplate.rb @@ -0,0 +1,27 @@ +# Execute a workflow from a template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.execute_workflow_from_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new + +body = DatadogAPIClient::V2::WorkflowHeadlessExecutionRequest.new({ + data: DatadogAPIClient::V2::WorkflowHeadlessExecutionRequestData.new({ + attributes: DatadogAPIClient::V2::WorkflowHeadlessExecutionRequestAttributes.new({ + config: DatadogAPIClient::V2::WorkflowHeadlessExecutionConfig.new({ + connections: [ + DatadogAPIClient::V2::WorkflowHeadlessExecutionConnection.new({ + connection_id: "11111111-1111-1111-1111-111111111111", + label: "INTEGRATION_DATADOG", + }), + ], + inputs: {}, + }), + template_id: "template-789", + }), + id: "1234", + type: DatadogAPIClient::V2::WorkflowHeadlessExecutionRequestType::WORKFLOW_HEADLESS_EXECUTION_REQUEST, + }), +}) +p api_instance.execute_workflow_from_template("parent_id", body) diff --git a/examples/v2/workflow-automation/ExecuteWorkflowFromWebhook.rb b/examples/v2/workflow-automation/ExecuteWorkflowFromWebhook.rb new file mode 100644 index 000000000000..25778ccd7e29 --- /dev/null +++ b/examples/v2/workflow-automation/ExecuteWorkflowFromWebhook.rb @@ -0,0 +1,10 @@ +# Execute a workflow from a webhook returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.execute_workflow_from_webhook".to_sym] = true +end +api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new + +body = DatadogAPIClient::V2::WorkflowWebhookPayload.new({}) +p api_instance.execute_workflow_from_webhook("workflow_id", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "sha256=abcdef123456...", "GitHub-Hookshot/abc123", body) diff --git a/examples/v2/workflow-automation/UpdateWorkflowFavorite.rb b/examples/v2/workflow-automation/UpdateWorkflowFavorite.rb new file mode 100644 index 000000000000..f8ecd921128d --- /dev/null +++ b/examples/v2/workflow-automation/UpdateWorkflowFavorite.rb @@ -0,0 +1,17 @@ +# Update workflow favorite status returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_workflow_favorite".to_sym] = true +end +api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new + +body = DatadogAPIClient::V2::WorkflowFavoriteRequest.new({ + data: DatadogAPIClient::V2::WorkflowFavoriteRequestData.new({ + attributes: DatadogAPIClient::V2::WorkflowFavoriteRequestAttributes.new({ + favorite: true, + }), + type: DatadogAPIClient::V2::WorkflowFavoriteRequestType::WORKFLOW_FAVORITE_REQUEST, + }), +}) +api_instance.update_workflow_favorite("workflow_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 833c51686656..5da4c31c05ed 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3837,6 +3837,10 @@ "v2.ListUserPermissions" => { "user_id" => "String", }, + "v2.ExecuteWorkflowFromTemplate" => { + "parent_id" => "String", + "body" => "WorkflowHeadlessExecutionRequest", + }, "v2.CreateWorkflow" => { "body" => "CreateWorkflowRequest", }, @@ -3850,6 +3854,10 @@ "workflow_id" => "String", "body" => "UpdateWorkflowRequest", }, + "v2.UpdateWorkflowFavorite" => { + "workflow_id" => "String", + "body" => "WorkflowFavoriteRequest", + }, "v2.ListWorkflowInstances" => { "workflow_id" => "String", "page_size" => "Integer", @@ -3867,4 +3875,11 @@ "workflow_id" => "String", "instance_id" => "String", }, + "v2.ExecuteWorkflowFromWebhook" => { + "workflow_id" => "String", + "org_id" => "UUID", + "x_hub_signature_256" => "String", + "user_agent" => "String", + "body" => "Hash", + }, } \ No newline at end of file diff --git a/features/v2/undo.json b/features/v2/undo.json index c77dfee33568..5a234c77935c 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5737,6 +5737,12 @@ "type": "safe" } }, + "ExecuteWorkflowFromTemplate": { + "tag": "Workflow Automation", + "undo": { + "type": "safe" + } + }, "CreateWorkflow": { "tag": "Workflow Automation", "undo": { @@ -5768,6 +5774,12 @@ "type": "idempotent" } }, + "UpdateWorkflowFavorite": { + "tag": "Workflow Automation", + "undo": { + "type": "idempotent" + } + }, "ListWorkflowInstances": { "tag": "Workflow Automation", "undo": { @@ -5791,5 +5803,11 @@ "undo": { "type": "safe" } + }, + "ExecuteWorkflowFromWebhook": { + "tag": "Workflow Automation", + "undo": { + "type": "safe" + } } } diff --git a/features/v2/workflow_automation.feature b/features/v2/workflow_automation.feature index df51d5013900..4c43c191d374 100644 --- a/features/v2/workflow_automation.feature +++ b/features/v2/workflow_automation.feature @@ -66,6 +66,69 @@ Feature: Workflow Automation When the request is sent Then the response status is 204 Successfully deleted a workflow. + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Execute a workflow from a template returns "Bad Request" response + Given operation "ExecuteWorkflowFromTemplate" enabled + And new "ExecuteWorkflowFromTemplate" request + And request contains "parent_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"connections": [{"connection_id": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "inputs": {}}, "template_id": "template-789"}, "id": "1234", "type": "workflow_headless_execution_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Execute a workflow from a template returns "Not Found" response + Given operation "ExecuteWorkflowFromTemplate" enabled + And new "ExecuteWorkflowFromTemplate" request + And request contains "parent_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"connections": [{"connection_id": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "inputs": {}}, "template_id": "template-789"}, "id": "1234", "type": "workflow_headless_execution_request"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Execute a workflow from a template returns "OK" response + Given operation "ExecuteWorkflowFromTemplate" enabled + And new "ExecuteWorkflowFromTemplate" request + And request contains "parent_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"connections": [{"connection_id": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "inputs": {}}, "template_id": "template-789"}, "id": "1234", "type": "workflow_headless_execution_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Execute a workflow from a webhook returns "Bad Request" response + Given operation "ExecuteWorkflowFromWebhook" enabled + And new "ExecuteWorkflowFromWebhook" request + And request contains "workflow_id" parameter from "REPLACE.ME" + And request contains "orgId" parameter from "REPLACE.ME" + And request contains "X-Hub-Signature-256" parameter from "REPLACE.ME" + And request contains "User-Agent" parameter from "REPLACE.ME" + And body with value {"foo": "bar"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Execute a workflow from a webhook returns "Not Found" response + Given operation "ExecuteWorkflowFromWebhook" enabled + And new "ExecuteWorkflowFromWebhook" request + And request contains "workflow_id" parameter from "REPLACE.ME" + And request contains "orgId" parameter from "REPLACE.ME" + And request contains "X-Hub-Signature-256" parameter from "REPLACE.ME" + And request contains "User-Agent" parameter from "REPLACE.ME" + And body with value {"foo": "bar"} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Execute a workflow from a webhook returns "OK" response + Given operation "ExecuteWorkflowFromWebhook" enabled + And new "ExecuteWorkflowFromWebhook" request + And request contains "workflow_id" parameter from "REPLACE.ME" + And request contains "orgId" parameter from "REPLACE.ME" + And request contains "X-Hub-Signature-256" parameter from "REPLACE.ME" + And request contains "User-Agent" parameter from "REPLACE.ME" + And body with value {"foo": "bar"} + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/workflow-automation-dev Scenario: Execute a workflow returns "Bad Request" response Given new "CreateWorkflowInstance" request @@ -167,3 +230,30 @@ Feature: Workflow Automation And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}} When the request is sent Then the response status is 200 Successfully updated a workflow. + + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Update workflow favorite status returns "Bad Request" response + Given operation "UpdateWorkflowFavorite" enabled + And new "UpdateWorkflowFavorite" request + And request contains "workflow_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"favorite": true}, "type": "workflow_favorite_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Update workflow favorite status returns "No Content" response + Given operation "UpdateWorkflowFavorite" enabled + And new "UpdateWorkflowFavorite" request + And request contains "workflow_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"favorite": true}, "type": "workflow_favorite_request"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: Update workflow favorite status returns "Not Found" response + Given operation "UpdateWorkflowFavorite" enabled + And new "UpdateWorkflowFavorite" request + And request contains "workflow_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"favorite": true}, "type": "workflow_favorite_request"}} + When the request is sent + Then the response status is 404 Not Found diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index f51747c826ed..900131b95b53 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -384,6 +384,9 @@ def initialize "v2.update_incident_team": false, "v2.search_flaky_tests": false, "v2.update_flaky_tests": false, + "v2.execute_workflow_from_template": false, + "v2.execute_workflow_from_webhook": false, + "v2.update_workflow_favorite": false, } @server_variables[:site] = ENV['DD_SITE'] if ENV.key? 'DD_SITE' @api_key['apiKeyAuth'] = ENV['DD_API_KEY'] if ENV.key? 'DD_API_KEY' diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5e43080ff1dc..82a74007828e 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5188,6 +5188,20 @@ def overrides "v2.workflow_data_type" => "WorkflowDataType", "v2.workflow_data_update" => "WorkflowDataUpdate", "v2.workflow_data_update_attributes" => "WorkflowDataUpdateAttributes", + "v2.workflow_favorite_request" => "WorkflowFavoriteRequest", + "v2.workflow_favorite_request_attributes" => "WorkflowFavoriteRequestAttributes", + "v2.workflow_favorite_request_data" => "WorkflowFavoriteRequestData", + "v2.workflow_favorite_request_type" => "WorkflowFavoriteRequestType", + "v2.workflow_headless_execution_config" => "WorkflowHeadlessExecutionConfig", + "v2.workflow_headless_execution_connection" => "WorkflowHeadlessExecutionConnection", + "v2.workflow_headless_execution_request" => "WorkflowHeadlessExecutionRequest", + "v2.workflow_headless_execution_request_attributes" => "WorkflowHeadlessExecutionRequestAttributes", + "v2.workflow_headless_execution_request_data" => "WorkflowHeadlessExecutionRequestData", + "v2.workflow_headless_execution_request_type" => "WorkflowHeadlessExecutionRequestType", + "v2.workflow_headless_execution_response" => "WorkflowHeadlessExecutionResponse", + "v2.workflow_headless_execution_response_attributes" => "WorkflowHeadlessExecutionResponseAttributes", + "v2.workflow_headless_execution_response_data" => "WorkflowHeadlessExecutionResponseData", + "v2.workflow_headless_execution_response_type" => "WorkflowHeadlessExecutionResponseType", "v2.workflow_instance_create_meta" => "WorkflowInstanceCreateMeta", "v2.workflow_instance_create_request" => "WorkflowInstanceCreateRequest", "v2.workflow_instance_create_response" => "WorkflowInstanceCreateResponse", @@ -5200,6 +5214,10 @@ def overrides "v2.workflow_user_relationship" => "WorkflowUserRelationship", "v2.workflow_user_relationship_data" => "WorkflowUserRelationshipData", "v2.workflow_user_relationship_type" => "WorkflowUserRelationshipType", + "v2.workflow_webhook_execution_response" => "WorkflowWebhookExecutionResponse", + "v2.workflow_webhook_execution_response_attributes" => "WorkflowWebhookExecutionResponseAttributes", + "v2.workflow_webhook_execution_response_data" => "WorkflowWebhookExecutionResponseData", + "v2.workflow_webhook_execution_response_type" => "WorkflowWebhookExecutionResponseType", "v2.worklflow_cancel_instance_response" => "WorklflowCancelInstanceResponse", "v2.worklflow_cancel_instance_response_data" => "WorklflowCancelInstanceResponseData", "v2.worklflow_get_instance_response" => "WorklflowGetInstanceResponse", diff --git a/lib/datadog_api_client/v2/api/workflow_automation_api.rb b/lib/datadog_api_client/v2/api/workflow_automation_api.rb index acddc865b970..c9dfe004333a 100644 --- a/lib/datadog_api_client/v2/api/workflow_automation_api.rb +++ b/lib/datadog_api_client/v2/api/workflow_automation_api.rb @@ -297,6 +297,194 @@ def delete_workflow_with_http_info(workflow_id, opts = {}) return data, status_code, headers end + # Execute a workflow from a template. + # + # @see #execute_workflow_from_template_with_http_info + def execute_workflow_from_template(parent_id, body, opts = {}) + data, _status_code, _headers = execute_workflow_from_template_with_http_info(parent_id, body, opts) + data + end + + # Execute a workflow from a template. + # + # Execute a headless workflow instance from a template. This endpoint creates and executes + # a workflow instance based on a template configuration. + # + # **Note**: This endpoint is in public beta and is subject to change. + # If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + # + # @param parent_id [String] The ID of the parent workflow + # @param body [WorkflowHeadlessExecutionRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(WorkflowHeadlessExecutionResponse, Integer, Hash)>] WorkflowHeadlessExecutionResponse data, response status code and response headers + def execute_workflow_from_template_with_http_info(parent_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.execute_workflow_from_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.execute_workflow_from_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.execute_workflow_from_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowAutomationAPI.execute_workflow_from_template ...' + end + # verify the required parameter 'parent_id' is set + if @api_client.config.client_side_validation && parent_id.nil? + fail ArgumentError, "Missing the required parameter 'parent_id' when calling WorkflowAutomationAPI.execute_workflow_from_template" + 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 WorkflowAutomationAPI.execute_workflow_from_template" + end + # resource path + local_var_path = '/api/v2/workflow_headless/{parent_id}/instances'.sub('{parent_id}', CGI.escape(parent_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] || 'WorkflowHeadlessExecutionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :execute_workflow_from_template, + :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: WorkflowAutomationAPI#execute_workflow_from_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Execute a workflow from a webhook. + # + # @see #execute_workflow_from_webhook_with_http_info + def execute_workflow_from_webhook(workflow_id, org_id, x_hub_signature_256, user_agent, body, opts = {}) + data, _status_code, _headers = execute_workflow_from_webhook_with_http_info(workflow_id, org_id, x_hub_signature_256, user_agent, body, opts) + data + end + + # Execute a workflow from a webhook. + # + # Execute a workflow triggered by a GitHub webhook. This endpoint validates the GitHub webhook signature + # and the GitHub user agent before executing the workflow. + # + # This endpoint requires: + # - Valid GitHub webhook signature in the X-Hub-Signature-256 header + # - GitHub user agent in the User-Agent header + # - Valid organization ID in the orgId query parameter + # - Valid workflow ID in the path + # + # **Note**: This endpoint is in public beta and is subject to change. + # If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + # + # @param workflow_id [String] The ID of the workflow. + # @param org_id [UUID] The organization ID + # @param x_hub_signature_256 [String] GitHub webhook signature for payload validation + # @param user_agent [String] Must start with "GitHub-Hookshot/" + # @param body [Hash] + # @param opts [Hash] the optional parameters + # @return [Array<(WorkflowWebhookExecutionResponse, Integer, Hash)>] WorkflowWebhookExecutionResponse data, response status code and response headers + def execute_workflow_from_webhook_with_http_info(workflow_id, org_id, x_hub_signature_256, user_agent, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.execute_workflow_from_webhook".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.execute_workflow_from_webhook") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.execute_workflow_from_webhook")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowAutomationAPI.execute_workflow_from_webhook ...' + end + # verify the required parameter 'workflow_id' is set + if @api_client.config.client_side_validation && workflow_id.nil? + fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowAutomationAPI.execute_workflow_from_webhook" + end + # verify the required parameter 'org_id' is set + if @api_client.config.client_side_validation && org_id.nil? + fail ArgumentError, "Missing the required parameter 'org_id' when calling WorkflowAutomationAPI.execute_workflow_from_webhook" + end + # verify the required parameter 'x_hub_signature_256' is set + if @api_client.config.client_side_validation && x_hub_signature_256.nil? + fail ArgumentError, "Missing the required parameter 'x_hub_signature_256' when calling WorkflowAutomationAPI.execute_workflow_from_webhook" + end + # verify the required parameter 'user_agent' is set + if @api_client.config.client_side_validation && user_agent.nil? + fail ArgumentError, "Missing the required parameter 'user_agent' when calling WorkflowAutomationAPI.execute_workflow_from_webhook" + 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 WorkflowAutomationAPI.execute_workflow_from_webhook" + end + # resource path + local_var_path = '/api/v2/workflows/{workflow_id}/webhook'.sub('{workflow_id}', CGI.escape(workflow_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'orgId'] = org_id + + # 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']) + header_params['X-Hub-Signature-256'] = x_hub_signature_256 + header_params['User-Agent'] = user_agent + + # 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] || 'WorkflowWebhookExecutionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :execute_workflow_from_webhook, + :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: WorkflowAutomationAPI#execute_workflow_from_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get an existing Workflow. # # @see #get_workflow_with_http_info @@ -572,5 +760,86 @@ def update_workflow_with_http_info(workflow_id, body, opts = {}) end return data, status_code, headers end + + # Update workflow favorite status. + # + # @see #update_workflow_favorite_with_http_info + def update_workflow_favorite(workflow_id, body, opts = {}) + update_workflow_favorite_with_http_info(workflow_id, body, opts) + nil + end + + # Update workflow favorite status. + # + # Mark a workflow as favorite or unfavorite for the authenticated user. + # + # **Note**: This endpoint is in public beta and is subject to change. + # If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + # + # @param workflow_id [String] The ID of the workflow. + # @param body [WorkflowFavoriteRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_workflow_favorite_with_http_info(workflow_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_workflow_favorite".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_workflow_favorite") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_workflow_favorite")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowAutomationAPI.update_workflow_favorite ...' + end + # verify the required parameter 'workflow_id' is set + if @api_client.config.client_side_validation && workflow_id.nil? + fail ArgumentError, "Missing the required parameter 'workflow_id' when calling WorkflowAutomationAPI.update_workflow_favorite" + 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 WorkflowAutomationAPI.update_workflow_favorite" + end + # resource path + local_var_path = '/api/v2/workflows/{workflow_id}/favorite'.sub('{workflow_id}', CGI.escape(workflow_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(['*/*']) + # 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] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_workflow_favorite, + :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::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowAutomationAPI#update_workflow_favorite\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/workflow_favorite_request.rb b/lib/datadog_api_client/v2/models/workflow_favorite_request.rb new file mode 100644 index 000000000000..9ba59657255d --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_favorite_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 + # + class WorkflowFavoriteRequest + 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' => :'WorkflowFavoriteRequestData' + } + 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::WorkflowFavoriteRequest` 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/workflow_favorite_request_attributes.rb b/lib/datadog_api_client/v2/models/workflow_favorite_request_attributes.rb new file mode 100644 index 000000000000..f9113a14a711 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_favorite_request_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 WorkflowFavoriteRequestAttributes + include BaseGenericModel + + # Whether to mark the workflow as favorite (true) or unfavorite (false) + attr_reader :favorite + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'favorite' => :'favorite' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'favorite' => :'Boolean' + } + 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::WorkflowFavoriteRequestAttributes` 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?(:'favorite') + self.favorite = attributes[:'favorite'] + 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 @favorite.nil? + true + end + + # Custom attribute writer method with validation + # @param favorite [Object] Object to be assigned + # @!visibility private + def favorite=(favorite) + if favorite.nil? + fail ArgumentError, 'invalid value for "favorite", favorite cannot be nil.' + end + @favorite = favorite + 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 && + favorite == o.favorite && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [favorite, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_favorite_request_data.rb b/lib/datadog_api_client/v2/models/workflow_favorite_request_data.rb new file mode 100644 index 000000000000..6187dd7e0ea7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_favorite_request_data.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 WorkflowFavoriteRequestData + include BaseGenericModel + + # + attr_reader :attributes + + # The type for workflow favorite request + 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' => :'WorkflowFavoriteRequestAttributes', + :'type' => :'WorkflowFavoriteRequestType' + } + 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::WorkflowFavoriteRequestData` 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/workflow_favorite_request_type.rb b/lib/datadog_api_client/v2/models/workflow_favorite_request_type.rb new file mode 100644 index 000000000000..862343f42e15 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_favorite_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type for workflow favorite request + class WorkflowFavoriteRequestType + include BaseEnumModel + + WORKFLOW_FAVORITE_REQUEST = "workflow_favorite_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_headless_execution_config.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_config.rb new file mode 100644 index 000000000000..a1037cdef393 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_config.rb @@ -0,0 +1,146 @@ +=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 WorkflowHeadlessExecutionConfig + include BaseGenericModel + + # List of connections to use for the workflow execution + attr_reader :connections + + # Input parameters for the workflow execution + attr_reader :inputs + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'connections' => :'connections', + :'inputs' => :'inputs' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'connections' => :'Array', + :'inputs' => :'Hash' + } + 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::WorkflowHeadlessExecutionConfig` 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?(:'connections') + if (value = attributes[:'connections']).is_a?(Array) + self.connections = value + end + end + + if attributes.key?(:'inputs') + self.inputs = attributes[:'inputs'] + 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 @connections.nil? + return false if @inputs.nil? + true + end + + # Custom attribute writer method with validation + # @param connections [Object] Object to be assigned + # @!visibility private + def connections=(connections) + if connections.nil? + fail ArgumentError, 'invalid value for "connections", connections cannot be nil.' + end + @connections = connections + end + + # Custom attribute writer method with validation + # @param inputs [Object] Object to be assigned + # @!visibility private + def inputs=(inputs) + if inputs.nil? + fail ArgumentError, 'invalid value for "inputs", inputs cannot be nil.' + end + @inputs = inputs + 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 && + connections == o.connections && + inputs == o.inputs && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [connections, inputs, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_headless_execution_connection.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_connection.rb new file mode 100644 index 000000000000..0ede97a3f0f8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_connection.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 WorkflowHeadlessExecutionConnection + include BaseGenericModel + + # The ID of the connection + attr_reader :connection_id + + # The label for the connection + attr_reader :label + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'connection_id' => :'connection_id', + :'label' => :'label' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'connection_id' => :'UUID', + :'label' => :'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::WorkflowHeadlessExecutionConnection` 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?(:'connection_id') + self.connection_id = attributes[:'connection_id'] + end + + if attributes.key?(:'label') + self.label = attributes[:'label'] + 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 @connection_id.nil? + return false if @label.nil? + true + end + + # Custom attribute writer method with validation + # @param connection_id [Object] Object to be assigned + # @!visibility private + def connection_id=(connection_id) + if connection_id.nil? + fail ArgumentError, 'invalid value for "connection_id", connection_id cannot be nil.' + end + @connection_id = connection_id + end + + # Custom attribute writer method with validation + # @param label [Object] Object to be assigned + # @!visibility private + def label=(label) + if label.nil? + fail ArgumentError, 'invalid value for "label", label cannot be nil.' + end + @label = label + 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 && + connection_id == o.connection_id && + label == o.label && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [connection_id, label, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_headless_execution_request.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_request.rb new file mode 100644 index 000000000000..355ad7227f43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_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 + # + class WorkflowHeadlessExecutionRequest + 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' => :'WorkflowHeadlessExecutionRequestData' + } + 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::WorkflowHeadlessExecutionRequest` 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/workflow_headless_execution_request_attributes.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_request_attributes.rb new file mode 100644 index 000000000000..1e71175484e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_request_attributes.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 WorkflowHeadlessExecutionRequestAttributes + include BaseGenericModel + + # + attr_reader :config + + # The ID of the workflow template to execute + attr_reader :template_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'config' => :'config', + :'template_id' => :'template_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'config' => :'WorkflowHeadlessExecutionConfig', + :'template_id' => :'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::WorkflowHeadlessExecutionRequestAttributes` 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?(:'config') + self.config = attributes[:'config'] + end + + if attributes.key?(:'template_id') + self.template_id = attributes[:'template_id'] + 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 @config.nil? + return false if @template_id.nil? + true + end + + # Custom attribute writer method with validation + # @param config [Object] Object to be assigned + # @!visibility private + def config=(config) + if config.nil? + fail ArgumentError, 'invalid value for "config", config cannot be nil.' + end + @config = config + end + + # Custom attribute writer method with validation + # @param template_id [Object] Object to be assigned + # @!visibility private + def template_id=(template_id) + if template_id.nil? + fail ArgumentError, 'invalid value for "template_id", template_id cannot be nil.' + end + @template_id = template_id + 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 && + config == o.config && + template_id == o.template_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [config, template_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_headless_execution_request_data.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_request_data.rb new file mode 100644 index 000000000000..2d903d7eefd0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_request_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class WorkflowHeadlessExecutionRequestData + include BaseGenericModel + + # + attr_reader :attributes + + # The ID of the parent workflow + attr_reader :id + + # The type for workflow headless execution request + 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' => :'WorkflowHeadlessExecutionRequestAttributes', + :'id' => :'String', + :'type' => :'WorkflowHeadlessExecutionRequestType' + } + 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::WorkflowHeadlessExecutionRequestData` 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/workflow_headless_execution_request_type.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_request_type.rb new file mode 100644 index 000000000000..c5b98d895a3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type for workflow headless execution request + class WorkflowHeadlessExecutionRequestType + include BaseEnumModel + + WORKFLOW_HEADLESS_EXECUTION_REQUEST = "workflow_headless_execution_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_headless_execution_response.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_response.rb new file mode 100644 index 000000000000..923e5459e4b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_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 + # + class WorkflowHeadlessExecutionResponse + 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' => :'WorkflowHeadlessExecutionResponseData' + } + 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::WorkflowHeadlessExecutionResponse` 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/workflow_headless_execution_response_attributes.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_response_attributes.rb new file mode 100644 index 000000000000..f181be742f00 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_response_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 WorkflowHeadlessExecutionResponseAttributes + include BaseGenericModel + + # The ID of the workflow instance that was created + attr_reader :instance_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'instance_id' => :'instance_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'instance_id' => :'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::WorkflowHeadlessExecutionResponseAttributes` 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?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + 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 @instance_id.nil? + true + end + + # Custom attribute writer method with validation + # @param instance_id [Object] Object to be assigned + # @!visibility private + def instance_id=(instance_id) + if instance_id.nil? + fail ArgumentError, 'invalid value for "instance_id", instance_id cannot be nil.' + end + @instance_id = instance_id + 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 && + instance_id == o.instance_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [instance_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_headless_execution_response_data.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_response_data.rb new file mode 100644 index 000000000000..8b26103c89d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class WorkflowHeadlessExecutionResponseData + include BaseGenericModel + + # + attr_reader :attributes + + # The ID of the parent workflow + attr_reader :id + + # The type for workflow headless execution response + 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' => :'WorkflowHeadlessExecutionResponseAttributes', + :'id' => :'String', + :'type' => :'WorkflowHeadlessExecutionResponseType' + } + 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::WorkflowHeadlessExecutionResponseData` 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/workflow_headless_execution_response_type.rb b/lib/datadog_api_client/v2/models/workflow_headless_execution_response_type.rb new file mode 100644 index 000000000000..8f30d8d9e49a --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_headless_execution_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type for workflow headless execution response + class WorkflowHeadlessExecutionResponseType + include BaseEnumModel + + WORKFLOW_HEADLESS_EXECUTION = "workflow_headless_execution".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_webhook_execution_response.rb b/lib/datadog_api_client/v2/models/workflow_webhook_execution_response.rb new file mode 100644 index 000000000000..1263ef5618eb --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_webhook_execution_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 + # + class WorkflowWebhookExecutionResponse + 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' => :'WorkflowWebhookExecutionResponseData' + } + 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::WorkflowWebhookExecutionResponse` 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/workflow_webhook_execution_response_attributes.rb b/lib/datadog_api_client/v2/models/workflow_webhook_execution_response_attributes.rb new file mode 100644 index 000000000000..1003435d0656 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_webhook_execution_response_attributes.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 WorkflowWebhookExecutionResponseAttributes + include BaseGenericModel + + # The ID of the workflow instance that was created + attr_reader :instance_id + + # The ID of the workflow that was executed + attr_reader :workflow_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'instance_id' => :'instance_id', + :'workflow_id' => :'workflow_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'instance_id' => :'UUID', + :'workflow_id' => :'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::WorkflowWebhookExecutionResponseAttributes` 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?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + end + + if attributes.key?(:'workflow_id') + self.workflow_id = attributes[:'workflow_id'] + 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 @instance_id.nil? + return false if @workflow_id.nil? + true + end + + # Custom attribute writer method with validation + # @param instance_id [Object] Object to be assigned + # @!visibility private + def instance_id=(instance_id) + if instance_id.nil? + fail ArgumentError, 'invalid value for "instance_id", instance_id cannot be nil.' + end + @instance_id = instance_id + end + + # Custom attribute writer method with validation + # @param workflow_id [Object] Object to be assigned + # @!visibility private + def workflow_id=(workflow_id) + if workflow_id.nil? + fail ArgumentError, 'invalid value for "workflow_id", workflow_id cannot be nil.' + end + @workflow_id = workflow_id + 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 && + instance_id == o.instance_id && + workflow_id == o.workflow_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [instance_id, workflow_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_webhook_execution_response_data.rb b/lib/datadog_api_client/v2/models/workflow_webhook_execution_response_data.rb new file mode 100644 index 000000000000..5df1e29f25c7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_webhook_execution_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class WorkflowWebhookExecutionResponseData + include BaseGenericModel + + # + attr_reader :attributes + + # The unique identifier of the execution + attr_reader :id + + # The type for workflow webhook execution response + 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' => :'WorkflowWebhookExecutionResponseAttributes', + :'id' => :'String', + :'type' => :'WorkflowWebhookExecutionResponseType' + } + 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::WorkflowWebhookExecutionResponseData` 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/workflow_webhook_execution_response_type.rb b/lib/datadog_api_client/v2/models/workflow_webhook_execution_response_type.rb new file mode 100644 index 000000000000..795e9d42f00d --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_webhook_execution_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type for workflow webhook execution response + class WorkflowWebhookExecutionResponseType + include BaseEnumModel + + WORKFLOW_WEBHOOK_EXECUTION = "workflow_webhook_execution".freeze + end +end