diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b536eb592f6e..358c8be5e3cf 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -50104,6 +50104,35 @@ components: required: - data type: object + ListWorkflowsResponse: + description: The response object after listing workflows. + properties: + data: + description: A list of workflows. + items: + $ref: "#/components/schemas/WorkflowListItem" + type: array + meta: + $ref: "#/components/schemas/ListWorkflowsResponseMeta" + type: object + ListWorkflowsResponseMeta: + description: Metadata about the list workflows response. + properties: + page: + $ref: "#/components/schemas/ListWorkflowsResponseMetaPage" + type: object + ListWorkflowsResponseMetaPage: + description: Page information for the list workflows response. + properties: + totalCount: + description: The total number of workflows. + format: int64 + type: integer + totalFilteredCount: + description: The total number of workflows matching the applied filters. + format: int64 + type: integer + type: object Log: description: Object description of a log after being processed and stored by Datadog. properties: @@ -96465,6 +96494,58 @@ components: format: int64 type: integer type: object + WorkflowListItem: + description: A workflow returned by the list workflows endpoint. + properties: + attributes: + $ref: "#/components/schemas/WorkflowListItemAttributes" + id: + description: The workflow identifier + readOnly: true + type: string + relationships: + $ref: "#/components/schemas/WorkflowDataRelationships" + type: + $ref: "#/components/schemas/WorkflowDataType" + required: + - type + - attributes + type: object + WorkflowListItemAttributes: + description: The definition of `WorkflowListItemAttributes` object. + properties: + createdAt: + description: When the workflow was created. + format: date-time + readOnly: true + type: string + description: + description: Description of the workflow. + type: string + name: + description: Name of the workflow. + example: "" + type: string + published: + description: Set the workflow to published or unpublished. Workflows in an unpublished state will only be executable via manual runs. Automatic triggers such as Schedule will not execute the workflow until it is published. + type: boolean + spec: + $ref: "#/components/schemas/Spec" + nullable: true + tags: + description: Tags of the workflow. + items: + description: A tag string in `key:value` format. + type: string + type: array + updatedAt: + description: When the workflow was last updated. + format: date-time + readOnly: true + type: string + required: + - name + type: object WorkflowTriggerWrapper: description: "Schema for a Workflow-based trigger." properties: @@ -170668,6 +170749,120 @@ paths: - manage_log_reports - product_analytics_saved_widgets_write /api/v2/workflows: + get: + description: List all workflows in your organization. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). + operationId: ListWorkflows + parameters: + - description: The maximum number of workflows to return per page. + example: 50 + in: query + name: limit + required: false + schema: + default: 50 + format: int64 + type: integer + - description: The page number to return, starting from 0. + example: 0 + in: query + name: page + required: false + schema: + default: 0 + format: int64 + type: integer + - description: "The sort order for the returned workflows. Provide a comma-separated list of fields, each optionally prefixed with `-` for descending order. Supported fields are `name`, `createdAt`, `updatedAt`, `creatorName`, `ownerName`, and `lastExecutedAt`." + example: "-updatedAt" + in: query + name: sort + required: false + schema: + type: string + - description: "A search query used to filter the returned workflows. The query performs a case-insensitive substring match against each workflow's name, creator name, and handle. If the query contains a colon (for example, `team:infra`), it is instead treated as a `key:value` tag filter." + example: deploy + in: query + name: filter[query] + required: false + schema: + type: string + - description: Filter the returned workflows by one or more trigger types, such as `monitor`, `schedule`, or `githubWebhook`. Repeat the parameter to filter by multiple trigger types. + example: + - monitor + explode: true + in: query + name: filter[triggerType] + required: false + schema: + items: + type: string + type: array + - description: Whether to include unpublished workflows in the response. + in: query + name: filter[includeUnpublished] + required: false + schema: + default: false + type: boolean + - description: Whether to include the full spec of each workflow in the response. When `false` (the default), each workflow's `spec` is returned as `null`. + in: query + name: filter[includeSpecs] + required: false + schema: + default: false + type: boolean + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + createdAt: "2024-01-01T00:00:00+00:00" + description: A sample workflow. + name: Example Workflow + published: true + spec: {} + tags: + - team:infra + updatedAt: "2024-01-01T00:00:00+00:00" + id: 00000000-0000-0000-0000-000000000002 + relationships: + creator: + data: + id: 00000000-0000-0000-0000-000000000009 + type: users + owner: + data: + id: 00000000-0000-0000-0000-000000000009 + type: users + type: workflows + meta: + page: + totalCount: 1 + totalFilteredCount: 1 + schema: + $ref: "#/components/schemas/ListWorkflowsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List workflows + tags: + - Workflow Automation + x-pagination: + limitParam: limit + pageParam: page + pageStart: 0 + resultsPath: data + "x-permission": + operator: OR + permissions: + - workflows_read post: description: Create a new workflow, returning the workflow ID. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). operationId: CreateWorkflow diff --git a/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response-with-pagination.frozen b/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response-with-pagination.frozen new file mode 100644 index 000000000000..9c4802e3e5f1 --- /dev/null +++ b/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response-with-pagination.frozen @@ -0,0 +1 @@ +2026-06-01T21:52:42.662Z \ No newline at end of file diff --git a/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response-with-pagination.yml b/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response-with-pagination.yml new file mode 100644 index 000000000000..ffbdbda037c4 --- /dev/null +++ b/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response-with-pagination.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 01 Jun 2026 21:52:42 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/workflows?filter%5Bquery%5D=Test-List_workflows_returns_OK_response_with_pagination-1780350762&limit=2&page=0 + response: + body: + encoding: UTF-8 + string: '{"data":[],"meta":{"page":{"totalCount":547,"totalFilteredCount":0}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response.frozen b/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response.frozen new file mode 100644 index 000000000000..efce7c49296e --- /dev/null +++ b/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-01T20:36:33.245Z \ No newline at end of file diff --git a/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response.yml b/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response.yml new file mode 100644 index 000000000000..e4c157013ce9 --- /dev/null +++ b/cassettes/features/v2/workflow_automation/List-workflows-returns-OK-response.yml @@ -0,0 +1,109 @@ +http_interactions: +- recorded_at: Mon, 01 Jun 2026 20:36:33 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Cassette Workflow x-given","spec":{"steps":[{"actionId":"com.datadoghq.core.noop","name":"No_op"}],"triggers":[{"startStepNames":["No_op"],"workflowTrigger":{}}]}},"type":"workflows"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/workflows + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"72ea47e5-3bf2-41a2-bf7b-1857908234b6","type":"workflows","attributes":{"createdAt":"2026-06-01T20:36:33.514948Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":{"triggers":[{"startStepNames":["No_op"],"workflowTrigger":{}}],"steps":[{"name":"No_op","actionId":"com.datadoghq.core.noop"}]},"tags":[],"updatedAt":"2026-06-01T20:36:33.514948Z"},"relationships":{"creator":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"owner":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Mon, 01 Jun 2026 20:36:33 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/workflows + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"72cfa149-f153-45bc-aad6-2f601b7bfd9b","type":"workflows","attributes":{"createdAt":"2025-06-25T11:21:13.41766Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-25T11:21:13.41766Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"fe8c24c3-6574-4cf9-a3ee-4d84dd9b4354","type":"workflows","attributes":{"createdAt":"2025-06-25T11:21:14.456399Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-25T11:21:14.456399Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"7049520d-e564-4f35-8955-1750577b508e","type":"workflows","attributes":{"createdAt":"2025-06-25T11:21:14.872733Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-25T11:21:14.872733Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"c0e61b1b-486a-498d-a6ef-5b18d713a022","type":"workflows","attributes":{"createdAt":"2025-07-28T11:14:25.070776Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-07-28T11:14:25.070776Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"ceaea4db-f9b7-4133-8049-734c20e08170","type":"workflows","attributes":{"createdAt":"2025-06-25T11:21:15.742156Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-25T11:21:15.742156Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"d5f402b6-c5b1-4d8f-ab32-b7102fb3ef5e","type":"workflows","attributes":{"createdAt":"2025-06-20T11:20:34.434583Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-20T11:20:34.434583Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"59006312-23ea-4467-9921-310d1a17c2d9","type":"workflows","attributes":{"createdAt":"2025-06-20T11:20:35.557523Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-20T11:20:35.557523Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"8e9f8221-5788-4f1a-a341-afe4a73e8d2d","type":"workflows","attributes":{"createdAt":"2025-06-20T11:20:35.915972Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-20T11:20:35.915972Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"73c21683-cf0b-4140-92b3-d3f1be896160","type":"workflows","attributes":{"createdAt":"2025-06-20T11:20:36.779377Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-20T11:20:36.779377Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"8cf1582b-d398-4d35-bbba-a4b957c3db30","type":"workflows","attributes":{"createdAt":"2025-05-21T11:16:44.847574Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-21T11:16:44.847574Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"58031916-ffdb-4021-8670-d78298875765","type":"workflows","attributes":{"createdAt":"2025-05-21T11:16:45.55826Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-21T11:16:45.55826Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"3b7de88e-731c-4d2f-80d9-32ed547dff86","type":"workflows","attributes":{"createdAt":"2025-05-21T11:16:45.777562Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-21T11:16:45.777562Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"a187147a-094a-443a-a811-7b106914ec96","type":"workflows","attributes":{"createdAt":"2025-05-21T11:16:46.261047Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-21T11:16:46.261047Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"b7c893dc-f694-41a7-aa2b-633ceca08c2f","type":"workflows","attributes":{"createdAt":"2025-07-02T11:22:01.701809Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-07-02T11:22:01.701809Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"1d598ddd-5b9b-4ab7-9f7a-5e2574404ec7","type":"workflows","attributes":{"createdAt":"2025-07-02T11:22:02.789201Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-07-02T11:22:02.789201Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"e8508f29-ced6-4f95-a348-2ac062177472","type":"workflows","attributes":{"createdAt":"2025-07-02T11:22:03.20927Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-07-02T11:22:03.20927Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"f6d3e46b-eeaf-4017-a865-e1f045deae3f","type":"workflows","attributes":{"createdAt":"2025-07-02T11:22:04.030122Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-07-02T11:22:04.030122Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"e5fe54aa-9e17-4200-a710-cd916bfd39db","type":"workflows","attributes":{"createdAt":"2025-06-24T11:13:41.595876Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-24T11:13:41.595876Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"615d90f0-3478-4748-b489-177a4e3e2b74","type":"workflows","attributes":{"createdAt":"2025-06-24T11:13:41.828316Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-24T11:13:41.828316Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"a7a049f3-4c58-4e30-8157-a3a9b3132843","type":"workflows","attributes":{"createdAt":"2025-06-24T11:13:41.921301Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-24T11:13:41.921301Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"a8a64e61-7a8e-46fb-83ae-4220c7aa33ca","type":"workflows","attributes":{"createdAt":"2025-06-24T11:13:42.204916Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-24T11:13:42.204916Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"a50f8797-df93-4227-968b-4a653602d405","type":"workflows","attributes":{"createdAt":"2025-06-03T11:15:35.801277Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-03T11:15:35.801277Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"5567b478-806b-4768-9a3f-2b4ac9ad04e4","type":"workflows","attributes":{"createdAt":"2025-06-03T11:15:36.152307Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-03T11:15:36.152307Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"7f306d13-6e65-4962-b89d-5acfe0ada98a","type":"workflows","attributes":{"createdAt":"2025-06-03T11:15:35.623566Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-03T11:15:35.623566Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"8e9be134-5307-451f-8e40-0cc2546b6ed2","type":"workflows","attributes":{"createdAt":"2025-06-03T11:15:35.127727Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-06-03T11:15:35.127727Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"98144b6c-fc26-4e13-9fd9-943619e791d8","type":"workflows","attributes":{"createdAt":"2025-09-23T11:13:25.508416Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-09-23T11:13:25.508416Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"f422939b-e916-46fc-ba26-d25e1dcd2c66","type":"workflows","attributes":{"createdAt":"2025-09-23T11:13:25.765614Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-09-23T11:13:25.765614Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"5480f5c0-6128-4a56-9801-37e2e44496db","type":"workflows","attributes":{"createdAt":"2025-05-20T11:16:34.563405Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-20T11:16:34.563405Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"f00c51f1-6b32-401a-8bd4-08e360f94278","type":"workflows","attributes":{"createdAt":"2025-05-20T11:16:33.073415Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-20T11:16:33.073415Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"27fae62b-27e0-4802-94f4-5fc2fdef43f7","type":"workflows","attributes":{"createdAt":"2025-05-20T11:16:33.978668Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-20T11:16:33.978668Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"c0ccd673-e34a-49dd-a16f-bac77817fa62","type":"workflows","attributes":{"createdAt":"2025-05-20T11:16:33.744349Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-20T11:16:33.744349Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"f7380a3f-dd8f-4811-ac33-3245e6ad7dec","type":"workflows","attributes":{"createdAt":"2025-05-28T11:13:45.369167Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-28T11:13:45.369167Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"03bda67d-2cee-4828-a152-b263085b59cd","type":"workflows","attributes":{"createdAt":"2025-05-22T11:13:37.2763Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-22T11:13:37.2763Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"06c78ee4-a4aa-402e-8940-63ef512490d8","type":"workflows","attributes":{"createdAt":"2025-05-22T11:13:36.897095Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-22T11:13:36.897095Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"7aa75a8b-17b9-4c7e-b5fa-194dcd5f54c9","type":"workflows","attributes":{"createdAt":"2025-05-22T11:13:36.579513Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-22T11:13:36.579513Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"81112f53-d69b-4139-8790-f2adf2d80260","type":"workflows","attributes":{"createdAt":"2025-05-22T11:13:36.994612Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-22T11:13:36.994612Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"ba03c9fa-aa23-436c-ac69-e20bde5fb108","type":"workflows","attributes":{"createdAt":"2025-05-28T11:13:45.553954Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-28T11:13:45.553954Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"cbe3cd7d-4902-4863-9aba-ac4cb9038995","type":"workflows","attributes":{"createdAt":"2025-05-28T11:13:45.659208Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-28T11:13:45.659208Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"4c1cc171-9757-4e67-874e-64c962ed5352","type":"workflows","attributes":{"createdAt":"2025-05-28T11:13:45.894752Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-28T11:13:45.894752Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"52bfc481-46b4-44c1-8392-a32f405c21be","type":"workflows","attributes":{"createdAt":"2025-07-03T11:21:31.639998Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-07-03T11:21:31.639998Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"a12f3d3d-2dfb-449f-b1da-9d73dcc1284f","type":"workflows","attributes":{"createdAt":"2025-05-26T11:16:57.708411Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-26T11:16:57.708411Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"5a3ee825-3f39-4842-978c-afb8c997ba76","type":"workflows","attributes":{"createdAt":"2025-05-30T11:19:54.84087Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-30T11:19:54.84087Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"5b6dc390-841e-46e2-ad18-29aa33cd0aa1","type":"workflows","attributes":{"createdAt":"2025-05-30T11:19:52.696163Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-30T11:19:52.696163Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"80d42530-2ef1-40bb-ba31-7c44a0159a92","type":"workflows","attributes":{"createdAt":"2025-05-27T11:17:22.645064Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-27T11:17:22.645064Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"a2d791d3-407a-468b-b1eb-f38676b238d9","type":"workflows","attributes":{"createdAt":"2025-05-26T11:16:56.170659Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-26T11:16:56.170659Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"08620ae9-44ed-43c3-9941-e3936f3fd68b","type":"workflows","attributes":{"createdAt":"2025-05-26T11:16:56.942366Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-26T11:16:56.942366Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"d3bba643-1ce2-44c3-8ccb-3ad7647ec64d","type":"workflows","attributes":{"createdAt":"2025-05-26T11:16:57.184285Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-26T11:16:57.184285Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"a7ba3c17-c21b-4e50-8109-ae258395fcf0","type":"workflows","attributes":{"createdAt":"2025-05-27T11:17:22.915147Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-27T11:17:22.915147Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"8222b63d-8c1d-49fd-b31a-f18c870785e8","type":"workflows","attributes":{"createdAt":"2025-05-27T11:17:23.444244Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-27T11:17:23.444244Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}},{"id":"cb5040a1-b989-41bf-9a4f-59c75c0523e0","type":"workflows","attributes":{"createdAt":"2025-05-27T11:17:21.869589Z","description":"","name":"Cassette + Workflow x-given","published":true,"spec":null,"tags":[],"updatedAt":"2025-05-27T11:17:21.869589Z"},"relationships":{"creator":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}},"owner":{"data":{"id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"users"}}}}],"meta":{"page":{"totalCount":548,"totalFilteredCount":548}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Mon, 01 Jun 2026 20:36:33 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/workflows/72ea47e5-3bf2-41a2-bf7b-1857908234b6 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/workflow-automation/ListWorkflows.rb b/examples/v2/workflow-automation/ListWorkflows.rb new file mode 100644 index 000000000000..08c104e576c8 --- /dev/null +++ b/examples/v2/workflow-automation/ListWorkflows.rb @@ -0,0 +1,5 @@ +# List workflows returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new +p api_instance.list_workflows() diff --git a/examples/v2/workflow-automation/ListWorkflows_71111569.rb b/examples/v2/workflow-automation/ListWorkflows_71111569.rb new file mode 100644 index 000000000000..5dfb9ee97a3f --- /dev/null +++ b/examples/v2/workflow-automation/ListWorkflows_71111569.rb @@ -0,0 +1,9 @@ +# List workflows returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new +opts = { + filter_query: "Example-Workflow-Automation", + limit: 2, +} +api_instance.list_workflows_with_pagination(opts) { |item| puts item } diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index ead43f1928b4..f9a10c5837af 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -5422,6 +5422,15 @@ "uuid" => "UUID", "body" => "CreateOrUpdateWidgetRequest", }, + "v2.ListWorkflows" => { + "limit" => "Integer", + "page" => "Integer", + "sort" => "String", + "filter_query" => "String", + "filter_trigger_type" => "Array", + "filter_include_unpublished" => "Boolean", + "filter_include_specs" => "Boolean", + }, "v2.CreateWorkflow" => { "body" => "CreateWorkflowRequest", }, diff --git a/features/v2/undo.json b/features/v2/undo.json index 1cf6850b021f..e2d947e99f74 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -8477,6 +8477,12 @@ "type": "safe" } }, + "ListWorkflows": { + "tag": "Workflow Automation", + "undo": { + "type": "safe" + } + }, "CreateWorkflow": { "tag": "Workflow Automation", "undo": { diff --git a/features/v2/workflow_automation.feature b/features/v2/workflow_automation.feature index df51d5013900..96b0adf4e22b 100644 --- a/features/v2/workflow_automation.feature +++ b/features/v2/workflow_automation.feature @@ -142,6 +142,28 @@ Feature: Workflow Automation When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/workflow-automation-dev + Scenario: List workflows returns "Bad Request" response + Given new "ListWorkflows" request + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/workflow-automation-dev + Scenario: List workflows returns "OK" response + Given there is a valid "workflow" in the system + And new "ListWorkflows" request + When the request is sent + Then the response status is 200 OK + + @replay-only @skip-validation @team:DataDog/workflow-automation-dev @with-pagination + Scenario: List workflows returns "OK" response with pagination + Given new "ListWorkflows" request + And request contains "filter[query]" parameter with value "{{ unique }}" + And request contains "limit" parameter with value 2 + When the request with pagination is sent + Then the response status is 200 OK + And the response has 0 items + @team:DataDog/workflow-automation-dev Scenario: Update an existing Workflow returns "Bad request" response Given there is a valid "workflow" in the system diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 3d3b731b933a..5ffe343afcf4 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3842,6 +3842,9 @@ def overrides "v2.list_teams_sort" => "ListTeamsSort", "v2.list_vulnerabilities_response" => "ListVulnerabilitiesResponse", "v2.list_vulnerable_assets_response" => "ListVulnerableAssetsResponse", + "v2.list_workflows_response" => "ListWorkflowsResponse", + "v2.list_workflows_response_meta" => "ListWorkflowsResponseMeta", + "v2.list_workflows_response_meta_page" => "ListWorkflowsResponseMetaPage", "v2.llm_obs_annotated_interaction_by_trace_item" => "LLMObsAnnotatedInteractionByTraceItem", "v2.llm_obs_annotated_interaction_item" => "LLMObsAnnotatedInteractionItem", "v2.llm_obs_annotated_interactions_by_trace_data_attributes_response" => "LLMObsAnnotatedInteractionsByTraceDataAttributesResponse", @@ -7099,6 +7102,8 @@ def overrides "v2.workflow_list_instances_response" => "WorkflowListInstancesResponse", "v2.workflow_list_instances_response_meta" => "WorkflowListInstancesResponseMeta", "v2.workflow_list_instances_response_meta_page" => "WorkflowListInstancesResponseMetaPage", + "v2.workflow_list_item" => "WorkflowListItem", + "v2.workflow_list_item_attributes" => "WorkflowListItemAttributes", "v2.workflow_trigger_wrapper" => "WorkflowTriggerWrapper", "v2.workflow_user_relationship" => "WorkflowUserRelationship", "v2.workflow_user_relationship_data" => "WorkflowUserRelationshipData", 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..7bb7b3d1e304 100644 --- a/lib/datadog_api_client/v2/api/workflow_automation_api.rb +++ b/lib/datadog_api_client/v2/api/workflow_automation_api.rb @@ -501,6 +501,103 @@ def list_workflow_instances_with_http_info(workflow_id, opts = {}) return data, status_code, headers end + # List workflows. + # + # @see #list_workflows_with_http_info + def list_workflows(opts = {}) + data, _status_code, _headers = list_workflows_with_http_info(opts) + data + end + + # List workflows. + # + # List all workflows in your organization. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :limit The maximum number of workflows to return per page. + # @option opts [Integer] :page The page number to return, starting from 0. + # @option opts [String] :sort The sort order for the returned workflows. Provide a comma-separated list of fields, each optionally prefixed with `-` for descending order. Supported fields are `name`, `createdAt`, `updatedAt`, `creatorName`, `ownerName`, and `lastExecutedAt`. + # @option opts [String] :filter_query A search query used to filter the returned workflows. The query performs a case-insensitive substring match against each workflow's name, creator name, and handle. If the query contains a colon (for example, `team:infra`), it is instead treated as a `key:value` tag filter. + # @option opts [Array] :filter_trigger_type Filter the returned workflows by one or more trigger types, such as `monitor`, `schedule`, or `githubWebhook`. Repeat the parameter to filter by multiple trigger types. + # @option opts [Boolean] :filter_include_unpublished Whether to include unpublished workflows in the response. + # @option opts [Boolean] :filter_include_specs Whether to include the full spec of each workflow in the response. When `false` (the default), each workflow's `spec` is returned as `null`. + # @return [Array<(ListWorkflowsResponse, Integer, Hash)>] ListWorkflowsResponse data, response status code and response headers + def list_workflows_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WorkflowAutomationAPI.list_workflows ...' + end + # resource path + local_var_path = '/api/v2/workflows' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil? + query_params[:'filter[triggerType]'] = @api_client.build_collection_param(opts[:'filter_trigger_type'], :multi) if !opts[:'filter_trigger_type'].nil? + query_params[:'filter[includeUnpublished]'] = opts[:'filter_include_unpublished'] if !opts[:'filter_include_unpublished'].nil? + query_params[:'filter[includeSpecs]'] = opts[:'filter_include_specs'] if !opts[:'filter_include_specs'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListWorkflowsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_workflows, + :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" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WorkflowAutomationAPI#list_workflows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List workflows. + # + # Provide a paginated version of {#list_workflows}, returning all items. + # + # To use it you need to use a block: list_workflows_with_pagination { |item| p item } + # + # @yield [WorkflowListItem] Paginated items + def list_workflows_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "limit", 50) + @api_client.set_attribute_from_path(api_version, opts, "limit", Integer, page_size) + @api_client.set_attribute_from_path(api_version, opts, "page", Integer, 0) + while true do + response = list_workflows(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page", Integer, @api_client.get_attribute_from_path(opts, "page", 0) + 1) + end + end + # Update an existing Workflow. # # @see #update_workflow_with_http_info diff --git a/lib/datadog_api_client/v2/models/list_workflows_response.rb b/lib/datadog_api_client/v2/models/list_workflows_response.rb new file mode 100644 index 000000000000..2319a7d670b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_workflows_response.rb @@ -0,0 +1,117 @@ +=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 response object after listing workflows. + class ListWorkflowsResponse + include BaseGenericModel + + # A list of workflows. + attr_accessor :data + + # Metadata about the list workflows response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ListWorkflowsResponseMeta' + } + 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::ListWorkflowsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_workflows_response_meta.rb b/lib/datadog_api_client/v2/models/list_workflows_response_meta.rb new file mode 100644 index 000000000000..777b093859a2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_workflows_response_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata about the list workflows response. + class ListWorkflowsResponseMeta + include BaseGenericModel + + # Page information for the list workflows response. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'ListWorkflowsResponseMetaPage' + } + 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::ListWorkflowsResponseMeta` 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?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_workflows_response_meta_page.rb b/lib/datadog_api_client/v2/models/list_workflows_response_meta_page.rb new file mode 100644 index 000000000000..9e0e0280c6e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_workflows_response_meta_page.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Page information for the list workflows response. + class ListWorkflowsResponseMetaPage + include BaseGenericModel + + # The total number of workflows. + attr_accessor :total_count + + # The total number of workflows matching the applied filters. + attr_accessor :total_filtered_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_count' => :'totalCount', + :'total_filtered_count' => :'totalFilteredCount' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_count' => :'Integer', + :'total_filtered_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListWorkflowsResponseMetaPage` 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?(:'total_count') + self.total_count = attributes[:'total_count'] + end + + if attributes.key?(:'total_filtered_count') + self.total_filtered_count = attributes[:'total_filtered_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_count == o.total_count && + total_filtered_count == o.total_filtered_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_count, total_filtered_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_list_item.rb b/lib/datadog_api_client/v2/models/workflow_list_item.rb new file mode 100644 index 000000000000..31ab4a00663e --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_list_item.rb @@ -0,0 +1,164 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A workflow returned by the list workflows endpoint. + class WorkflowListItem + include BaseGenericModel + + # The definition of `WorkflowListItemAttributes` object. + attr_reader :attributes + + # The workflow identifier + attr_accessor :id + + # The definition of `WorkflowDataRelationships` object. + attr_accessor :relationships + + # The definition of `WorkflowDataType` object. + 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', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'WorkflowListItemAttributes', + :'id' => :'String', + :'relationships' => :'WorkflowDataRelationships', + :'type' => :'WorkflowDataType' + } + 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::WorkflowListItem` 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?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + 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, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_list_item_attributes.rb b/lib/datadog_api_client/v2/models/workflow_list_item_attributes.rb new file mode 100644 index 000000000000..31a70914dc1b --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_list_item_attributes.rb @@ -0,0 +1,185 @@ +=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 definition of `WorkflowListItemAttributes` object. + class WorkflowListItemAttributes + include BaseGenericModel + + # When the workflow was created. + attr_accessor :created_at + + # Description of the workflow. + attr_accessor :description + + # Name of the workflow. + attr_reader :name + + # Set the workflow to published or unpublished. Workflows in an unpublished state will only be executable via manual runs. Automatic triggers such as Schedule will not execute the workflow until it is published. + attr_accessor :published + + # The spec defines what the workflow does. + attr_accessor :spec + + # Tags of the workflow. + attr_accessor :tags + + # When the workflow was last updated. + attr_accessor :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'createdAt', + :'description' => :'description', + :'name' => :'name', + :'published' => :'published', + :'spec' => :'spec', + :'tags' => :'tags', + :'updated_at' => :'updatedAt' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'description' => :'String', + :'name' => :'String', + :'published' => :'Boolean', + :'spec' => :'Spec', + :'tags' => :'Array', + :'updated_at' => :'Time' + } + 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::WorkflowListItemAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'published') + self.published = attributes[:'published'] + end + + if attributes.key?(:'spec') + self.spec = attributes[:'spec'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + 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 @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + description == o.description && + name == o.name && + published == o.published && + spec == o.spec && + tags == o.tags && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, description, name, published, spec, tags, updated_at, additional_properties].hash + end + end +end