From a1777f816512e227e1e34179d48bdd3b37eb3cbc Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 13 May 2026 18:56:59 +0000 Subject: [PATCH] Regenerate client from commit 73a95ac of spec repo --- .generator/schemas/v2/openapi.yaml | 1277 +++++++++++++++++ .../CancelWorkflowExecution.rb | 8 + .../CancelWorkflowExecutions.rb | 8 + .../dependency-management/CreateAIWorkflow.rb | 29 + .../CreateWorkflowExecution.rb | 8 + .../dependency-management/DeleteAIWorkflow.rb | 8 + .../DeleteWorkflowExecutions.rb | 8 + .../v2/dependency-management/GetAIWorkflow.rb | 8 + .../ListAIWorkflowInstances.rb | 8 + .../dependency-management/ListAIWorkflows.rb | 8 + .../ListExecutionSteps.rb | 8 + .../v2/dependency-management/ListPROutputs.rb | 8 + .../RerunWorkflowExecution.rb | 8 + .../dependency-management/UpdateAIWorkflow.rb | 28 + features/scenarios_model_mapping.rb | 48 + features/v2/dependency_management.feature | 250 ++++ features/v2/undo.json | 86 ++ lib/datadog_api_client/configuration.rb | 13 + lib/datadog_api_client/inflector.rb | 35 + .../v2/api/dependency_management_api.rb | 986 +++++++++++++ .../v2/models/ai_workflow_attributes.rb | 374 +++++ .../v2/models/ai_workflow_data.rb | 165 +++ .../v2/models/ai_workflow_data_type.rb | 26 + .../v2/models/ai_workflow_list_meta.rb | 123 ++ .../v2/models/ai_workflow_response.rb | 123 ++ .../models/cancel_workflow_executions_data.rb | 123 ++ .../cancel_workflow_executions_response.rb | 123 ++ .../v2/models/create_ai_workflow_request.rb | 293 ++++ .../create_workflow_executions_response.rb | 125 ++ lib/datadog_api_client/v2/models/entity.rb | 153 ++ .../v2/models/execution_step.rb | 204 +++ .../v2/models/execution_step_status.rb | 30 + .../v2/models/list_ai_workflows_response.rb | 146 ++ .../models/list_execution_steps_attributes.rb | 125 ++ .../v2/models/list_execution_steps_data.rb | 165 +++ .../models/list_execution_steps_data_type.rb | 26 + .../models/list_execution_steps_response.rb | 123 ++ .../v2/models/list_pr_outputs_attributes.rb | 125 ++ .../v2/models/list_pr_outputs_data.rb | 165 +++ .../v2/models/list_pr_outputs_data_type.rb | 26 + .../v2/models/list_pr_outputs_response.rb | 123 ++ .../list_workflow_instances_response.rb | 125 ++ lib/datadog_api_client/v2/models/pr_output.rb | 163 +++ .../v2/models/pr_output_ci_status.rb | 28 + .../v2/models/pr_output_status.rb | 30 + .../v2/models/update_ai_workflow_request.rb | 177 +++ .../models/workflow_execution_attributes.rb | 209 +++ .../v2/models/workflow_execution_data.rb | 165 +++ .../v2/models/workflow_execution_data_type.rb | 26 + .../v2/models/workflow_execution_response.rb | 123 ++ .../workflow_instance_summary_attributes.rb | 188 +++ ...flow_instance_summary_attributes_status.rb | 30 + .../models/workflow_instance_summary_data.rb | 165 +++ .../workflow_instance_summary_data_type.rb | 26 + 54 files changed, 7181 insertions(+) create mode 100644 examples/v2/dependency-management/CancelWorkflowExecution.rb create mode 100644 examples/v2/dependency-management/CancelWorkflowExecutions.rb create mode 100644 examples/v2/dependency-management/CreateAIWorkflow.rb create mode 100644 examples/v2/dependency-management/CreateWorkflowExecution.rb create mode 100644 examples/v2/dependency-management/DeleteAIWorkflow.rb create mode 100644 examples/v2/dependency-management/DeleteWorkflowExecutions.rb create mode 100644 examples/v2/dependency-management/GetAIWorkflow.rb create mode 100644 examples/v2/dependency-management/ListAIWorkflowInstances.rb create mode 100644 examples/v2/dependency-management/ListAIWorkflows.rb create mode 100644 examples/v2/dependency-management/ListExecutionSteps.rb create mode 100644 examples/v2/dependency-management/ListPROutputs.rb create mode 100644 examples/v2/dependency-management/RerunWorkflowExecution.rb create mode 100644 examples/v2/dependency-management/UpdateAIWorkflow.rb create mode 100644 features/v2/dependency_management.feature create mode 100644 lib/datadog_api_client/v2/api/dependency_management_api.rb create mode 100644 lib/datadog_api_client/v2/models/ai_workflow_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/ai_workflow_data.rb create mode 100644 lib/datadog_api_client/v2/models/ai_workflow_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/ai_workflow_list_meta.rb create mode 100644 lib/datadog_api_client/v2/models/ai_workflow_response.rb create mode 100644 lib/datadog_api_client/v2/models/cancel_workflow_executions_data.rb create mode 100644 lib/datadog_api_client/v2/models/cancel_workflow_executions_response.rb create mode 100644 lib/datadog_api_client/v2/models/create_ai_workflow_request.rb create mode 100644 lib/datadog_api_client/v2/models/create_workflow_executions_response.rb create mode 100644 lib/datadog_api_client/v2/models/entity.rb create mode 100644 lib/datadog_api_client/v2/models/execution_step.rb create mode 100644 lib/datadog_api_client/v2/models/execution_step_status.rb create mode 100644 lib/datadog_api_client/v2/models/list_ai_workflows_response.rb create mode 100644 lib/datadog_api_client/v2/models/list_execution_steps_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/list_execution_steps_data.rb create mode 100644 lib/datadog_api_client/v2/models/list_execution_steps_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/list_execution_steps_response.rb create mode 100644 lib/datadog_api_client/v2/models/list_pr_outputs_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/list_pr_outputs_data.rb create mode 100644 lib/datadog_api_client/v2/models/list_pr_outputs_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/list_pr_outputs_response.rb create mode 100644 lib/datadog_api_client/v2/models/list_workflow_instances_response.rb create mode 100644 lib/datadog_api_client/v2/models/pr_output.rb create mode 100644 lib/datadog_api_client/v2/models/pr_output_ci_status.rb create mode 100644 lib/datadog_api_client/v2/models/pr_output_status.rb create mode 100644 lib/datadog_api_client/v2/models/update_ai_workflow_request.rb create mode 100644 lib/datadog_api_client/v2/models/workflow_execution_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/workflow_execution_data.rb create mode 100644 lib/datadog_api_client/v2/models/workflow_execution_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/workflow_execution_response.rb create mode 100644 lib/datadog_api_client/v2/models/workflow_instance_summary_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/workflow_instance_summary_attributes_status.rb create mode 100644 lib/datadog_api_client/v2/models/workflow_instance_summary_data.rb create mode 100644 lib/datadog_api_client/v2/models/workflow_instance_summary_data_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index db3332717dac..a1a7d3fa1e54 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4,6 +4,15 @@ components: headers: {} links: {} parameters: + AIWorkflowId: + description: The UUID of the AI workflow. + example: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + in: path + name: id + required: true + schema: + format: uuid + type: string APIKeyCategoryParameter: description: Filter API keys by category. in: query @@ -1485,6 +1494,15 @@ components: schema: example: "00000000-0000-9999-0000-000000000000" type: string + WorkflowExecutionId: + description: The UUID of the workflow execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + in: path + name: id + required: true + schema: + format: uuid + type: string WorkflowId: description: The ID of the workflow. in: path @@ -1659,6 +1677,131 @@ components: $ref: "#/components/schemas/JSONAPIErrorResponse" description: The server cannot process the request because it contains invalid data. schemas: + AIWorkflowAttributes: + description: Attributes of an AI workflow. + properties: + completed_at: + description: Timestamp when the workflow completed. Null if not yet completed. + example: "2024-01-20T15:00:00Z" + format: date-time + nullable: true + type: string + created_at: + description: Timestamp when the workflow was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + entities: + description: A list of entity groups. Each group is processed in a separate workflow execution. + example: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + items: + items: + $ref: "#/components/schemas/Entity" + type: array + type: array + filtering_logic: + $ref: "#/components/schemas/FilteringLogic" + grouping_logic: + description: The logic used to group entities into execution batches. + example: "by-service" + type: string + idp_campaign_id: + description: The IDP campaign ID associated with this workflow. + example: "campaign-abc123" + type: string + max_number_of_entities_per_session: + description: Maximum number of entities processed in a single execution session. + example: 5 + format: int64 + type: integer + prompt: + description: The AI prompt guiding the dependency upgrade automation. + example: "Upgrade the lodash dependency to version 4.17.21" + type: string + repository: + description: The target repository in owner/repo format. + example: "DataDog/datadog-agent" + type: string + updated_at: + description: Timestamp when the workflow was last updated. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + user: + description: The username of the user who created the workflow. + example: "john.doe@example.com" + type: string + workflow_id: + description: The UUID of the underlying Datadog Workflow Automation workflow. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + format: uuid + type: string + workflow_name: + description: The human-readable name of the workflow. + example: "Upgrade lodash to 4.17.21" + type: string + required: + - workflow_id + - workflow_name + - idp_campaign_id + - user + - created_at + - updated_at + - prompt + - grouping_logic + - max_number_of_entities_per_session + - filtering_logic + - repository + - entities + type: object + AIWorkflowData: + description: A single AI workflow resource. + properties: + attributes: + $ref: "#/components/schemas/AIWorkflowAttributes" + id: + description: The unique identifier of the AI workflow. + example: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + format: uuid + type: string + type: + $ref: "#/components/schemas/AIWorkflowDataType" + required: + - id + - type + - attributes + type: object + AIWorkflowDataType: + description: The resource type for AI workflows. + enum: + - ai-workflows + example: "ai-workflows" + type: string + x-enum-varnames: + - AI_WORKFLOWS + AIWorkflowListMeta: + description: Metadata for the list AI workflows response. + properties: + total: + description: Total number of AI workflows matching the filter criteria. + example: 42 + format: int64 + type: integer + required: + - total + type: object + AIWorkflowResponse: + description: Response containing a single AI workflow. + properties: + data: + $ref: "#/components/schemas/AIWorkflowData" + required: + - data + type: object APIErrorResponse: description: API error response. properties: @@ -10604,6 +10747,25 @@ components: meta: $ref: "#/components/schemas/DataDeletionResponseMeta" type: object + CancelWorkflowExecutionsData: + description: Data returned after canceling workflow executions. + properties: + canceled_count: + description: The number of running instances that were successfully canceled. + example: 3 + format: int64 + type: integer + required: + - canceled_count + type: object + CancelWorkflowExecutionsResponse: + description: Response from canceling all running workflow execution instances. + properties: + data: + $ref: "#/components/schemas/CancelWorkflowExecutionsData" + required: + - data + type: object Case: description: A case properties: @@ -16030,6 +16192,63 @@ components: type: integer type: object x-model-simple-name: SpaCpu + CreateAIWorkflowRequest: + description: Request body for creating a new AI workflow. + properties: + entities: + description: A list of entity groups. Each group is processed in a separate workflow execution. + example: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + items: + items: + $ref: "#/components/schemas/Entity" + type: array + type: array + filtering_logic: + $ref: "#/components/schemas/FilteringLogic" + grouping_logic: + description: The logic used to group entities into batches for execution. + example: "by-service" + type: string + idp_campaign_id: + description: The IDP campaign ID associated with this workflow. + example: "campaign-abc123" + type: string + max_number_of_entities_per_session: + description: Maximum number of entities allowed per execution session. + example: 5 + format: int64 + type: integer + prompt: + description: The AI prompt used to guide the dependency upgrade automation. + example: "Upgrade the lodash dependency to version 4.17.21" + type: string + repository: + description: The target repository in owner/repo format. + example: "DataDog/datadog-agent" + type: string + user: + description: The username of the user initiating the workflow. + example: "john.doe@example.com" + type: string + workflow_name: + description: A human-readable name for the workflow. + example: "Upgrade lodash to 4.17.21" + type: string + required: + - workflow_name + - idp_campaign_id + - user + - prompt + - grouping_logic + - max_number_of_entities_per_session + - filtering_logic + - repository + - entities + type: object CreateActionConnectionRequest: description: Request used to create an action connection. properties: @@ -18632,6 +18851,17 @@ components: - name - value type: object + CreateWorkflowExecutionsResponse: + description: Response containing a list of created workflow executions. + properties: + data: + description: List of created workflow execution resources. + items: + $ref: "#/components/schemas/WorkflowExecutionData" + type: array + required: + - data + type: object CreateWorkflowRequest: description: A request object for creating a new workflow. example: @@ -24258,6 +24488,28 @@ components: description: Field used to enable or disable the rule. example: true type: boolean + Entity: + description: An entity participating in the dependency upgrade workflow. + properties: + entity_kind: + description: The kind of the entity (for example, service or package). + example: "service" + type: string + entity_name: + description: The name of the entity. + example: "my-service" + type: string + entity_namespace: + description: The namespace of the entity. + example: "default" + type: string + entity_team: + description: The team that owns the entity. + example: "platform" + type: string + required: + - entity_name + type: object EntityAttributes: description: Entity attributes. properties: @@ -24305,6 +24557,16 @@ components: description: Entity. type: string type: object + EntityGroup: + description: A group of entities to be processed together in a single workflow execution. + items: + $ref: "#/components/schemas/Entity" + type: array + EntityGroups: + description: A list of entity groups. Each group is processed in a separate workflow execution. + items: + $ref: "#/components/schemas/EntityGroup" + type: array EntityMeta: description: Entity metadata. properties: @@ -26878,6 +27140,56 @@ components: example: "One or several indexes are missing or invalid. Results hold data from the other indexes." type: string type: object + ExecutionStep: + description: A single step in a workflow execution. + properties: + completed_at: + description: Timestamp when the step completed. Null if not yet completed. + example: "2024-01-15T10:37:00Z" + format: date-time + nullable: true + type: string + error: + description: Error message if the step failed. + example: "Failed to create pull request: branch already exists" + type: string + id: + description: The unique identifier of the execution step. + example: "step-abc123" + type: string + name: + description: The name of the step. + example: "Create Pull Request" + type: string + started_at: + description: Timestamp when the step started. Null if not yet started. + example: "2024-01-15T10:36:00Z" + format: date-time + nullable: true + type: string + status: + $ref: "#/components/schemas/ExecutionStepStatus" + required: + - id + - name + - status + type: object + ExecutionStepStatus: + description: The current status of the step. + enum: + - PENDING + - RUNNING + - COMPLETED + - FAILED + - CANCELED + example: "COMPLETED" + type: string + x-enum-varnames: + - PENDING + - RUNNING + - COMPLETED + - FAILED + - CANCELED ExposureRolloutStepRequest: description: Rollout step request payload. properties: @@ -27736,6 +28048,11 @@ components: format: int64 type: integer type: object + FilteringLogic: + description: Arbitrary filtering criteria used to select entities for the workflow. + example: + teams: ["platform"] + type: object FiltersPerProduct: description: Product-specific filters for the dataset. properties: @@ -41124,6 +41441,20 @@ components: - first - last type: object + ListAIWorkflowsResponse: + description: Response containing a list of AI workflows. + properties: + data: + description: List of AI workflow resources. + items: + $ref: "#/components/schemas/AIWorkflowData" + type: array + meta: + $ref: "#/components/schemas/AIWorkflowListMeta" + required: + - data + - meta + type: object ListAPIsResponse: description: Response for `ListAPIs`. properties: @@ -41587,6 +41918,56 @@ components: required: - data type: object + ListExecutionStepsAttributes: + description: Attributes of an execution steps response. + properties: + steps: + description: The list of steps for the workflow execution. + example: + - completed_at: "2024-01-15T10:37:00Z" + id: "step-abc123" + name: "Create Pull Request" + started_at: "2024-01-15T10:36:00Z" + status: "COMPLETED" + items: + $ref: "#/components/schemas/ExecutionStep" + type: array + required: + - steps + type: object + ListExecutionStepsData: + description: Data for execution steps response. + properties: + attributes: + $ref: "#/components/schemas/ListExecutionStepsAttributes" + id: + description: The unique identifier of the workflow execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + type: + $ref: "#/components/schemas/ListExecutionStepsDataType" + required: + - id + - type + - attributes + type: object + ListExecutionStepsDataType: + description: The resource type for workflow execution steps. + enum: + - workflow-execution-steps + example: "workflow-execution-steps" + type: string + x-enum-varnames: + - WORKFLOW_EXECUTION_STEPS + ListExecutionStepsResponse: + description: Response containing the execution steps for a workflow execution. + properties: + data: + $ref: "#/components/schemas/ListExecutionStepsData" + required: + - data + type: object ListFeatureFlagsResponse: description: Response containing a list of feature flags. properties: @@ -41829,6 +42210,56 @@ components: $ref: "#/components/schemas/OnCallNotificationRulesIncluded" type: array type: object + ListPROutputsAttributes: + description: Attributes of a PR outputs response. + properties: + pr_outputs: + description: The list of pull requests created by the workflow execution. + example: + - ci_status: "SUCCESSFUL" + pr_number: 1234 + pr_url: "https://github.com/DataDog/datadog-agent/pull/1234" + repository: "DataDog/datadog-agent" + status: "READY" + items: + $ref: "#/components/schemas/PROutput" + type: array + required: + - pr_outputs + type: object + ListPROutputsData: + description: Data for PR outputs response. + properties: + attributes: + $ref: "#/components/schemas/ListPROutputsAttributes" + id: + description: The unique identifier of the workflow execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + type: + $ref: "#/components/schemas/ListPROutputsDataType" + required: + - id + - type + - attributes + type: object + ListPROutputsDataType: + description: The resource type for workflow execution PR outputs. + enum: + - workflow-execution-pr-outputs + example: "workflow-execution-pr-outputs" + type: string + x-enum-varnames: + - WORKFLOW_EXECUTION_PR_OUTPUTS + ListPROutputsResponse: + description: Response containing the PR outputs for a workflow execution. + properties: + data: + $ref: "#/components/schemas/ListPROutputsData" + required: + - data + type: object ListPersonalAccessTokensResponse: description: Response for a list of personal access tokens. properties: @@ -42054,6 +42485,17 @@ components: required: - data type: object + ListWorkflowInstancesResponse: + description: Response containing a list of workflow instance summaries. + properties: + data: + description: List of workflow instance summaries. + items: + $ref: "#/components/schemas/WorkflowInstanceSummaryData" + type: array + required: + - data + type: object Log: description: Object description of a log after being processed and stored by Datadog. properties: @@ -54155,6 +54597,57 @@ components: required: - data type: object + PROutput: + description: A pull request created by the dependency upgrade automation. + properties: + ci_status: + $ref: "#/components/schemas/PROutputCiStatus" + pr_number: + description: The pull request number. + example: 1234 + format: int64 + type: integer + pr_url: + description: The URL of the pull request. + example: "https://github.com/DataDog/datadog-agent/pull/1234" + type: string + repository: + description: The repository name in owner/repo format. + example: "DataDog/datadog-agent" + type: string + status: + $ref: "#/components/schemas/PROutputStatus" + required: + - pr_url + type: object + PROutputCiStatus: + description: The aggregate CI check status for the pull request. + enum: + - PENDING + - FAILED + - SUCCESSFUL + example: "SUCCESSFUL" + type: string + x-enum-varnames: + - PENDING + - FAILED + - SUCCESSFUL + PROutputStatus: + description: The current status of the pull request. + enum: + - PENDING + - DRAFT + - READY + - MERGED + - CLOSED + example: "READY" + type: string + x-enum-varnames: + - PENDING + - DRAFT + - READY + - MERGED + - CLOSED PageUrgency: default: high description: On-Call Page urgency level. @@ -80674,6 +81167,40 @@ components: data: $ref: "#/components/schemas/Deployment" type: object + UpdateAIWorkflowRequest: + description: Request body for updating an existing AI workflow. All fields are optional. + properties: + completed_at: + description: Timestamp marking when the workflow completed. + example: "2024-06-01T12:00:00Z" + format: date-time + type: string + entities: + $ref: "#/components/schemas/EntityGroups" + filtering_logic: + $ref: "#/components/schemas/FilteringLogic" + grouping_logic: + description: Updated entity grouping logic. + example: "by-team" + type: string + max_number_of_entities_per_session: + description: Updated maximum number of entities per execution session. + example: 10 + format: int64 + type: integer + prompt: + description: Updated AI prompt for the workflow. + example: "Updated prompt for the dependency upgrade" + type: string + repository: + description: Updated target repository in owner/repo format. + example: "DataDog/datadog-agent" + type: string + workflow_name: + description: Updated name for the workflow. + example: "Updated workflow name" + type: string + type: object UpdateActionConnectionRequest: description: Request used to update an action connection. properties: @@ -84415,6 +84942,79 @@ components: type: string writeOnly: true type: object + WorkflowExecutionAttributes: + description: Attributes of a workflow execution. + properties: + ai_workflow_id: + description: The ID of the parent AI workflow. + example: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + format: uuid + type: string + created_at: + description: Timestamp when the execution was created. + example: "2024-01-15T10:35:00Z" + format: date-time + type: string + entities: + description: The list of entities processed by this execution. + example: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + items: + $ref: "#/components/schemas/Entity" + type: array + instance_id: + description: The Datadog Workflow Automation instance ID for this execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + updated_at: + description: Timestamp when the execution was last updated. + example: "2024-01-15T10:35:00Z" + format: date-time + type: string + required: + - instance_id + - ai_workflow_id + - created_at + - updated_at + - entities + type: object + WorkflowExecutionData: + description: A single workflow execution resource. + properties: + attributes: + $ref: "#/components/schemas/WorkflowExecutionAttributes" + id: + description: The unique identifier of the workflow execution. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + type: + $ref: "#/components/schemas/WorkflowExecutionDataType" + required: + - id + - type + - attributes + type: object + WorkflowExecutionDataType: + description: The resource type for workflow executions. + enum: + - workflow-executions + example: "workflow-executions" + type: string + x-enum-varnames: + - WORKFLOW_EXECUTIONS + WorkflowExecutionResponse: + description: Response containing a single workflow execution. + properties: + data: + $ref: "#/components/schemas/WorkflowExecutionData" + required: + - data + type: object WorkflowInstanceCreateMeta: description: Additional information for creating a workflow instance. properties: @@ -84452,6 +85052,64 @@ components: description: The ID of the workflow instance type: string type: object + WorkflowInstanceSummaryAttributes: + description: Attributes of a workflow instance summary. + properties: + created_at: + description: Timestamp when the workflow instance was created. + example: "2024-01-15T10:35:00Z" + format: date-time + type: string + entities: + description: The entities being processed by this workflow instance. + example: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + items: + $ref: "#/components/schemas/Entity" + type: array + status: + $ref: "#/components/schemas/WorkflowInstanceSummaryAttributesStatus" + status_display: + description: A human-readable display name for the current status. + example: "Running" + type: string + required: + - created_at + - status + - status_display + - entities + type: object + WorkflowInstanceSummaryAttributesStatus: + $ref: "#/components/schemas/ExecutionStepStatus" + example: "COMPLETED" + WorkflowInstanceSummaryData: + description: A summary of a single workflow instance. + properties: + attributes: + $ref: "#/components/schemas/WorkflowInstanceSummaryAttributes" + id: + description: The unique identifier of the workflow instance. + example: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + format: uuid + type: string + type: + $ref: "#/components/schemas/WorkflowInstanceSummaryDataType" + required: + - id + - type + - attributes + type: object + WorkflowInstanceSummaryDataType: + description: The resource type for workflow instances. + enum: + - workflow-instances + example: "workflow-instances" + type: string + x-enum-varnames: + - WORKFLOW_INSTANCES WorkflowListInstancesResponse: additionalProperties: {} description: Response returned when listing workflow instances. @@ -99449,6 +100107,623 @@ paths: x-unstable: |- **Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/dependency-management/ai-workflow: + post: + description: Create a new AI workflow for dependency management. This creates both the workflow definition and initializes its executions. + operationId: CreateAIWorkflow + requestBody: + content: + application/json: + examples: + default: + value: + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Upgrade the lodash dependency to version 4.17.21" + repository: "DataDog/datadog-agent" + user: "john.doe@example.com" + workflow_name: "Upgrade lodash to 4.17.21" + schema: + $ref: "#/components/schemas/CreateAIWorkflowRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + completed_at: + created_at: "2024-01-15T10:30:00Z" + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Upgrade the lodash dependency to version 4.17.21" + repository: "DataDog/datadog-agent" + updated_at: "2024-01-15T10:30:00Z" + user: "john.doe@example.com" + workflow_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + workflow_name: "Upgrade lodash to 4.17.21" + id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + type: "ai-workflows" + schema: + $ref: "#/components/schemas/AIWorkflowResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create an AI workflow + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows: + get: + description: List AI workflows for the organization with optional filters. + operationId: ListAIWorkflows + parameters: + - description: Filter workflows by IDP campaign ID. + example: "campaign-abc123" + in: query + name: idp_campaign_id + required: false + schema: + type: string + - description: Filter workflows by repository name (owner/repo format). + example: "DataDog/datadog-agent" + in: query + name: repository + required: false + schema: + type: string + - description: Filter workflows by the username of the creator. + example: "john.doe@example.com" + in: query + name: user + required: false + schema: + type: string + - description: Filter workflows by completion status. Use `true` to return only completed workflows, `false` for incomplete. + example: false + in: query + name: completed + required: false + schema: + type: boolean + - description: Filter workflows created after this timestamp (RFC3339 format). + example: "2024-01-01T00:00:00Z" + in: query + name: created_after + required: false + schema: + format: date-time + type: string + - description: Filter workflows created before this timestamp (RFC3339 format). + example: "2024-12-31T23:59:59Z" + in: query + name: created_before + required: false + schema: + format: date-time + type: string + - description: Maximum number of workflows to return. Defaults to 50, maximum 100. + example: 50 + in: query + name: limit + required: false + schema: + default: 50 + maximum: 100 + minimum: 1 + type: integer + - description: Number of workflows to skip for pagination. + example: 0 + in: query + name: offset + required: false + schema: + default: 0 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + completed_at: + created_at: "2024-01-15T10:30:00Z" + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Upgrade the lodash dependency to version 4.17.21" + repository: "DataDog/datadog-agent" + updated_at: "2024-01-15T10:30:00Z" + user: "john.doe@example.com" + workflow_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + workflow_name: "Upgrade lodash to 4.17.21" + id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + type: "ai-workflows" + meta: + total: 1 + schema: + $ref: "#/components/schemas/ListAIWorkflowsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List AI workflows + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows/{id}: + delete: + description: Delete a specific AI workflow. This also removes the workflow from Datadog Workflow Automation. + operationId: DeleteAIWorkflow + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "204": + description: No Content + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete an AI workflow + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + get: + description: Get details of a specific AI workflow by its ID. + operationId: GetAIWorkflow + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + completed_at: + created_at: "2024-01-15T10:30:00Z" + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Upgrade the lodash dependency to version 4.17.21" + repository: "DataDog/datadog-agent" + updated_at: "2024-01-15T10:30:00Z" + user: "john.doe@example.com" + workflow_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + workflow_name: "Upgrade lodash to 4.17.21" + id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + type: "ai-workflows" + schema: + $ref: "#/components/schemas/AIWorkflowResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an AI workflow + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + patch: + description: Update the configuration of an existing AI workflow. Only the provided fields are updated. + operationId: UpdateAIWorkflow + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + requestBody: + content: + application/json: + examples: + default: + value: + prompt: "Updated prompt for the dependency upgrade" + workflow_name: "Updated workflow name" + schema: + $ref: "#/components/schemas/UpdateAIWorkflowRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + completed_at: + created_at: "2024-01-15T10:30:00Z" + entities: + - - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + filtering_logic: + teams: ["platform"] + grouping_logic: "by-service" + idp_campaign_id: "campaign-abc123" + max_number_of_entities_per_session: 5 + prompt: "Updated prompt for the dependency upgrade" + repository: "DataDog/datadog-agent" + updated_at: "2024-01-16T09:00:00Z" + user: "john.doe@example.com" + workflow_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + workflow_name: "Updated workflow name" + id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + type: "ai-workflows" + schema: + $ref: "#/components/schemas/AIWorkflowResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update an AI workflow + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows/{id}/cancel: + post: + description: Cancel all running workflow execution instances for the given AI workflow. + operationId: CancelWorkflowExecutions + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + canceled_count: 3 + schema: + $ref: "#/components/schemas/CancelWorkflowExecutionsResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Cancel workflow executions + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows/{id}/executions: + delete: + description: Delete all workflow executions for a given AI workflow. Running instances are canceled before deletion. + operationId: DeleteWorkflowExecutions + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "204": + description: No Content + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete workflow executions + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + post: + description: Create workflow executions for an AI workflow. One execution is created per entity group defined in the workflow. + operationId: CreateWorkflowExecution + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + - description: Maximum number of new workflow instances to start. Must be between 1 and 30. + example: 10 + in: query + name: max_instances + required: false + schema: + maximum: 30 + minimum: 1 + type: integer + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + - attributes: + ai_workflow_id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + created_at: "2024-01-15T10:35:00Z" + entities: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + instance_id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + updated_at: "2024-01-15T10:35:00Z" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-executions" + schema: + $ref: "#/components/schemas/CreateWorkflowExecutionsResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create workflow executions + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/ai-workflows/{id}/instances: + get: + description: List all workflow instances for a given AI workflow with their live status from Workflow Automation and entity information. + operationId: ListAIWorkflowInstances + parameters: + - $ref: "#/components/parameters/AIWorkflowId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-15T10:35:00Z" + entities: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + status: "RUNNING" + status_display: "Running" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-instances" + schema: + $ref: "#/components/schemas/ListWorkflowInstancesResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List AI workflow instances + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/workflow-executions/{id}/cancel: + post: + description: Cancel a specific workflow execution instance. Returns 409 if the instance is not currently in a running state. + operationId: CancelWorkflowExecution + parameters: + - $ref: "#/components/parameters/WorkflowExecutionId" + responses: + "204": + description: No Content + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Cancel a workflow execution + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/workflow-executions/{id}/pr-outputs: + get: + description: Get the pull request outputs for a specific workflow execution. Includes PR URL, status, and CI status enriched from GitHub. + operationId: ListPROutputs + parameters: + - $ref: "#/components/parameters/WorkflowExecutionId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + pr_outputs: + - ci_status: "SUCCESSFUL" + pr_number: 1234 + pr_url: "https://github.com/DataDog/datadog-agent/pull/1234" + repository: "DataDog/datadog-agent" + status: "READY" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-execution-pr-outputs" + schema: + $ref: "#/components/schemas/ListPROutputsResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List PR outputs + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/workflow-executions/{id}/rerun: + post: + description: Rerun a failed or canceled workflow execution. This replaces the existing execution with a new one using the same entities. + operationId: RerunWorkflowExecution + parameters: + - $ref: "#/components/parameters/WorkflowExecutionId" + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + ai_workflow_id: "3f7b1a2d-4e8c-4f9d-a1b2-c3d4e5f67890" + created_at: "2024-01-15T10:35:00Z" + entities: + - entity_kind: "service" + entity_name: "my-service" + entity_namespace: "default" + entity_team: "platform" + instance_id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + updated_at: "2024-01-15T10:35:00Z" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-executions" + schema: + $ref: "#/components/schemas/WorkflowExecutionResponse" + description: Created + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Rerun a workflow execution + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/dependency-management/workflow-executions/{id}/steps: + get: + description: Get the real-time step status for a specific workflow execution instance from Datadog Workflow Automation. + operationId: ListExecutionSteps + parameters: + - $ref: "#/components/parameters/WorkflowExecutionId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + steps: + - completed_at: "2024-01-15T10:37:00Z" + id: "step-abc123" + name: "Create Pull Request" + started_at: "2024-01-15T10:36:00Z" + status: "COMPLETED" + id: "5a9c3b7e-2d1f-4a8b-b6c7-d8e9f0a12345" + type: "workflow-execution-steps" + schema: + $ref: "#/components/schemas/ListExecutionStepsResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List execution steps + tags: + - Dependency Management + x-unstable: "**Note**: This endpoint is in preview and is subject to change.\n If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." /api/v2/deployment_gates: get: description: |- @@ -147618,6 +148893,8 @@ tags: access to sensitive data. By defining Restricted Datasets, you can ensure that only specific teams or roles can view certain types of telemetry (for example, logs, traces, metrics, and RUM data). name: Datasets + - description: Manage AI-powered dependency upgrade workflows for your organization's repositories. + name: Dependency Management - description: |- Manage Deployment Gates using this API to reduce the likelihood and impact of incidents caused by deployments. See the [Deployment Gates documentation](https://docs.datadoghq.com/deployment_gates/) for more information. name: Deployment Gates diff --git a/examples/v2/dependency-management/CancelWorkflowExecution.rb b/examples/v2/dependency-management/CancelWorkflowExecution.rb new file mode 100644 index 000000000000..9e00a78ed2cc --- /dev/null +++ b/examples/v2/dependency-management/CancelWorkflowExecution.rb @@ -0,0 +1,8 @@ +# Cancel a workflow execution returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.cancel_workflow_execution".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +api_instance.cancel_workflow_execution("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/CancelWorkflowExecutions.rb b/examples/v2/dependency-management/CancelWorkflowExecutions.rb new file mode 100644 index 000000000000..622107863ea7 --- /dev/null +++ b/examples/v2/dependency-management/CancelWorkflowExecutions.rb @@ -0,0 +1,8 @@ +# Cancel workflow executions returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.cancel_workflow_executions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +p api_instance.cancel_workflow_executions("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/CreateAIWorkflow.rb b/examples/v2/dependency-management/CreateAIWorkflow.rb new file mode 100644 index 000000000000..9e55cc527af0 --- /dev/null +++ b/examples/v2/dependency-management/CreateAIWorkflow.rb @@ -0,0 +1,29 @@ +# Create an AI workflow returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_ai_workflow".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new + +body = DatadogAPIClient::V2::CreateAIWorkflowRequest.new({ + entities: [ + [ + DatadogAPIClient::V2::Entity.new({ + entity_kind: "service", + entity_name: "my-service", + entity_namespace: "default", + entity_team: "platform", + }), + ], + ], + filtering_logic: DatadogAPIClient::V2::FilteringLogic.new({}), + grouping_logic: "by-service", + idp_campaign_id: "campaign-abc123", + max_number_of_entities_per_session: 5, + prompt: "Upgrade the lodash dependency to version 4.17.21", + repository: "DataDog/datadog-agent", + user: "john.doe@example.com", + workflow_name: "Upgrade lodash to 4.17.21", +}) +p api_instance.create_ai_workflow(body) diff --git a/examples/v2/dependency-management/CreateWorkflowExecution.rb b/examples/v2/dependency-management/CreateWorkflowExecution.rb new file mode 100644 index 000000000000..edbb06a49d61 --- /dev/null +++ b/examples/v2/dependency-management/CreateWorkflowExecution.rb @@ -0,0 +1,8 @@ +# Create workflow executions returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_workflow_execution".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +p api_instance.create_workflow_execution("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/DeleteAIWorkflow.rb b/examples/v2/dependency-management/DeleteAIWorkflow.rb new file mode 100644 index 000000000000..5d7f036e1062 --- /dev/null +++ b/examples/v2/dependency-management/DeleteAIWorkflow.rb @@ -0,0 +1,8 @@ +# Delete an AI workflow returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_ai_workflow".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +api_instance.delete_ai_workflow("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/DeleteWorkflowExecutions.rb b/examples/v2/dependency-management/DeleteWorkflowExecutions.rb new file mode 100644 index 000000000000..b2a5f2086d23 --- /dev/null +++ b/examples/v2/dependency-management/DeleteWorkflowExecutions.rb @@ -0,0 +1,8 @@ +# Delete workflow executions returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_workflow_executions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +api_instance.delete_workflow_executions("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/GetAIWorkflow.rb b/examples/v2/dependency-management/GetAIWorkflow.rb new file mode 100644 index 000000000000..ae157663187e --- /dev/null +++ b/examples/v2/dependency-management/GetAIWorkflow.rb @@ -0,0 +1,8 @@ +# Get an AI workflow returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_ai_workflow".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +p api_instance.get_ai_workflow("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/ListAIWorkflowInstances.rb b/examples/v2/dependency-management/ListAIWorkflowInstances.rb new file mode 100644 index 000000000000..73f5ffba20a6 --- /dev/null +++ b/examples/v2/dependency-management/ListAIWorkflowInstances.rb @@ -0,0 +1,8 @@ +# List AI workflow instances returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ai_workflow_instances".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +p api_instance.list_ai_workflow_instances("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/ListAIWorkflows.rb b/examples/v2/dependency-management/ListAIWorkflows.rb new file mode 100644 index 000000000000..0389c5aced60 --- /dev/null +++ b/examples/v2/dependency-management/ListAIWorkflows.rb @@ -0,0 +1,8 @@ +# List AI workflows returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ai_workflows".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +p api_instance.list_ai_workflows() diff --git a/examples/v2/dependency-management/ListExecutionSteps.rb b/examples/v2/dependency-management/ListExecutionSteps.rb new file mode 100644 index 000000000000..61504fd3c0fc --- /dev/null +++ b/examples/v2/dependency-management/ListExecutionSteps.rb @@ -0,0 +1,8 @@ +# List execution steps returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_execution_steps".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +p api_instance.list_execution_steps("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/ListPROutputs.rb b/examples/v2/dependency-management/ListPROutputs.rb new file mode 100644 index 000000000000..474214fe4625 --- /dev/null +++ b/examples/v2/dependency-management/ListPROutputs.rb @@ -0,0 +1,8 @@ +# List PR outputs returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_pr_outputs".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +p api_instance.list_pr_outputs("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/RerunWorkflowExecution.rb b/examples/v2/dependency-management/RerunWorkflowExecution.rb new file mode 100644 index 000000000000..c71e49495aa8 --- /dev/null +++ b/examples/v2/dependency-management/RerunWorkflowExecution.rb @@ -0,0 +1,8 @@ +# Rerun a workflow execution returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.rerun_workflow_execution".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new +p api_instance.rerun_workflow_execution("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/dependency-management/UpdateAIWorkflow.rb b/examples/v2/dependency-management/UpdateAIWorkflow.rb new file mode 100644 index 000000000000..5fc436476ad6 --- /dev/null +++ b/examples/v2/dependency-management/UpdateAIWorkflow.rb @@ -0,0 +1,28 @@ +# Update an AI workflow returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_ai_workflow".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DependencyManagementAPI.new + +body = DatadogAPIClient::V2::UpdateAIWorkflowRequest.new({ + completed_at: "2024-06-01T12:00:00Z", + entities: [ + [ + DatadogAPIClient::V2::Entity.new({ + entity_kind: "service", + entity_name: "my-service", + entity_namespace: "default", + entity_team: "platform", + }), + ], + ], + filtering_logic: DatadogAPIClient::V2::FilteringLogic.new({}), + grouping_logic: "by-team", + max_number_of_entities_per_session: 10, + prompt: "Updated prompt for the dependency upgrade", + repository: "DataDog/datadog-agent", + workflow_name: "Updated workflow name", +}) +p api_instance.update_ai_workflow("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 4f6619e89ece..21e618cce61c 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2354,6 +2354,54 @@ "v2.CancelDataDeletionRequest" => { "id" => "String", }, + "v2.CreateAIWorkflow" => { + "body" => "CreateAIWorkflowRequest", + }, + "v2.ListAIWorkflows" => { + "idp_campaign_id" => "String", + "repository" => "String", + "user" => "String", + "completed" => "Boolean", + "created_after" => "Time", + "created_before" => "Time", + "limit" => "Integer", + "offset" => "Integer", + }, + "v2.DeleteAIWorkflow" => { + "id" => "UUID", + }, + "v2.GetAIWorkflow" => { + "id" => "UUID", + }, + "v2.UpdateAIWorkflow" => { + "id" => "UUID", + "body" => "UpdateAIWorkflowRequest", + }, + "v2.CancelWorkflowExecutions" => { + "id" => "UUID", + }, + "v2.DeleteWorkflowExecutions" => { + "id" => "UUID", + }, + "v2.CreateWorkflowExecution" => { + "id" => "UUID", + "max_instances" => "Integer", + }, + "v2.ListAIWorkflowInstances" => { + "id" => "UUID", + }, + "v2.CancelWorkflowExecution" => { + "id" => "UUID", + }, + "v2.ListPROutputs" => { + "id" => "UUID", + }, + "v2.RerunWorkflowExecution" => { + "id" => "UUID", + }, + "v2.ListExecutionSteps" => { + "id" => "UUID", + }, "v2.ListDeploymentGates" => { "page_cursor" => "String", "page_size" => "Integer", diff --git a/features/v2/dependency_management.feature b/features/v2/dependency_management.feature new file mode 100644 index 000000000000..916b13bb5f6a --- /dev/null +++ b/features/v2/dependency_management.feature @@ -0,0 +1,250 @@ +@endpoint(dependency-management) @endpoint(dependency-management-v2) +Feature: Dependency Management + Manage AI-powered dependency upgrade workflows for your organization's + repositories. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "DependencyManagement" API + + @generated @skip @team:DataDog/dependency-management + Scenario: Cancel a workflow execution returns "Conflict" response + Given operation "CancelWorkflowExecution" enabled + And new "CancelWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/dependency-management + Scenario: Cancel a workflow execution returns "No Content" response + Given operation "CancelWorkflowExecution" enabled + And new "CancelWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/dependency-management + Scenario: Cancel a workflow execution returns "Not Found" response + Given operation "CancelWorkflowExecution" enabled + And new "CancelWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: Cancel workflow executions returns "Not Found" response + Given operation "CancelWorkflowExecutions" enabled + And new "CancelWorkflowExecutions" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: Cancel workflow executions returns "OK" response + Given operation "CancelWorkflowExecutions" enabled + And new "CancelWorkflowExecutions" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dependency-management + Scenario: Create an AI workflow returns "Bad Request" response + Given operation "CreateAIWorkflow" enabled + And new "CreateAIWorkflow" request + And body with value {"entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-service", "idp_campaign_id": "campaign-abc123", "max_number_of_entities_per_session": 5, "prompt": "Upgrade the lodash dependency to version 4.17.21", "repository": "DataDog/datadog-agent", "user": "john.doe@example.com", "workflow_name": "Upgrade lodash to 4.17.21"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dependency-management + Scenario: Create an AI workflow returns "Created" response + Given operation "CreateAIWorkflow" enabled + And new "CreateAIWorkflow" request + And body with value {"entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-service", "idp_campaign_id": "campaign-abc123", "max_number_of_entities_per_session": 5, "prompt": "Upgrade the lodash dependency to version 4.17.21", "repository": "DataDog/datadog-agent", "user": "john.doe@example.com", "workflow_name": "Upgrade lodash to 4.17.21"} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/dependency-management + Scenario: Create workflow executions returns "Bad Request" response + Given operation "CreateWorkflowExecution" enabled + And new "CreateWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dependency-management + Scenario: Create workflow executions returns "Created" response + Given operation "CreateWorkflowExecution" enabled + And new "CreateWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/dependency-management + Scenario: Create workflow executions returns "Not Found" response + Given operation "CreateWorkflowExecution" enabled + And new "CreateWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: Delete an AI workflow returns "No Content" response + Given operation "DeleteAIWorkflow" enabled + And new "DeleteAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/dependency-management + Scenario: Delete an AI workflow returns "Not Found" response + Given operation "DeleteAIWorkflow" enabled + And new "DeleteAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: Delete workflow executions returns "No Content" response + Given operation "DeleteWorkflowExecutions" enabled + And new "DeleteWorkflowExecutions" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/dependency-management + Scenario: Delete workflow executions returns "Not Found" response + Given operation "DeleteWorkflowExecutions" enabled + And new "DeleteWorkflowExecutions" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: Get an AI workflow returns "Not Found" response + Given operation "GetAIWorkflow" enabled + And new "GetAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: Get an AI workflow returns "OK" response + Given operation "GetAIWorkflow" enabled + And new "GetAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dependency-management + Scenario: List AI workflow instances returns "Not Found" response + Given operation "ListAIWorkflowInstances" enabled + And new "ListAIWorkflowInstances" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: List AI workflow instances returns "OK" response + Given operation "ListAIWorkflowInstances" enabled + And new "ListAIWorkflowInstances" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dependency-management + Scenario: List AI workflows returns "Bad Request" response + Given operation "ListAIWorkflows" enabled + And new "ListAIWorkflows" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dependency-management + Scenario: List AI workflows returns "OK" response + Given operation "ListAIWorkflows" enabled + And new "ListAIWorkflows" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dependency-management + Scenario: List PR outputs returns "Not Found" response + Given operation "ListPROutputs" enabled + And new "ListPROutputs" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: List PR outputs returns "OK" response + Given operation "ListPROutputs" enabled + And new "ListPROutputs" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dependency-management + Scenario: List execution steps returns "Not Found" response + Given operation "ListExecutionSteps" enabled + And new "ListExecutionSteps" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: List execution steps returns "OK" response + Given operation "ListExecutionSteps" enabled + And new "ListExecutionSteps" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dependency-management + Scenario: Rerun a workflow execution returns "Conflict" response + Given operation "RerunWorkflowExecution" enabled + And new "RerunWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/dependency-management + Scenario: Rerun a workflow execution returns "Created" response + Given operation "RerunWorkflowExecution" enabled + And new "RerunWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/dependency-management + Scenario: Rerun a workflow execution returns "Not Found" response + Given operation "RerunWorkflowExecution" enabled + And new "RerunWorkflowExecution" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: Update an AI workflow returns "Bad Request" response + Given operation "UpdateAIWorkflow" enabled + And new "UpdateAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"completed_at": "2024-06-01T12:00:00Z", "entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-team", "max_number_of_entities_per_session": 10, "prompt": "Updated prompt for the dependency upgrade", "repository": "DataDog/datadog-agent", "workflow_name": "Updated workflow name"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dependency-management + Scenario: Update an AI workflow returns "Not Found" response + Given operation "UpdateAIWorkflow" enabled + And new "UpdateAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"completed_at": "2024-06-01T12:00:00Z", "entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-team", "max_number_of_entities_per_session": 10, "prompt": "Updated prompt for the dependency upgrade", "repository": "DataDog/datadog-agent", "workflow_name": "Updated workflow name"} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/dependency-management + Scenario: Update an AI workflow returns "OK" response + Given operation "UpdateAIWorkflow" enabled + And new "UpdateAIWorkflow" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"completed_at": "2024-06-01T12:00:00Z", "entities": [[{"entity_kind": "service", "entity_name": "my-service", "entity_namespace": "default", "entity_team": "platform"}]], "filtering_logic": {"teams": ["platform"]}, "grouping_logic": "by-team", "max_number_of_entities_per_session": 10, "prompt": "Updated prompt for the dependency upgrade", "repository": "DataDog/datadog-agent", "workflow_name": "Updated workflow name"} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index b9805518e9df..fe9bdd35158b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1701,6 +1701,92 @@ "type": "idempotent" } }, + "CreateAIWorkflow": { + "tag": "Dependency Management", + "undo": { + "operationId": "DeleteAIWorkflow", + "parameters": [ + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ListAIWorkflows": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, + "DeleteAIWorkflow": { + "tag": "Dependency Management", + "undo": { + "type": "idempotent" + } + }, + "GetAIWorkflow": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, + "UpdateAIWorkflow": { + "tag": "Dependency Management", + "undo": { + "type": "idempotent" + } + }, + "CancelWorkflowExecutions": { + "tag": "Dependency Management", + "undo": { + "type": "unsafe" + } + }, + "DeleteWorkflowExecutions": { + "tag": "Dependency Management", + "undo": { + "type": "idempotent" + } + }, + "CreateWorkflowExecution": { + "tag": "Dependency Management", + "undo": { + "operationId": "DeleteWorkflowExecutions", + "type": "unsafe" + } + }, + "ListAIWorkflowInstances": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, + "CancelWorkflowExecution": { + "tag": "Dependency Management", + "undo": { + "type": "unsafe" + } + }, + "ListPROutputs": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, + "RerunWorkflowExecution": { + "tag": "Dependency Management", + "undo": { + "type": "unsafe" + } + }, + "ListExecutionSteps": { + "tag": "Dependency Management", + "undo": { + "type": "safe" + } + }, "ListDeploymentGates": { "tag": "Deployment Gates", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 5f9e199c1b69..25196e0c7329 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -307,6 +307,19 @@ def initialize "v2.cancel_data_deletion_request": false, "v2.create_data_deletion_request": false, "v2.get_data_deletion_requests": false, + "v2.cancel_workflow_execution": false, + "v2.cancel_workflow_executions": false, + "v2.create_ai_workflow": false, + "v2.create_workflow_execution": false, + "v2.delete_ai_workflow": false, + "v2.delete_workflow_executions": false, + "v2.get_ai_workflow": false, + "v2.list_ai_workflow_instances": false, + "v2.list_ai_workflows": false, + "v2.list_execution_steps": false, + "v2.list_pr_outputs": false, + "v2.rerun_workflow_execution": false, + "v2.update_ai_workflow": false, "v2.create_deployment_gate": false, "v2.create_deployment_rule": false, "v2.delete_deployment_gate": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index a15a42597c0e..12fb3b265921 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1137,6 +1137,11 @@ def overrides "v2.active_billing_dimensions_type" => "ActiveBillingDimensionsType", "v2.add_member_team_request" => "AddMemberTeamRequest", "v2.advisory" => "Advisory", + "v2.ai_workflow_attributes" => "AIWorkflowAttributes", + "v2.ai_workflow_data" => "AIWorkflowData", + "v2.ai_workflow_data_type" => "AIWorkflowDataType", + "v2.ai_workflow_list_meta" => "AIWorkflowListMeta", + "v2.ai_workflow_response" => "AIWorkflowResponse", "v2.alert_event_attributes" => "AlertEventAttributes", "v2.alert_event_attributes_links_item" => "AlertEventAttributesLinksItem", "v2.alert_event_attributes_links_item_category" => "AlertEventAttributesLinksItemCategory", @@ -1595,6 +1600,8 @@ def overrides "v2.campaign_status" => "CampaignStatus", "v2.campaign_type" => "CampaignType", "v2.cancel_data_deletion_response_body" => "CancelDataDeletionResponseBody", + "v2.cancel_workflow_executions_data" => "CancelWorkflowExecutionsData", + "v2.cancel_workflow_executions_response" => "CancelWorkflowExecutionsResponse", "v2.case" => "Case", "v2.case3rd_party_ticket_status" => "Case3rdPartyTicketStatus", "v2.case_assign" => "CaseAssign", @@ -2010,6 +2017,7 @@ def overrides "v2.cpu" => "Cpu", "v2.create_action_connection_request" => "CreateActionConnectionRequest", "v2.create_action_connection_response" => "CreateActionConnectionResponse", + "v2.create_ai_workflow_request" => "CreateAIWorkflowRequest", "v2.create_allocations_request" => "CreateAllocationsRequest", "v2.create_app_request" => "CreateAppRequest", "v2.create_app_request_data" => "CreateAppRequestData", @@ -2168,6 +2176,7 @@ def overrides "v2.create_upload_response_data_type" => "CreateUploadResponseDataType", "v2.create_user_notification_channel_request" => "CreateUserNotificationChannelRequest", "v2.create_variant" => "CreateVariant", + "v2.create_workflow_executions_response" => "CreateWorkflowExecutionsResponse", "v2.create_workflow_request" => "CreateWorkflowRequest", "v2.create_workflow_response" => "CreateWorkflowResponse", "v2.creator" => "Creator", @@ -2518,6 +2527,7 @@ def overrides "v2.downtime_update_request" => "DowntimeUpdateRequest", "v2.downtime_update_request_attributes" => "DowntimeUpdateRequestAttributes", "v2.downtime_update_request_data" => "DowntimeUpdateRequestData", + "v2.entity" => "Entity", "v2.entity_attributes" => "EntityAttributes", "v2.entity_data" => "EntityData", "v2.entity_meta" => "EntityMeta", @@ -2691,6 +2701,8 @@ def overrides "v2.event_system_attributes_category" => "EventSystemAttributesCategory", "v2.event_system_attributes_integration_id" => "EventSystemAttributesIntegrationId", "v2.event_type" => "EventType", + "v2.execution_step" => "ExecutionStep", + "v2.execution_step_status" => "ExecutionStepStatus", "v2.exposure_rollout_step_request" => "ExposureRolloutStepRequest", "v2.exposure_schedule_request" => "ExposureScheduleRequest", "v2.facet_info_request" => "FacetInfoRequest", @@ -3449,6 +3461,7 @@ def overrides "v2.leaked_key_type" => "LeakedKeyType", "v2.library" => "Library", "v2.links" => "Links", + "v2.list_ai_workflows_response" => "ListAIWorkflowsResponse", "v2.list_allocations_response" => "ListAllocationsResponse", "v2.list_apis_response" => "ListAPIsResponse", "v2.list_apis_response_data" => "ListAPIsResponseData", @@ -3483,6 +3496,10 @@ def overrides "v2.list_entity_catalog_response_included_item" => "ListEntityCatalogResponseIncludedItem", "v2.list_entity_catalog_response_links" => "ListEntityCatalogResponseLinks", "v2.list_environments_response" => "ListEnvironmentsResponse", + "v2.list_execution_steps_attributes" => "ListExecutionStepsAttributes", + "v2.list_execution_steps_data" => "ListExecutionStepsData", + "v2.list_execution_steps_data_type" => "ListExecutionStepsDataType", + "v2.list_execution_steps_response" => "ListExecutionStepsResponse", "v2.list_feature_flags_response" => "ListFeatureFlagsResponse", "v2.list_findings_meta" => "ListFindingsMeta", "v2.list_findings_page" => "ListFindingsPage", @@ -3504,6 +3521,10 @@ def overrides "v2.list_pipelines_response" => "ListPipelinesResponse", "v2.list_pipelines_response_meta" => "ListPipelinesResponseMeta", "v2.list_powerpacks_response" => "ListPowerpacksResponse", + "v2.list_pr_outputs_attributes" => "ListPROutputsAttributes", + "v2.list_pr_outputs_data" => "ListPROutputsData", + "v2.list_pr_outputs_data_type" => "ListPROutputsDataType", + "v2.list_pr_outputs_response" => "ListPROutputsResponse", "v2.list_relation_catalog_response" => "ListRelationCatalogResponse", "v2.list_relation_catalog_response_links" => "ListRelationCatalogResponseLinks", "v2.list_rules_response" => "ListRulesResponse", @@ -3518,6 +3539,7 @@ def overrides "v2.list_teams_sort" => "ListTeamsSort", "v2.list_vulnerabilities_response" => "ListVulnerabilitiesResponse", "v2.list_vulnerable_assets_response" => "ListVulnerableAssetsResponse", + "v2.list_workflow_instances_response" => "ListWorkflowInstancesResponse", "v2.llm_obs_annotated_interaction_item" => "LLMObsAnnotatedInteractionItem", "v2.llm_obs_annotated_interactions_data_attributes_response" => "LLMObsAnnotatedInteractionsDataAttributesResponse", "v2.llm_obs_annotated_interactions_data_response" => "LLMObsAnnotatedInteractionsDataResponse", @@ -4658,6 +4680,9 @@ def overrides "v2.project_update" => "ProjectUpdate", "v2.project_update_attributes" => "ProjectUpdateAttributes", "v2.project_update_request" => "ProjectUpdateRequest", + "v2.pr_output" => "PROutput", + "v2.pr_output_ci_status" => "PROutputCiStatus", + "v2.pr_output_status" => "PROutputStatus", "v2.publish_app_response" => "PublishAppResponse", "v2.put_apps_datastore_item_response_array" => "PutAppsDatastoreItemResponseArray", "v2.put_apps_datastore_item_response_data" => "PutAppsDatastoreItemResponseData", @@ -6144,6 +6169,7 @@ def overrides "v2.unpublish_app_response" => "UnpublishAppResponse", "v2.update_action_connection_request" => "UpdateActionConnectionRequest", "v2.update_action_connection_response" => "UpdateActionConnectionResponse", + "v2.update_ai_workflow_request" => "UpdateAIWorkflowRequest", "v2.update_app_request" => "UpdateAppRequest", "v2.update_app_request_data" => "UpdateAppRequestData", "v2.update_app_request_data_attributes" => "UpdateAppRequestDataAttributes", @@ -6385,11 +6411,19 @@ def overrides "v2.workflow_data_type" => "WorkflowDataType", "v2.workflow_data_update" => "WorkflowDataUpdate", "v2.workflow_data_update_attributes" => "WorkflowDataUpdateAttributes", + "v2.workflow_execution_attributes" => "WorkflowExecutionAttributes", + "v2.workflow_execution_data" => "WorkflowExecutionData", + "v2.workflow_execution_data_type" => "WorkflowExecutionDataType", + "v2.workflow_execution_response" => "WorkflowExecutionResponse", "v2.workflow_instance_create_meta" => "WorkflowInstanceCreateMeta", "v2.workflow_instance_create_request" => "WorkflowInstanceCreateRequest", "v2.workflow_instance_create_response" => "WorkflowInstanceCreateResponse", "v2.workflow_instance_create_response_data" => "WorkflowInstanceCreateResponseData", "v2.workflow_instance_list_item" => "WorkflowInstanceListItem", + "v2.workflow_instance_summary_attributes" => "WorkflowInstanceSummaryAttributes", + "v2.workflow_instance_summary_attributes_status" => "WorkflowInstanceSummaryAttributesStatus", + "v2.workflow_instance_summary_data" => "WorkflowInstanceSummaryData", + "v2.workflow_instance_summary_data_type" => "WorkflowInstanceSummaryDataType", "v2.workflow_list_instances_response" => "WorkflowListInstancesResponse", "v2.workflow_list_instances_response_meta" => "WorkflowListInstancesResponseMeta", "v2.workflow_list_instances_response_meta_page" => "WorkflowListInstancesResponseMetaPage", @@ -6473,6 +6507,7 @@ def overrides "v2.dashboard_secure_embed_api" => "DashboardSecureEmbedAPI", "v2.data_deletion_api" => "DataDeletionAPI", "v2.datasets_api" => "DatasetsAPI", + "v2.dependency_management_api" => "DependencyManagementAPI", "v2.deployment_gates_api" => "DeploymentGatesAPI", "v2.domain_allowlist_api" => "DomainAllowlistAPI", "v2.dora_metrics_api" => "DORAMetricsAPI", diff --git a/lib/datadog_api_client/v2/api/dependency_management_api.rb b/lib/datadog_api_client/v2/api/dependency_management_api.rb new file mode 100644 index 000000000000..66d0e8ea4bf2 --- /dev/null +++ b/lib/datadog_api_client/v2/api/dependency_management_api.rb @@ -0,0 +1,986 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class DependencyManagementAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Cancel a workflow execution. + # + # @see #cancel_workflow_execution_with_http_info + def cancel_workflow_execution(id, opts = {}) + cancel_workflow_execution_with_http_info(id, opts) + nil + end + + # Cancel a workflow execution. + # + # Cancel a specific workflow execution instance. Returns 409 if the instance is not currently in a running state. + # + # @param id [UUID] The UUID of the workflow execution. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def cancel_workflow_execution_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.cancel_workflow_execution".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.cancel_workflow_execution") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.cancel_workflow_execution")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.cancel_workflow_execution ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.cancel_workflow_execution" + end + # resource path + local_var_path = '/api/v2/dependency-management/workflow-executions/{id}/cancel'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :cancel_workflow_execution, + :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: DependencyManagementAPI#cancel_workflow_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Cancel workflow executions. + # + # @see #cancel_workflow_executions_with_http_info + def cancel_workflow_executions(id, opts = {}) + data, _status_code, _headers = cancel_workflow_executions_with_http_info(id, opts) + data + end + + # Cancel workflow executions. + # + # Cancel all running workflow execution instances for the given AI workflow. + # + # @param id [UUID] The UUID of the AI workflow. + # @param opts [Hash] the optional parameters + # @return [Array<(CancelWorkflowExecutionsResponse, Integer, Hash)>] CancelWorkflowExecutionsResponse data, response status code and response headers + def cancel_workflow_executions_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.cancel_workflow_executions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.cancel_workflow_executions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.cancel_workflow_executions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.cancel_workflow_executions ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.cancel_workflow_executions" + end + # resource path + local_var_path = '/api/v2/dependency-management/ai-workflows/{id}/cancel'.sub('{id}', CGI.escape(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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CancelWorkflowExecutionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :cancel_workflow_executions, + :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: DependencyManagementAPI#cancel_workflow_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create an AI workflow. + # + # @see #create_ai_workflow_with_http_info + def create_ai_workflow(body, opts = {}) + data, _status_code, _headers = create_ai_workflow_with_http_info(body, opts) + data + end + + # Create an AI workflow. + # + # Create a new AI workflow for dependency management. This creates both the workflow definition and initializes its executions. + # + # @param body [CreateAIWorkflowRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AIWorkflowResponse, Integer, Hash)>] AIWorkflowResponse data, response status code and response headers + def create_ai_workflow_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_workflow".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_workflow") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_workflow")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.create_ai_workflow ...' + 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 DependencyManagementAPI.create_ai_workflow" + end + # resource path + local_var_path = '/api/v2/dependency-management/ai-workflow' + + # 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] || 'AIWorkflowResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_ai_workflow, + :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: DependencyManagementAPI#create_ai_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create workflow executions. + # + # @see #create_workflow_execution_with_http_info + def create_workflow_execution(id, opts = {}) + data, _status_code, _headers = create_workflow_execution_with_http_info(id, opts) + data + end + + # Create workflow executions. + # + # Create workflow executions for an AI workflow. One execution is created per entity group defined in the workflow. + # + # @param id [UUID] The UUID of the AI workflow. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :max_instances Maximum number of new workflow instances to start. Must be between 1 and 30. + # @return [Array<(CreateWorkflowExecutionsResponse, Integer, Hash)>] CreateWorkflowExecutionsResponse data, response status code and response headers + def create_workflow_execution_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_workflow_execution".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_workflow_execution") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_workflow_execution")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.create_workflow_execution ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.create_workflow_execution" + end + if @api_client.config.client_side_validation && !opts[:'max_instances'].nil? && opts[:'max_instances'] > 30 + fail ArgumentError, 'invalid value for "opts[:"max_instances"]" when calling DependencyManagementAPI.create_workflow_execution, must be smaller than or equal to 30.' + end + if @api_client.config.client_side_validation && !opts[:'max_instances'].nil? && opts[:'max_instances'] < 1 + fail ArgumentError, 'invalid value for "opts[:"max_instances"]" when calling DependencyManagementAPI.create_workflow_execution, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/dependency-management/ai-workflows/{id}/executions'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'max_instances'] = opts[:'max_instances'] if !opts[:'max_instances'].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] || 'CreateWorkflowExecutionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_workflow_execution, + :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: DependencyManagementAPI#create_workflow_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an AI workflow. + # + # @see #delete_ai_workflow_with_http_info + def delete_ai_workflow(id, opts = {}) + delete_ai_workflow_with_http_info(id, opts) + nil + end + + # Delete an AI workflow. + # + # Delete a specific AI workflow. This also removes the workflow from Datadog Workflow Automation. + # + # @param id [UUID] The UUID of the AI workflow. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_ai_workflow_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_workflow".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_workflow") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_workflow")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.delete_ai_workflow ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.delete_ai_workflow" + end + # resource path + local_var_path = '/api/v2/dependency-management/ai-workflows/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_ai_workflow, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DependencyManagementAPI#delete_ai_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete workflow executions. + # + # @see #delete_workflow_executions_with_http_info + def delete_workflow_executions(id, opts = {}) + delete_workflow_executions_with_http_info(id, opts) + nil + end + + # Delete workflow executions. + # + # Delete all workflow executions for a given AI workflow. Running instances are canceled before deletion. + # + # @param id [UUID] The UUID of the AI workflow. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_workflow_executions_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_workflow_executions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_workflow_executions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_workflow_executions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.delete_workflow_executions ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.delete_workflow_executions" + end + # resource path + local_var_path = '/api/v2/dependency-management/ai-workflows/{id}/executions'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_workflow_executions, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DependencyManagementAPI#delete_workflow_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an AI workflow. + # + # @see #get_ai_workflow_with_http_info + def get_ai_workflow(id, opts = {}) + data, _status_code, _headers = get_ai_workflow_with_http_info(id, opts) + data + end + + # Get an AI workflow. + # + # Get details of a specific AI workflow by its ID. + # + # @param id [UUID] The UUID of the AI workflow. + # @param opts [Hash] the optional parameters + # @return [Array<(AIWorkflowResponse, Integer, Hash)>] AIWorkflowResponse data, response status code and response headers + def get_ai_workflow_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_workflow".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_workflow") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_workflow")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.get_ai_workflow ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.get_ai_workflow" + end + # resource path + local_var_path = '/api/v2/dependency-management/ai-workflows/{id}'.sub('{id}', CGI.escape(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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AIWorkflowResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_ai_workflow, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DependencyManagementAPI#get_ai_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List AI workflow instances. + # + # @see #list_ai_workflow_instances_with_http_info + def list_ai_workflow_instances(id, opts = {}) + data, _status_code, _headers = list_ai_workflow_instances_with_http_info(id, opts) + data + end + + # List AI workflow instances. + # + # List all workflow instances for a given AI workflow with their live status from Workflow Automation and entity information. + # + # @param id [UUID] The UUID of the AI workflow. + # @param opts [Hash] the optional parameters + # @return [Array<(ListWorkflowInstancesResponse, Integer, Hash)>] ListWorkflowInstancesResponse data, response status code and response headers + def list_ai_workflow_instances_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_workflow_instances".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_workflow_instances") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_workflow_instances")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.list_ai_workflow_instances ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.list_ai_workflow_instances" + end + # resource path + local_var_path = '/api/v2/dependency-management/ai-workflows/{id}/instances'.sub('{id}', CGI.escape(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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListWorkflowInstancesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_ai_workflow_instances, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DependencyManagementAPI#list_ai_workflow_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List AI workflows. + # + # @see #list_ai_workflows_with_http_info + def list_ai_workflows(opts = {}) + data, _status_code, _headers = list_ai_workflows_with_http_info(opts) + data + end + + # List AI workflows. + # + # List AI workflows for the organization with optional filters. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :idp_campaign_id Filter workflows by IDP campaign ID. + # @option opts [String] :repository Filter workflows by repository name (owner/repo format). + # @option opts [String] :user Filter workflows by the username of the creator. + # @option opts [Boolean] :completed Filter workflows by completion status. Use `true` to return only completed workflows, `false` for incomplete. + # @option opts [Time] :created_after Filter workflows created after this timestamp (RFC3339 format). + # @option opts [Time] :created_before Filter workflows created before this timestamp (RFC3339 format). + # @option opts [Integer] :limit Maximum number of workflows to return. Defaults to 50, maximum 100. + # @option opts [Integer] :offset Number of workflows to skip for pagination. + # @return [Array<(ListAIWorkflowsResponse, Integer, Hash)>] ListAIWorkflowsResponse data, response status code and response headers + def list_ai_workflows_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_workflows".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_workflows") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_workflows")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.list_ai_workflows ...' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DependencyManagementAPI.list_ai_workflows, must be smaller than or equal to 100.' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DependencyManagementAPI.list_ai_workflows, must be greater than or equal to 1.' + end + if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 + fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling DependencyManagementAPI.list_ai_workflows, must be greater than or equal to 0.' + end + # resource path + local_var_path = '/api/v2/dependency-management/ai-workflows' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'idp_campaign_id'] = opts[:'idp_campaign_id'] if !opts[:'idp_campaign_id'].nil? + query_params[:'repository'] = opts[:'repository'] if !opts[:'repository'].nil? + query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil? + query_params[:'completed'] = opts[:'completed'] if !opts[:'completed'].nil? + query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil? + query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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] || 'ListAIWorkflowsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_ai_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" + ) + + 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: DependencyManagementAPI#list_ai_workflows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List execution steps. + # + # @see #list_execution_steps_with_http_info + def list_execution_steps(id, opts = {}) + data, _status_code, _headers = list_execution_steps_with_http_info(id, opts) + data + end + + # List execution steps. + # + # Get the real-time step status for a specific workflow execution instance from Datadog Workflow Automation. + # + # @param id [UUID] The UUID of the workflow execution. + # @param opts [Hash] the optional parameters + # @return [Array<(ListExecutionStepsResponse, Integer, Hash)>] ListExecutionStepsResponse data, response status code and response headers + def list_execution_steps_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_execution_steps".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_execution_steps") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_execution_steps")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.list_execution_steps ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.list_execution_steps" + end + # resource path + local_var_path = '/api/v2/dependency-management/workflow-executions/{id}/steps'.sub('{id}', CGI.escape(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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListExecutionStepsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_execution_steps, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DependencyManagementAPI#list_execution_steps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List PR outputs. + # + # @see #list_pr_outputs_with_http_info + def list_pr_outputs(id, opts = {}) + data, _status_code, _headers = list_pr_outputs_with_http_info(id, opts) + data + end + + # List PR outputs. + # + # Get the pull request outputs for a specific workflow execution. Includes PR URL, status, and CI status enriched from GitHub. + # + # @param id [UUID] The UUID of the workflow execution. + # @param opts [Hash] the optional parameters + # @return [Array<(ListPROutputsResponse, Integer, Hash)>] ListPROutputsResponse data, response status code and response headers + def list_pr_outputs_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_pr_outputs".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_pr_outputs") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_pr_outputs")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.list_pr_outputs ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.list_pr_outputs" + end + # resource path + local_var_path = '/api/v2/dependency-management/workflow-executions/{id}/pr-outputs'.sub('{id}', CGI.escape(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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListPROutputsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_pr_outputs, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DependencyManagementAPI#list_pr_outputs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Rerun a workflow execution. + # + # @see #rerun_workflow_execution_with_http_info + def rerun_workflow_execution(id, opts = {}) + data, _status_code, _headers = rerun_workflow_execution_with_http_info(id, opts) + data + end + + # Rerun a workflow execution. + # + # Rerun a failed or canceled workflow execution. This replaces the existing execution with a new one using the same entities. + # + # @param id [UUID] The UUID of the workflow execution. + # @param opts [Hash] the optional parameters + # @return [Array<(WorkflowExecutionResponse, Integer, Hash)>] WorkflowExecutionResponse data, response status code and response headers + def rerun_workflow_execution_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.rerun_workflow_execution".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.rerun_workflow_execution") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.rerun_workflow_execution")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.rerun_workflow_execution ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.rerun_workflow_execution" + end + # resource path + local_var_path = '/api/v2/dependency-management/workflow-executions/{id}/rerun'.sub('{id}', CGI.escape(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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'WorkflowExecutionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :rerun_workflow_execution, + :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: DependencyManagementAPI#rerun_workflow_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an AI workflow. + # + # @see #update_ai_workflow_with_http_info + def update_ai_workflow(id, body, opts = {}) + data, _status_code, _headers = update_ai_workflow_with_http_info(id, body, opts) + data + end + + # Update an AI workflow. + # + # Update the configuration of an existing AI workflow. Only the provided fields are updated. + # + # @param id [UUID] The UUID of the AI workflow. + # @param body [UpdateAIWorkflowRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AIWorkflowResponse, Integer, Hash)>] AIWorkflowResponse data, response status code and response headers + def update_ai_workflow_with_http_info(id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_workflow".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_workflow") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_workflow")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DependencyManagementAPI.update_ai_workflow ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling DependencyManagementAPI.update_ai_workflow" + 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 DependencyManagementAPI.update_ai_workflow" + end + # resource path + local_var_path = '/api/v2/dependency-management/ai-workflows/{id}'.sub('{id}', CGI.escape(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] || 'AIWorkflowResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_ai_workflow, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DependencyManagementAPI#update_ai_workflow\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/ai_workflow_attributes.rb b/lib/datadog_api_client/v2/models/ai_workflow_attributes.rb new file mode 100644 index 000000000000..3361326bff41 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_workflow_attributes.rb @@ -0,0 +1,374 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an AI workflow. + class AIWorkflowAttributes + include BaseGenericModel + + # Timestamp when the workflow completed. Null if not yet completed. + attr_accessor :completed_at + + # Timestamp when the workflow was created. + attr_reader :created_at + + # A list of entity groups. Each group is processed in a separate workflow execution. + attr_reader :entities + + # Arbitrary filtering criteria used to select entities for the workflow. + attr_reader :filtering_logic + + # The logic used to group entities into execution batches. + attr_reader :grouping_logic + + # The IDP campaign ID associated with this workflow. + attr_reader :idp_campaign_id + + # Maximum number of entities processed in a single execution session. + attr_reader :max_number_of_entities_per_session + + # The AI prompt guiding the dependency upgrade automation. + attr_reader :prompt + + # The target repository in owner/repo format. + attr_reader :repository + + # Timestamp when the workflow was last updated. + attr_reader :updated_at + + # The username of the user who created the workflow. + attr_reader :user + + # The UUID of the underlying Datadog Workflow Automation workflow. + attr_reader :workflow_id + + # The human-readable name of the workflow. + attr_reader :workflow_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'completed_at' => :'completed_at', + :'created_at' => :'created_at', + :'entities' => :'entities', + :'filtering_logic' => :'filtering_logic', + :'grouping_logic' => :'grouping_logic', + :'idp_campaign_id' => :'idp_campaign_id', + :'max_number_of_entities_per_session' => :'max_number_of_entities_per_session', + :'prompt' => :'prompt', + :'repository' => :'repository', + :'updated_at' => :'updated_at', + :'user' => :'user', + :'workflow_id' => :'workflow_id', + :'workflow_name' => :'workflow_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'completed_at' => :'Time', + :'created_at' => :'Time', + :'entities' => :'Array>', + :'filtering_logic' => :'FilteringLogic', + :'grouping_logic' => :'String', + :'idp_campaign_id' => :'String', + :'max_number_of_entities_per_session' => :'Integer', + :'prompt' => :'String', + :'repository' => :'String', + :'updated_at' => :'Time', + :'user' => :'String', + :'workflow_id' => :'UUID', + :'workflow_name' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'completed_at', + ]) + 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::AIWorkflowAttributes` 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?(:'completed_at') + self.completed_at = attributes[:'completed_at'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'entities') + if (value = attributes[:'entities']).is_a?(Array) + self.entities = value + end + end + + if attributes.key?(:'filtering_logic') + self.filtering_logic = attributes[:'filtering_logic'] + end + + if attributes.key?(:'grouping_logic') + self.grouping_logic = attributes[:'grouping_logic'] + end + + if attributes.key?(:'idp_campaign_id') + self.idp_campaign_id = attributes[:'idp_campaign_id'] + end + + if attributes.key?(:'max_number_of_entities_per_session') + self.max_number_of_entities_per_session = attributes[:'max_number_of_entities_per_session'] + end + + if attributes.key?(:'prompt') + self.prompt = attributes[:'prompt'] + end + + if attributes.key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + + if attributes.key?(:'workflow_id') + self.workflow_id = attributes[:'workflow_id'] + end + + if attributes.key?(:'workflow_name') + self.workflow_name = attributes[:'workflow_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @entities.nil? + return false if @filtering_logic.nil? + return false if @grouping_logic.nil? + return false if @idp_campaign_id.nil? + return false if @max_number_of_entities_per_session.nil? + return false if @prompt.nil? + return false if @repository.nil? + return false if @updated_at.nil? + return false if @user.nil? + return false if @workflow_id.nil? + return false if @workflow_name.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param entities [Object] Object to be assigned + # @!visibility private + def entities=(entities) + if entities.nil? + fail ArgumentError, 'invalid value for "entities", entities cannot be nil.' + end + @entities = entities + end + + # Custom attribute writer method with validation + # @param filtering_logic [Object] Object to be assigned + # @!visibility private + def filtering_logic=(filtering_logic) + if filtering_logic.nil? + fail ArgumentError, 'invalid value for "filtering_logic", filtering_logic cannot be nil.' + end + @filtering_logic = filtering_logic + end + + # Custom attribute writer method with validation + # @param grouping_logic [Object] Object to be assigned + # @!visibility private + def grouping_logic=(grouping_logic) + if grouping_logic.nil? + fail ArgumentError, 'invalid value for "grouping_logic", grouping_logic cannot be nil.' + end + @grouping_logic = grouping_logic + end + + # Custom attribute writer method with validation + # @param idp_campaign_id [Object] Object to be assigned + # @!visibility private + def idp_campaign_id=(idp_campaign_id) + if idp_campaign_id.nil? + fail ArgumentError, 'invalid value for "idp_campaign_id", idp_campaign_id cannot be nil.' + end + @idp_campaign_id = idp_campaign_id + end + + # Custom attribute writer method with validation + # @param max_number_of_entities_per_session [Object] Object to be assigned + # @!visibility private + def max_number_of_entities_per_session=(max_number_of_entities_per_session) + if max_number_of_entities_per_session.nil? + fail ArgumentError, 'invalid value for "max_number_of_entities_per_session", max_number_of_entities_per_session cannot be nil.' + end + @max_number_of_entities_per_session = max_number_of_entities_per_session + end + + # Custom attribute writer method with validation + # @param prompt [Object] Object to be assigned + # @!visibility private + def prompt=(prompt) + if prompt.nil? + fail ArgumentError, 'invalid value for "prompt", prompt cannot be nil.' + end + @prompt = prompt + end + + # Custom attribute writer method with validation + # @param repository [Object] Object to be assigned + # @!visibility private + def repository=(repository) + if repository.nil? + fail ArgumentError, 'invalid value for "repository", repository cannot be nil.' + end + @repository = repository + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + end + + # Custom attribute writer method with validation + # @param user [Object] Object to be assigned + # @!visibility private + def user=(user) + if user.nil? + fail ArgumentError, 'invalid value for "user", user cannot be nil.' + end + @user = user + 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 + + # Custom attribute writer method with validation + # @param workflow_name [Object] Object to be assigned + # @!visibility private + def workflow_name=(workflow_name) + if workflow_name.nil? + fail ArgumentError, 'invalid value for "workflow_name", workflow_name cannot be nil.' + end + @workflow_name = workflow_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 && + completed_at == o.completed_at && + created_at == o.created_at && + entities == o.entities && + filtering_logic == o.filtering_logic && + grouping_logic == o.grouping_logic && + idp_campaign_id == o.idp_campaign_id && + max_number_of_entities_per_session == o.max_number_of_entities_per_session && + prompt == o.prompt && + repository == o.repository && + updated_at == o.updated_at && + user == o.user && + workflow_id == o.workflow_id && + workflow_name == o.workflow_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [completed_at, created_at, entities, filtering_logic, grouping_logic, idp_campaign_id, max_number_of_entities_per_session, prompt, repository, updated_at, user, workflow_id, workflow_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_workflow_data.rb b/lib/datadog_api_client/v2/models/ai_workflow_data.rb new file mode 100644 index 000000000000..0fec8e9dbfe6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_workflow_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 + # A single AI workflow resource. + class AIWorkflowData + include BaseGenericModel + + # Attributes of an AI workflow. + attr_reader :attributes + + # The unique identifier of the AI workflow. + attr_reader :id + + # The resource type for AI workflows. + 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' => :'AIWorkflowAttributes', + :'id' => :'UUID', + :'type' => :'AIWorkflowDataType' + } + 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::AIWorkflowData` 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/ai_workflow_data_type.rb b/lib/datadog_api_client/v2/models/ai_workflow_data_type.rb new file mode 100644 index 000000000000..09bf20661214 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_workflow_data_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 resource type for AI workflows. + class AIWorkflowDataType + include BaseEnumModel + + AI_WORKFLOWS = "ai-workflows".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ai_workflow_list_meta.rb b/lib/datadog_api_client/v2/models/ai_workflow_list_meta.rb new file mode 100644 index 000000000000..f609a3c9e0a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_workflow_list_meta.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 + # Metadata for the list AI workflows response. + class AIWorkflowListMeta + include BaseGenericModel + + # Total number of AI workflows matching the filter criteria. + attr_reader :total + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total' => :'total' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total' => :'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::AIWorkflowListMeta` 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') + self.total = attributes[:'total'] + 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 @total.nil? + true + end + + # Custom attribute writer method with validation + # @param total [Object] Object to be assigned + # @!visibility private + def total=(total) + if total.nil? + fail ArgumentError, 'invalid value for "total", total cannot be nil.' + end + @total = total + 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 == o.total && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_workflow_response.rb b/lib/datadog_api_client/v2/models/ai_workflow_response.rb new file mode 100644 index 000000000000..f8923765d865 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_workflow_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single AI workflow. + class AIWorkflowResponse + include BaseGenericModel + + # A single AI workflow resource. + 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' => :'AIWorkflowData' + } + 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::AIWorkflowResponse` 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/cancel_workflow_executions_data.rb b/lib/datadog_api_client/v2/models/cancel_workflow_executions_data.rb new file mode 100644 index 000000000000..11b045e62590 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cancel_workflow_executions_data.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 + # Data returned after canceling workflow executions. + class CancelWorkflowExecutionsData + include BaseGenericModel + + # The number of running instances that were successfully canceled. + attr_reader :canceled_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'canceled_count' => :'canceled_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'canceled_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::CancelWorkflowExecutionsData` 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?(:'canceled_count') + self.canceled_count = attributes[:'canceled_count'] + 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 @canceled_count.nil? + true + end + + # Custom attribute writer method with validation + # @param canceled_count [Object] Object to be assigned + # @!visibility private + def canceled_count=(canceled_count) + if canceled_count.nil? + fail ArgumentError, 'invalid value for "canceled_count", canceled_count cannot be nil.' + end + @canceled_count = canceled_count + 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 && + canceled_count == o.canceled_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [canceled_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cancel_workflow_executions_response.rb b/lib/datadog_api_client/v2/models/cancel_workflow_executions_response.rb new file mode 100644 index 000000000000..6687a408d9ae --- /dev/null +++ b/lib/datadog_api_client/v2/models/cancel_workflow_executions_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response from canceling all running workflow execution instances. + class CancelWorkflowExecutionsResponse + include BaseGenericModel + + # Data returned after canceling workflow executions. + 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' => :'CancelWorkflowExecutionsData' + } + 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::CancelWorkflowExecutionsResponse` 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/create_ai_workflow_request.rb b/lib/datadog_api_client/v2/models/create_ai_workflow_request.rb new file mode 100644 index 000000000000..06c0ac5e398c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_ai_workflow_request.rb @@ -0,0 +1,293 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for creating a new AI workflow. + class CreateAIWorkflowRequest + include BaseGenericModel + + # A list of entity groups. Each group is processed in a separate workflow execution. + attr_reader :entities + + # Arbitrary filtering criteria used to select entities for the workflow. + attr_reader :filtering_logic + + # The logic used to group entities into batches for execution. + attr_reader :grouping_logic + + # The IDP campaign ID associated with this workflow. + attr_reader :idp_campaign_id + + # Maximum number of entities allowed per execution session. + attr_reader :max_number_of_entities_per_session + + # The AI prompt used to guide the dependency upgrade automation. + attr_reader :prompt + + # The target repository in owner/repo format. + attr_reader :repository + + # The username of the user initiating the workflow. + attr_reader :user + + # A human-readable name for the workflow. + attr_reader :workflow_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'entities' => :'entities', + :'filtering_logic' => :'filtering_logic', + :'grouping_logic' => :'grouping_logic', + :'idp_campaign_id' => :'idp_campaign_id', + :'max_number_of_entities_per_session' => :'max_number_of_entities_per_session', + :'prompt' => :'prompt', + :'repository' => :'repository', + :'user' => :'user', + :'workflow_name' => :'workflow_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'entities' => :'Array>', + :'filtering_logic' => :'FilteringLogic', + :'grouping_logic' => :'String', + :'idp_campaign_id' => :'String', + :'max_number_of_entities_per_session' => :'Integer', + :'prompt' => :'String', + :'repository' => :'String', + :'user' => :'String', + :'workflow_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateAIWorkflowRequest` 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?(:'entities') + if (value = attributes[:'entities']).is_a?(Array) + self.entities = value + end + end + + if attributes.key?(:'filtering_logic') + self.filtering_logic = attributes[:'filtering_logic'] + end + + if attributes.key?(:'grouping_logic') + self.grouping_logic = attributes[:'grouping_logic'] + end + + if attributes.key?(:'idp_campaign_id') + self.idp_campaign_id = attributes[:'idp_campaign_id'] + end + + if attributes.key?(:'max_number_of_entities_per_session') + self.max_number_of_entities_per_session = attributes[:'max_number_of_entities_per_session'] + end + + if attributes.key?(:'prompt') + self.prompt = attributes[:'prompt'] + end + + if attributes.key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + + if attributes.key?(:'workflow_name') + self.workflow_name = attributes[:'workflow_name'] + 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 @entities.nil? + return false if @filtering_logic.nil? + return false if @grouping_logic.nil? + return false if @idp_campaign_id.nil? + return false if @max_number_of_entities_per_session.nil? + return false if @prompt.nil? + return false if @repository.nil? + return false if @user.nil? + return false if @workflow_name.nil? + true + end + + # Custom attribute writer method with validation + # @param entities [Object] Object to be assigned + # @!visibility private + def entities=(entities) + if entities.nil? + fail ArgumentError, 'invalid value for "entities", entities cannot be nil.' + end + @entities = entities + end + + # Custom attribute writer method with validation + # @param filtering_logic [Object] Object to be assigned + # @!visibility private + def filtering_logic=(filtering_logic) + if filtering_logic.nil? + fail ArgumentError, 'invalid value for "filtering_logic", filtering_logic cannot be nil.' + end + @filtering_logic = filtering_logic + end + + # Custom attribute writer method with validation + # @param grouping_logic [Object] Object to be assigned + # @!visibility private + def grouping_logic=(grouping_logic) + if grouping_logic.nil? + fail ArgumentError, 'invalid value for "grouping_logic", grouping_logic cannot be nil.' + end + @grouping_logic = grouping_logic + end + + # Custom attribute writer method with validation + # @param idp_campaign_id [Object] Object to be assigned + # @!visibility private + def idp_campaign_id=(idp_campaign_id) + if idp_campaign_id.nil? + fail ArgumentError, 'invalid value for "idp_campaign_id", idp_campaign_id cannot be nil.' + end + @idp_campaign_id = idp_campaign_id + end + + # Custom attribute writer method with validation + # @param max_number_of_entities_per_session [Object] Object to be assigned + # @!visibility private + def max_number_of_entities_per_session=(max_number_of_entities_per_session) + if max_number_of_entities_per_session.nil? + fail ArgumentError, 'invalid value for "max_number_of_entities_per_session", max_number_of_entities_per_session cannot be nil.' + end + @max_number_of_entities_per_session = max_number_of_entities_per_session + end + + # Custom attribute writer method with validation + # @param prompt [Object] Object to be assigned + # @!visibility private + def prompt=(prompt) + if prompt.nil? + fail ArgumentError, 'invalid value for "prompt", prompt cannot be nil.' + end + @prompt = prompt + end + + # Custom attribute writer method with validation + # @param repository [Object] Object to be assigned + # @!visibility private + def repository=(repository) + if repository.nil? + fail ArgumentError, 'invalid value for "repository", repository cannot be nil.' + end + @repository = repository + end + + # Custom attribute writer method with validation + # @param user [Object] Object to be assigned + # @!visibility private + def user=(user) + if user.nil? + fail ArgumentError, 'invalid value for "user", user cannot be nil.' + end + @user = user + end + + # Custom attribute writer method with validation + # @param workflow_name [Object] Object to be assigned + # @!visibility private + def workflow_name=(workflow_name) + if workflow_name.nil? + fail ArgumentError, 'invalid value for "workflow_name", workflow_name cannot be nil.' + end + @workflow_name = workflow_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 && + entities == o.entities && + filtering_logic == o.filtering_logic && + grouping_logic == o.grouping_logic && + idp_campaign_id == o.idp_campaign_id && + max_number_of_entities_per_session == o.max_number_of_entities_per_session && + prompt == o.prompt && + repository == o.repository && + user == o.user && + workflow_name == o.workflow_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [entities, filtering_logic, grouping_logic, idp_campaign_id, max_number_of_entities_per_session, prompt, repository, user, workflow_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_workflow_executions_response.rb b/lib/datadog_api_client/v2/models/create_workflow_executions_response.rb new file mode 100644 index 000000000000..98a885e04d0c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_workflow_executions_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of created workflow executions. + class CreateWorkflowExecutionsResponse + include BaseGenericModel + + # List of created workflow execution resources. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateWorkflowExecutionsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity.rb b/lib/datadog_api_client/v2/models/entity.rb new file mode 100644 index 000000000000..3e3a541b26c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity.rb @@ -0,0 +1,153 @@ +=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 + # An entity participating in the dependency upgrade workflow. + class Entity + include BaseGenericModel + + # The kind of the entity (for example, service or package). + attr_accessor :entity_kind + + # The name of the entity. + attr_reader :entity_name + + # The namespace of the entity. + attr_accessor :entity_namespace + + # The team that owns the entity. + attr_accessor :entity_team + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'entity_kind' => :'entity_kind', + :'entity_name' => :'entity_name', + :'entity_namespace' => :'entity_namespace', + :'entity_team' => :'entity_team' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'entity_kind' => :'String', + :'entity_name' => :'String', + :'entity_namespace' => :'String', + :'entity_team' => :'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::Entity` 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?(:'entity_kind') + self.entity_kind = attributes[:'entity_kind'] + end + + if attributes.key?(:'entity_name') + self.entity_name = attributes[:'entity_name'] + end + + if attributes.key?(:'entity_namespace') + self.entity_namespace = attributes[:'entity_namespace'] + end + + if attributes.key?(:'entity_team') + self.entity_team = attributes[:'entity_team'] + 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 @entity_name.nil? + true + end + + # Custom attribute writer method with validation + # @param entity_name [Object] Object to be assigned + # @!visibility private + def entity_name=(entity_name) + if entity_name.nil? + fail ArgumentError, 'invalid value for "entity_name", entity_name cannot be nil.' + end + @entity_name = entity_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 && + entity_kind == o.entity_kind && + entity_name == o.entity_name && + entity_namespace == o.entity_namespace && + entity_team == o.entity_team && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [entity_kind, entity_name, entity_namespace, entity_team, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/execution_step.rb b/lib/datadog_api_client/v2/models/execution_step.rb new file mode 100644 index 000000000000..de17abd79434 --- /dev/null +++ b/lib/datadog_api_client/v2/models/execution_step.rb @@ -0,0 +1,204 @@ +=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 single step in a workflow execution. + class ExecutionStep + include BaseGenericModel + + # Timestamp when the step completed. Null if not yet completed. + attr_accessor :completed_at + + # Error message if the step failed. + attr_accessor :error + + # The unique identifier of the execution step. + attr_reader :id + + # The name of the step. + attr_reader :name + + # Timestamp when the step started. Null if not yet started. + attr_accessor :started_at + + # The current status of the step. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'completed_at' => :'completed_at', + :'error' => :'error', + :'id' => :'id', + :'name' => :'name', + :'started_at' => :'started_at', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'completed_at' => :'Time', + :'error' => :'String', + :'id' => :'String', + :'name' => :'String', + :'started_at' => :'Time', + :'status' => :'ExecutionStepStatus' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'completed_at', + :'started_at', + ]) + 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::ExecutionStep` 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?(:'completed_at') + self.completed_at = attributes[:'completed_at'] + end + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @name.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + completed_at == o.completed_at && + error == o.error && + id == o.id && + name == o.name && + started_at == o.started_at && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [completed_at, error, id, name, started_at, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/execution_step_status.rb b/lib/datadog_api_client/v2/models/execution_step_status.rb new file mode 100644 index 000000000000..9f5b33b908ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/execution_step_status.rb @@ -0,0 +1,30 @@ +=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 current status of the step. + class ExecutionStepStatus + include BaseEnumModel + + PENDING = "PENDING".freeze + RUNNING = "RUNNING".freeze + COMPLETED = "COMPLETED".freeze + FAILED = "FAILED".freeze + CANCELED = "CANCELED".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/list_ai_workflows_response.rb b/lib/datadog_api_client/v2/models/list_ai_workflows_response.rb new file mode 100644 index 000000000000..12fff9db7f85 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_ai_workflows_response.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 + # Response containing a list of AI workflows. + class ListAIWorkflowsResponse + include BaseGenericModel + + # List of AI workflow resources. + attr_reader :data + + # Metadata for the list AI workflows response. + attr_reader :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' => :'AIWorkflowListMeta' + } + 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::ListAIWorkflowsResponse` 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 + + # 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? + return false if @meta.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 + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + 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_execution_steps_attributes.rb b/lib/datadog_api_client/v2/models/list_execution_steps_attributes.rb new file mode 100644 index 000000000000..7a65a8159889 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_execution_steps_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an execution steps response. + class ListExecutionStepsAttributes + include BaseGenericModel + + # The list of steps for the workflow execution. + attr_reader :steps + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'steps' => :'steps' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'steps' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListExecutionStepsAttributes` 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?(:'steps') + if (value = attributes[:'steps']).is_a?(Array) + self.steps = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @steps.nil? + true + end + + # Custom attribute writer method with validation + # @param steps [Object] Object to be assigned + # @!visibility private + def steps=(steps) + if steps.nil? + fail ArgumentError, 'invalid value for "steps", steps cannot be nil.' + end + @steps = steps + 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 && + steps == o.steps && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [steps, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_execution_steps_data.rb b/lib/datadog_api_client/v2/models/list_execution_steps_data.rb new file mode 100644 index 000000000000..a94bf35f0dc8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_execution_steps_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 + # Data for execution steps response. + class ListExecutionStepsData + include BaseGenericModel + + # Attributes of an execution steps response. + attr_reader :attributes + + # The unique identifier of the workflow execution. + attr_reader :id + + # The resource type for workflow execution steps. + 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' => :'ListExecutionStepsAttributes', + :'id' => :'UUID', + :'type' => :'ListExecutionStepsDataType' + } + 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::ListExecutionStepsData` 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/list_execution_steps_data_type.rb b/lib/datadog_api_client/v2/models/list_execution_steps_data_type.rb new file mode 100644 index 000000000000..6de285c9f74f --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_execution_steps_data_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 resource type for workflow execution steps. + class ListExecutionStepsDataType + include BaseEnumModel + + WORKFLOW_EXECUTION_STEPS = "workflow-execution-steps".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/list_execution_steps_response.rb b/lib/datadog_api_client/v2/models/list_execution_steps_response.rb new file mode 100644 index 000000000000..294498bf1aec --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_execution_steps_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the execution steps for a workflow execution. + class ListExecutionStepsResponse + include BaseGenericModel + + # Data for execution steps response. + 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' => :'ListExecutionStepsData' + } + 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::ListExecutionStepsResponse` 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/list_pr_outputs_attributes.rb b/lib/datadog_api_client/v2/models/list_pr_outputs_attributes.rb new file mode 100644 index 000000000000..b8ed3dd5be5c --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_pr_outputs_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a PR outputs response. + class ListPROutputsAttributes + include BaseGenericModel + + # The list of pull requests created by the workflow execution. + attr_reader :pr_outputs + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'pr_outputs' => :'pr_outputs' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'pr_outputs' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListPROutputsAttributes` 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?(:'pr_outputs') + if (value = attributes[:'pr_outputs']).is_a?(Array) + self.pr_outputs = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @pr_outputs.nil? + true + end + + # Custom attribute writer method with validation + # @param pr_outputs [Object] Object to be assigned + # @!visibility private + def pr_outputs=(pr_outputs) + if pr_outputs.nil? + fail ArgumentError, 'invalid value for "pr_outputs", pr_outputs cannot be nil.' + end + @pr_outputs = pr_outputs + 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 && + pr_outputs == o.pr_outputs && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [pr_outputs, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_pr_outputs_data.rb b/lib/datadog_api_client/v2/models/list_pr_outputs_data.rb new file mode 100644 index 000000000000..f60dfe6d862e --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_pr_outputs_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 + # Data for PR outputs response. + class ListPROutputsData + include BaseGenericModel + + # Attributes of a PR outputs response. + attr_reader :attributes + + # The unique identifier of the workflow execution. + attr_reader :id + + # The resource type for workflow execution PR outputs. + 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' => :'ListPROutputsAttributes', + :'id' => :'UUID', + :'type' => :'ListPROutputsDataType' + } + 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::ListPROutputsData` 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/list_pr_outputs_data_type.rb b/lib/datadog_api_client/v2/models/list_pr_outputs_data_type.rb new file mode 100644 index 000000000000..6e9ab03948d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_pr_outputs_data_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 resource type for workflow execution PR outputs. + class ListPROutputsDataType + include BaseEnumModel + + WORKFLOW_EXECUTION_PR_OUTPUTS = "workflow-execution-pr-outputs".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/list_pr_outputs_response.rb b/lib/datadog_api_client/v2/models/list_pr_outputs_response.rb new file mode 100644 index 000000000000..97c1cd638380 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_pr_outputs_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the PR outputs for a workflow execution. + class ListPROutputsResponse + include BaseGenericModel + + # Data for PR outputs response. + 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' => :'ListPROutputsData' + } + 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::ListPROutputsResponse` 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/list_workflow_instances_response.rb b/lib/datadog_api_client/v2/models/list_workflow_instances_response.rb new file mode 100644 index 000000000000..a1ac04d2cf88 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_workflow_instances_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of workflow instance summaries. + class ListWorkflowInstancesResponse + include BaseGenericModel + + # List of workflow instance summaries. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListWorkflowInstancesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/pr_output.rb b/lib/datadog_api_client/v2/models/pr_output.rb new file mode 100644 index 000000000000..8f02b72ed637 --- /dev/null +++ b/lib/datadog_api_client/v2/models/pr_output.rb @@ -0,0 +1,163 @@ +=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 pull request created by the dependency upgrade automation. + class PROutput + include BaseGenericModel + + # The aggregate CI check status for the pull request. + attr_accessor :ci_status + + # The pull request number. + attr_accessor :pr_number + + # The URL of the pull request. + attr_reader :pr_url + + # The repository name in owner/repo format. + attr_accessor :repository + + # The current status of the pull request. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ci_status' => :'ci_status', + :'pr_number' => :'pr_number', + :'pr_url' => :'pr_url', + :'repository' => :'repository', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ci_status' => :'PROutputCiStatus', + :'pr_number' => :'Integer', + :'pr_url' => :'String', + :'repository' => :'String', + :'status' => :'PROutputStatus' + } + 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::PROutput` 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?(:'ci_status') + self.ci_status = attributes[:'ci_status'] + end + + if attributes.key?(:'pr_number') + self.pr_number = attributes[:'pr_number'] + end + + if attributes.key?(:'pr_url') + self.pr_url = attributes[:'pr_url'] + end + + if attributes.key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @pr_url.nil? + true + end + + # Custom attribute writer method with validation + # @param pr_url [Object] Object to be assigned + # @!visibility private + def pr_url=(pr_url) + if pr_url.nil? + fail ArgumentError, 'invalid value for "pr_url", pr_url cannot be nil.' + end + @pr_url = pr_url + 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 && + ci_status == o.ci_status && + pr_number == o.pr_number && + pr_url == o.pr_url && + repository == o.repository && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ci_status, pr_number, pr_url, repository, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/pr_output_ci_status.rb b/lib/datadog_api_client/v2/models/pr_output_ci_status.rb new file mode 100644 index 000000000000..25e5ec8a6a56 --- /dev/null +++ b/lib/datadog_api_client/v2/models/pr_output_ci_status.rb @@ -0,0 +1,28 @@ +=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 aggregate CI check status for the pull request. + class PROutputCiStatus + include BaseEnumModel + + PENDING = "PENDING".freeze + FAILED = "FAILED".freeze + SUCCESSFUL = "SUCCESSFUL".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/pr_output_status.rb b/lib/datadog_api_client/v2/models/pr_output_status.rb new file mode 100644 index 000000000000..0986d2df377e --- /dev/null +++ b/lib/datadog_api_client/v2/models/pr_output_status.rb @@ -0,0 +1,30 @@ +=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 current status of the pull request. + class PROutputStatus + include BaseEnumModel + + PENDING = "PENDING".freeze + DRAFT = "DRAFT".freeze + READY = "READY".freeze + MERGED = "MERGED".freeze + CLOSED = "CLOSED".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/update_ai_workflow_request.rb b/lib/datadog_api_client/v2/models/update_ai_workflow_request.rb new file mode 100644 index 000000000000..59d9a91269d2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_ai_workflow_request.rb @@ -0,0 +1,177 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for updating an existing AI workflow. All fields are optional. + class UpdateAIWorkflowRequest + include BaseGenericModel + + # Timestamp marking when the workflow completed. + attr_accessor :completed_at + + # A list of entity groups. Each group is processed in a separate workflow execution. + attr_accessor :entities + + # Arbitrary filtering criteria used to select entities for the workflow. + attr_accessor :filtering_logic + + # Updated entity grouping logic. + attr_accessor :grouping_logic + + # Updated maximum number of entities per execution session. + attr_accessor :max_number_of_entities_per_session + + # Updated AI prompt for the workflow. + attr_accessor :prompt + + # Updated target repository in owner/repo format. + attr_accessor :repository + + # Updated name for the workflow. + attr_accessor :workflow_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'completed_at' => :'completed_at', + :'entities' => :'entities', + :'filtering_logic' => :'filtering_logic', + :'grouping_logic' => :'grouping_logic', + :'max_number_of_entities_per_session' => :'max_number_of_entities_per_session', + :'prompt' => :'prompt', + :'repository' => :'repository', + :'workflow_name' => :'workflow_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'completed_at' => :'Time', + :'entities' => :'Array>', + :'filtering_logic' => :'FilteringLogic', + :'grouping_logic' => :'String', + :'max_number_of_entities_per_session' => :'Integer', + :'prompt' => :'String', + :'repository' => :'String', + :'workflow_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAIWorkflowRequest` 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?(:'completed_at') + self.completed_at = attributes[:'completed_at'] + end + + if attributes.key?(:'entities') + if (value = attributes[:'entities']).is_a?(Array) + self.entities = value + end + end + + if attributes.key?(:'filtering_logic') + self.filtering_logic = attributes[:'filtering_logic'] + end + + if attributes.key?(:'grouping_logic') + self.grouping_logic = attributes[:'grouping_logic'] + end + + if attributes.key?(:'max_number_of_entities_per_session') + self.max_number_of_entities_per_session = attributes[:'max_number_of_entities_per_session'] + end + + if attributes.key?(:'prompt') + self.prompt = attributes[:'prompt'] + end + + if attributes.key?(:'repository') + self.repository = attributes[:'repository'] + end + + if attributes.key?(:'workflow_name') + self.workflow_name = attributes[:'workflow_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + completed_at == o.completed_at && + entities == o.entities && + filtering_logic == o.filtering_logic && + grouping_logic == o.grouping_logic && + max_number_of_entities_per_session == o.max_number_of_entities_per_session && + prompt == o.prompt && + repository == o.repository && + workflow_name == o.workflow_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [completed_at, entities, filtering_logic, grouping_logic, max_number_of_entities_per_session, prompt, repository, workflow_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_execution_attributes.rb b/lib/datadog_api_client/v2/models/workflow_execution_attributes.rb new file mode 100644 index 000000000000..404d78487ed6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_execution_attributes.rb @@ -0,0 +1,209 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a workflow execution. + class WorkflowExecutionAttributes + include BaseGenericModel + + # The ID of the parent AI workflow. + attr_reader :ai_workflow_id + + # Timestamp when the execution was created. + attr_reader :created_at + + # The list of entities processed by this execution. + attr_reader :entities + + # The Datadog Workflow Automation instance ID for this execution. + attr_reader :instance_id + + # Timestamp when the execution was last updated. + attr_reader :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ai_workflow_id' => :'ai_workflow_id', + :'created_at' => :'created_at', + :'entities' => :'entities', + :'instance_id' => :'instance_id', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ai_workflow_id' => :'UUID', + :'created_at' => :'Time', + :'entities' => :'Array', + :'instance_id' => :'UUID', + :'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::WorkflowExecutionAttributes` 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?(:'ai_workflow_id') + self.ai_workflow_id = attributes[:'ai_workflow_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'entities') + if (value = attributes[:'entities']).is_a?(Array) + self.entities = value + end + end + + if attributes.key?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + 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 @ai_workflow_id.nil? + return false if @created_at.nil? + return false if @entities.nil? + return false if @instance_id.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method with validation + # @param ai_workflow_id [Object] Object to be assigned + # @!visibility private + def ai_workflow_id=(ai_workflow_id) + if ai_workflow_id.nil? + fail ArgumentError, 'invalid value for "ai_workflow_id", ai_workflow_id cannot be nil.' + end + @ai_workflow_id = ai_workflow_id + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param entities [Object] Object to be assigned + # @!visibility private + def entities=(entities) + if entities.nil? + fail ArgumentError, 'invalid value for "entities", entities cannot be nil.' + end + @entities = entities + 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 updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + 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 && + ai_workflow_id == o.ai_workflow_id && + created_at == o.created_at && + entities == o.entities && + instance_id == o.instance_id && + 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 + [ai_workflow_id, created_at, entities, instance_id, updated_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_execution_data.rb b/lib/datadog_api_client/v2/models/workflow_execution_data.rb new file mode 100644 index 000000000000..7401cfbe5ed3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_execution_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 + # A single workflow execution resource. + class WorkflowExecutionData + include BaseGenericModel + + # Attributes of a workflow execution. + attr_reader :attributes + + # The unique identifier of the workflow execution. + attr_reader :id + + # The resource type for workflow executions. + 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' => :'WorkflowExecutionAttributes', + :'id' => :'UUID', + :'type' => :'WorkflowExecutionDataType' + } + 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::WorkflowExecutionData` 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_execution_data_type.rb b/lib/datadog_api_client/v2/models/workflow_execution_data_type.rb new file mode 100644 index 000000000000..b25649479c35 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_execution_data_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 resource type for workflow executions. + class WorkflowExecutionDataType + include BaseEnumModel + + WORKFLOW_EXECUTIONS = "workflow-executions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_execution_response.rb b/lib/datadog_api_client/v2/models/workflow_execution_response.rb new file mode 100644 index 000000000000..3928460a1652 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_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 + # Response containing a single workflow execution. + class WorkflowExecutionResponse + include BaseGenericModel + + # A single workflow execution resource. + 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' => :'WorkflowExecutionData' + } + 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::WorkflowExecutionResponse` 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_instance_summary_attributes.rb b/lib/datadog_api_client/v2/models/workflow_instance_summary_attributes.rb new file mode 100644 index 000000000000..42ddc5e8db32 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_instance_summary_attributes.rb @@ -0,0 +1,188 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a workflow instance summary. + class WorkflowInstanceSummaryAttributes + include BaseGenericModel + + # Timestamp when the workflow instance was created. + attr_reader :created_at + + # The entities being processed by this workflow instance. + attr_reader :entities + + # The current status of the step. + attr_reader :status + + # A human-readable display name for the current status. + attr_reader :status_display + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'entities' => :'entities', + :'status' => :'status', + :'status_display' => :'status_display' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'entities' => :'Array', + :'status' => :'WorkflowInstanceSummaryAttributesStatus', + :'status_display' => :'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::WorkflowInstanceSummaryAttributes` 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?(:'entities') + if (value = attributes[:'entities']).is_a?(Array) + self.entities = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'status_display') + self.status_display = attributes[:'status_display'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @entities.nil? + return false if @status.nil? + return false if @status_display.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param entities [Object] Object to be assigned + # @!visibility private + def entities=(entities) + if entities.nil? + fail ArgumentError, 'invalid value for "entities", entities cannot be nil.' + end + @entities = entities + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param status_display [Object] Object to be assigned + # @!visibility private + def status_display=(status_display) + if status_display.nil? + fail ArgumentError, 'invalid value for "status_display", status_display cannot be nil.' + end + @status_display = status_display + 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 && + entities == o.entities && + status == o.status && + status_display == o.status_display && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, entities, status, status_display, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_instance_summary_attributes_status.rb b/lib/datadog_api_client/v2/models/workflow_instance_summary_attributes_status.rb new file mode 100644 index 000000000000..09c10e00218f --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_instance_summary_attributes_status.rb @@ -0,0 +1,30 @@ +=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 current status of the step. + class WorkflowInstanceSummaryAttributesStatus + include BaseEnumModel + + PENDING = "PENDING".freeze + RUNNING = "RUNNING".freeze + COMPLETED = "COMPLETED".freeze + FAILED = "FAILED".freeze + CANCELED = "CANCELED".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/workflow_instance_summary_data.rb b/lib/datadog_api_client/v2/models/workflow_instance_summary_data.rb new file mode 100644 index 000000000000..5e56ae340a69 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_instance_summary_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 + # A summary of a single workflow instance. + class WorkflowInstanceSummaryData + include BaseGenericModel + + # Attributes of a workflow instance summary. + attr_reader :attributes + + # The unique identifier of the workflow instance. + attr_reader :id + + # The resource type for workflow instances. + 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' => :'WorkflowInstanceSummaryAttributes', + :'id' => :'UUID', + :'type' => :'WorkflowInstanceSummaryDataType' + } + 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::WorkflowInstanceSummaryData` 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_instance_summary_data_type.rb b/lib/datadog_api_client/v2/models/workflow_instance_summary_data_type.rb new file mode 100644 index 000000000000..e2a2794627b8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/workflow_instance_summary_data_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 resource type for workflow instances. + class WorkflowInstanceSummaryDataType + include BaseEnumModel + + WORKFLOW_INSTANCES = "workflow-instances".freeze + end +end