diff --git a/.apigentools-info b/.apigentools-info
index f63f96ac8..d4d723485 100644
--- a/.apigentools-info
+++ b/.apigentools-info
@@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
- "regenerated": "2025-02-12 17:13:42.478907",
- "spec_repo_commit": "154100ad"
+ "regenerated": "2025-02-12 18:33:49.810961",
+ "spec_repo_commit": "6a4cfb82"
},
"v2": {
"apigentools_version": "1.6.6",
- "regenerated": "2025-02-12 17:13:42.494251",
- "spec_repo_commit": "154100ad"
+ "regenerated": "2025-02-12 18:33:49.826925",
+ "spec_repo_commit": "6a4cfb82"
}
}
}
\ No newline at end of file
diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index b0adf622a..5e1dce10c 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -1048,6 +1048,22 @@ components:
type: string
x-enum-varnames:
- API_KEYS
+ APITrigger:
+ description: Trigger a workflow VIA an API. The workflow must be published.
+ properties:
+ rateLimit:
+ $ref: '#/components/schemas/TriggerRateLimit'
+ type: object
+ APITriggerWrapper:
+ description: Schema for an API-based trigger.
+ properties:
+ apiTrigger:
+ $ref: '#/components/schemas/APITrigger'
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - apiTrigger
+ type: object
AWSAccountConfigID:
description: 'Unique Datadog ID of the AWS Account Integration Config.
@@ -1822,6 +1838,56 @@ components:
- id
- base_severity
type: object
+ Annotation:
+ description: A list of annotations used in the workflow. These are like sticky
+ notes for your workflow!
+ properties:
+ display:
+ $ref: '#/components/schemas/AnnotationDisplay'
+ id:
+ description: The `Annotation` `id`.
+ example: ''
+ type: string
+ markdownTextAnnotation:
+ $ref: '#/components/schemas/AnnotationMarkdownTextAnnotation'
+ required:
+ - id
+ - display
+ - markdownTextAnnotation
+ type: object
+ AnnotationDisplay:
+ description: The definition of `AnnotationDisplay` object.
+ properties:
+ bounds:
+ $ref: '#/components/schemas/AnnotationDisplayBounds'
+ type: object
+ AnnotationDisplayBounds:
+ description: The definition of `AnnotationDisplayBounds` object.
+ properties:
+ height:
+ description: The `bounds` `height`.
+ format: double
+ type: number
+ width:
+ description: The `bounds` `width`.
+ format: double
+ type: number
+ x:
+ description: The `bounds` `x`.
+ format: double
+ type: number
+ y:
+ description: The `bounds` `y`.
+ format: double
+ type: number
+ type: object
+ AnnotationMarkdownTextAnnotation:
+ description: The definition of `AnnotationMarkdownTextAnnotation` object.
+ properties:
+ text:
+ description: The `markdownTextAnnotation` `text`.
+ type: string
+ type: object
ApiID:
description: API identifier.
example: 90646597-5fdb-4a17-a240-647003f8c028
@@ -1965,6 +2031,17 @@ components:
deployment:
$ref: '#/components/schemas/DeploymentRelationship'
type: object
+ AppTriggerWrapper:
+ description: Schema for an App-based trigger.
+ properties:
+ appTrigger:
+ description: Trigger a workflow VIA an App.
+ type: object
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - appTrigger
+ type: object
ApplicationKeyCreateAttributes:
description: Attributes used to create an application Key.
properties:
@@ -5204,6 +5281,23 @@ components:
- OPEN
- IN_PROGRESS
- CLOSED
+ CaseTrigger:
+ description: Trigger a workflow VIA a Case. For automatic triggering a handle
+ must be configured and the workflow must be published.
+ properties:
+ rateLimit:
+ $ref: '#/components/schemas/TriggerRateLimit'
+ type: object
+ CaseTriggerWrapper:
+ description: Schema for a Case-based trigger.
+ properties:
+ caseTrigger:
+ $ref: '#/components/schemas/CaseTrigger'
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - caseTrigger
+ type: object
CaseType:
description: Case type
enum:
@@ -5421,6 +5515,17 @@ components:
type: string
x-enum-varnames:
- SERVICE
+ ChangeEventTriggerWrapper:
+ description: Schema for a Change Event-based trigger.
+ properties:
+ changeEventTrigger:
+ description: Trigger a workflow VIA a Change Event.
+ type: object
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - changeEventTrigger
+ type: object
ChargebackBreakdown:
description: Charges breakdown.
properties:
@@ -6117,6 +6222,60 @@ components:
required:
- location
type: object
+ CompletionCondition:
+ description: The definition of `CompletionCondition` object.
+ properties:
+ operand1:
+ description: The `CompletionCondition` `operand1`.
+ operand2:
+ description: The `CompletionCondition` `operand2`.
+ operator:
+ $ref: '#/components/schemas/CompletionConditionOperator'
+ required:
+ - operand1
+ - operator
+ type: object
+ CompletionConditionOperator:
+ description: The definition of `CompletionConditionOperator` object.
+ enum:
+ - OPERATOR_EQUAL
+ - OPERATOR_NOT_EQUAL
+ - OPERATOR_GREATER_THAN
+ - OPERATOR_LESS_THAN
+ - OPERATOR_GREATER_THAN_OR_EQUAL_TO
+ - OPERATOR_LESS_THAN_OR_EQUAL_TO
+ - OPERATOR_CONTAINS
+ - OPERATOR_DOES_NOT_CONTAIN
+ - OPERATOR_IS_NULL
+ - OPERATOR_IS_NOT_NULL
+ - OPERATOR_IS_EMPTY
+ - OPERATOR_IS_NOT_EMPTY
+ example: OPERATOR_EQUAL
+ type: string
+ x-enum-varnames:
+ - OPERATOR_EQUAL
+ - OPERATOR_NOT_EQUAL
+ - OPERATOR_GREATER_THAN
+ - OPERATOR_LESS_THAN
+ - OPERATOR_GREATER_THAN_OR_EQUAL_TO
+ - OPERATOR_LESS_THAN_OR_EQUAL_TO
+ - OPERATOR_CONTAINS
+ - OPERATOR_DOES_NOT_CONTAIN
+ - OPERATOR_IS_NULL
+ - OPERATOR_IS_NOT_NULL
+ - OPERATOR_IS_EMPTY
+ - OPERATOR_IS_NOT_EMPTY
+ CompletionGate:
+ description: Used to create conditions before running subsequent actions.
+ properties:
+ completionCondition:
+ $ref: '#/components/schemas/CompletionCondition'
+ retryStrategy:
+ $ref: '#/components/schemas/RetryStrategy'
+ required:
+ - completionCondition
+ - retryStrategy
+ type: object
Component:
description: '[Definition of a UI component in the app](https://docs.datadoghq.com/service_management/app_builder/components/)'
properties:
@@ -6578,6 +6737,70 @@ components:
$ref: '#/components/schemas/ConfluentResourceResponseData'
type: array
type: object
+ Connection:
+ description: The definition of `Connection` object.
+ properties:
+ connectionId:
+ description: The `Connection` `connectionId`.
+ example: ''
+ type: string
+ label:
+ description: The `Connection` `label`.
+ example: ''
+ type: string
+ required:
+ - connectionId
+ - label
+ type: object
+ ConnectionEnv:
+ description: A list of connections or connection groups used in the workflow.
+ properties:
+ connectionGroups:
+ description: The `ConnectionEnv` `connectionGroups`.
+ items:
+ $ref: '#/components/schemas/ConnectionGroup'
+ type: array
+ connections:
+ description: The `ConnectionEnv` `connections`.
+ items:
+ $ref: '#/components/schemas/Connection'
+ type: array
+ env:
+ $ref: '#/components/schemas/ConnectionEnvEnv'
+ required:
+ - env
+ type: object
+ ConnectionEnvEnv:
+ description: The definition of `ConnectionEnvEnv` object.
+ enum:
+ - default
+ example: default
+ type: string
+ x-enum-varnames:
+ - DEFAULT
+ ConnectionGroup:
+ description: The definition of `ConnectionGroup` object.
+ properties:
+ connectionGroupId:
+ description: The `ConnectionGroup` `connectionGroupId`.
+ example: ''
+ type: string
+ label:
+ description: The `ConnectionGroup` `label`.
+ example: ''
+ type: string
+ tags:
+ description: The `ConnectionGroup` `tags`.
+ example:
+ - ''
+ items:
+ type: string
+ type: array
+ required:
+ - connectionGroupId
+ - label
+ - tags
+ type: object
Container:
description: Container object.
properties:
@@ -7557,6 +7780,82 @@ components:
type:
$ref: '#/components/schemas/RuleType'
type: object
+ CreateWorkflowRequest:
+ description: A request object for creating a new workflow.
+ example:
+ data:
+ attributes:
+ description: A sample workflow.
+ name: Example Workflow
+ published: true
+ spec:
+ annotations:
+ - display:
+ bounds:
+ height: 150
+ width: 300
+ x: -375
+ y: -0.5
+ id: 99999999-9999-9999-9999-999999999999
+ markdownTextAnnotation:
+ text: Example annotation.
+ connectionEnvs:
+ - connections:
+ - connectionId: 11111111-1111-1111-1111-111111111111
+ label: INTEGRATION_DATADOG
+ env: default
+ handle: my-handle
+ inputSchema:
+ parameters:
+ - defaultValue: default
+ name: input
+ type: STRING
+ outputSchema:
+ parameters:
+ - name: output
+ type: ARRAY_OBJECT
+ value: '{{ Steps.Step1 }}'
+ steps:
+ - actionId: com.datadoghq.dd.monitor.listMonitors
+ connectionLabel: INTEGRATION_DATADOG
+ name: Step1
+ outboundEdges:
+ - branchName: main
+ nextStepName: Step2
+ parameters:
+ - name: tags
+ value: service:monitoring
+ - actionId: com.datadoghq.core.noop
+ name: Step2
+ triggers:
+ - monitorTrigger:
+ rateLimit:
+ count: 1
+ interval: 3600s
+ startStepNames:
+ - Step1
+ - githubWebhookTrigger: {}
+ startStepNames:
+ - Step1
+ tags:
+ - team:infra
+ - service:monitoring
+ - foo:bar
+ type: workflows
+ properties:
+ data:
+ $ref: '#/components/schemas/WorkflowData'
+ required:
+ - data
+ type: object
+ CreateWorkflowResponse:
+ description: The response object after creating a new workflow.
+ properties:
+ data:
+ $ref: '#/components/schemas/WorkflowData'
+ required:
+ - data
+ type: object
Creator:
description: Creator of the object.
properties:
@@ -9043,6 +9342,17 @@ components:
$ref: '#/components/schemas/DashboardListItemResponse'
type: array
type: object
+ DashboardTriggerWrapper:
+ description: Schema for a Dashboard-based trigger.
+ properties:
+ dashboardTrigger:
+ description: Trigger a workflow VIA a Dashboard.
+ type: object
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - dashboardTrigger
+ type: object
DashboardType:
description: The type of the dashboard.
enum:
@@ -11142,6 +11452,19 @@ components:
minLength: 1
type: string
type: object
+ ErrorHandler:
+ description: Used to handle errors in an action.
+ properties:
+ fallbackStepName:
+ description: The `ErrorHandler` `fallbackStepName`.
+ example: ''
+ type: string
+ retryStrategy:
+ $ref: '#/components/schemas/RetryStrategy'
+ required:
+ - retryStrategy
+ - fallbackStepName
+ type: object
Event:
description: The metadata associated with a request.
properties:
@@ -12712,6 +13035,12 @@ components:
- _HANDLE
- EMAIL
- _EMAIL
+ GetWorkflowResponse:
+ description: The response object after getting a workflow.
+ properties:
+ data:
+ $ref: '#/components/schemas/WorkflowData'
+ type: object
GitCommitSHA:
description: Git Commit SHA.
example: 66adc9350f2cc9b250b69abddab733dd55e1a588
@@ -12721,6 +13050,26 @@ components:
description: Git Repository URL
example: https://github.com/organization/example-repository
type: string
+ GithubWebhookTrigger:
+ description: Trigger a workflow VIA GitHub webhook. To trigger a workflow from
+ GitHub, you must set a `webhookSecret`. In your GitHub Webhook Settings, set
+ the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id",
+ select application/json for the content type, and be highly recommend enabling
+ SSL verification for security. The workflow must be published.
+ properties:
+ rateLimit:
+ $ref: '#/components/schemas/TriggerRateLimit'
+ type: object
+ GithubWebhookTriggerWrapper:
+ description: Schema for a GitHub webhook-based trigger.
+ properties:
+ githubWebhookTrigger:
+ $ref: '#/components/schemas/GithubWebhookTrigger'
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - githubWebhookTrigger
+ type: object
GroupScalarColumn:
description: A column containing the tag keys and values in a group.
properties:
@@ -15012,6 +15361,23 @@ components:
type: string
x-enum-varnames:
- INCIDENT_TODOS
+ IncidentTrigger:
+ description: Trigger a workflow VIA an Incident. For automatic triggering a
+ handle must be configured and the workflow must be published.
+ properties:
+ rateLimit:
+ $ref: '#/components/schemas/TriggerRateLimit'
+ type: object
+ IncidentTriggerWrapper:
+ description: Schema for an Incident-based trigger.
+ properties:
+ incidentTrigger:
+ $ref: '#/components/schemas/IncidentTrigger'
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - incidentTrigger
+ type: object
IncidentType:
default: incidents
description: Incident resource type.
@@ -15456,6 +15822,59 @@ components:
- ONCALL
- INCIDENT
- RELATION
+ InputSchema:
+ description: A list of input parameters for the workflow. These can be used
+ as dynamic runtime values in your workflow.
+ properties:
+ parameters:
+ description: The `InputSchema` `parameters`.
+ items:
+ $ref: '#/components/schemas/InputSchemaParameters'
+ type: array
+ type: object
+ InputSchemaParameters:
+ description: The definition of `InputSchemaParameters` object.
+ properties:
+ defaultValue:
+ description: The `InputSchemaParameters` `defaultValue`.
+ description:
+ description: The `InputSchemaParameters` `description`.
+ type: string
+ label:
+ description: The `InputSchemaParameters` `label`.
+ type: string
+ name:
+ description: The `InputSchemaParameters` `name`.
+ example: ''
+ type: string
+ type:
+ $ref: '#/components/schemas/InputSchemaParametersType'
+ required:
+ - name
+ - type
+ type: object
+ InputSchemaParametersType:
+ description: The definition of `InputSchemaParametersType` object.
+ enum:
+ - STRING
+ - NUMBER
+ - BOOLEAN
+ - OBJECT
+ - ARRAY_STRING
+ - ARRAY_NUMBER
+ - ARRAY_BOOLEAN
+ - ARRAY_OBJECT
+ example: STRING
+ type: string
+ x-enum-varnames:
+ - STRING
+ - NUMBER
+ - BOOLEAN
+ - OBJECT
+ - ARRAY_STRING
+ - ARRAY_NUMBER
+ - ARRAY_BOOLEAN
+ - ARRAY_OBJECT
IntakePayloadAccepted:
description: The payload accepted for intake.
properties:
@@ -19373,6 +19792,23 @@ components:
type:
$ref: '#/components/schemas/MonitorDowntimeMatchResourceType'
type: object
+ MonitorTrigger:
+ description: Trigger a workflow VIA a Monitor. For automatic triggering a handle
+ must be configured and the workflow must be published.
+ properties:
+ rateLimit:
+ $ref: '#/components/schemas/TriggerRateLimit'
+ type: object
+ MonitorTriggerWrapper:
+ description: Schema for a Monitor-based trigger.
+ properties:
+ monitorTrigger:
+ $ref: '#/components/schemas/MonitorTrigger'
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - monitorTrigger
+ type: object
MonitorType:
description: Attributes from the monitor that triggered the event.
nullable: true
@@ -20136,6 +20572,21 @@ components:
type: string
x-enum-varnames:
- ORGS
+ OutboundEdge:
+ description: The definition of `OutboundEdge` object.
+ properties:
+ branchName:
+ description: The `OutboundEdge` `branchName`.
+ example: ''
+ type: string
+ nextStepName:
+ description: The `OutboundEdge` `nextStepName`.
+ example: ''
+ type: string
+ required:
+ - nextStepName
+ - branchName
+ type: object
OutcomeType:
default: outcome
description: The JSON:API type for an outcome.
@@ -20315,6 +20766,60 @@ components:
example: /api/v2/scorecard/outcomes?include=rule&page%5Blimit%5D=100&page%5Boffset%5D=100
type: string
type: object
+ OutputSchema:
+ description: A list of output parameters for the workflow.
+ properties:
+ parameters:
+ description: The `OutputSchema` `parameters`.
+ items:
+ $ref: '#/components/schemas/OutputSchemaParameters'
+ type: array
+ type: object
+ OutputSchemaParameters:
+ description: The definition of `OutputSchemaParameters` object.
+ properties:
+ defaultValue:
+ description: The `OutputSchemaParameters` `defaultValue`.
+ description:
+ description: The `OutputSchemaParameters` `description`.
+ type: string
+ label:
+ description: The `OutputSchemaParameters` `label`.
+ type: string
+ name:
+ description: The `OutputSchemaParameters` `name`.
+ example: ''
+ type: string
+ type:
+ $ref: '#/components/schemas/OutputSchemaParametersType'
+ value:
+ description: The `OutputSchemaParameters` `value`.
+ required:
+ - name
+ - type
+ type: object
+ OutputSchemaParametersType:
+ description: The definition of `OutputSchemaParametersType` object.
+ enum:
+ - STRING
+ - NUMBER
+ - BOOLEAN
+ - OBJECT
+ - ARRAY_STRING
+ - ARRAY_NUMBER
+ - ARRAY_BOOLEAN
+ - ARRAY_OBJECT
+ example: STRING
+ type: string
+ x-enum-varnames:
+ - STRING
+ - NUMBER
+ - BOOLEAN
+ - OBJECT
+ - ARRAY_STRING
+ - ARRAY_NUMBER
+ - ARRAY_BOOLEAN
+ - ARRAY_OBJECT
Pagination:
description: Pagination object.
properties:
@@ -20327,6 +20832,19 @@ components:
format: int64
type: integer
type: object
+ Parameter:
+ description: The definition of `Parameter` object.
+ properties:
+ name:
+ description: The `Parameter` `name`.
+ example: ''
+ type: string
+ value:
+ description: The `Parameter` `value`.
+ required:
+ - name
+ - value
+ type: object
PartialAPIKey:
description: Partial Datadog API key.
properties:
@@ -21939,6 +22457,24 @@ components:
from the other indexes
type: string
type: object
+ ReadinessGate:
+ description: Used to merge multiple branches into a single branch.
+ properties:
+ thresholdType:
+ $ref: '#/components/schemas/ReadinessGateThresholdType'
+ required:
+ - thresholdType
+ type: object
+ ReadinessGateThresholdType:
+ description: The definition of `ReadinessGateThresholdType` object.
+ enum:
+ - ANY
+ - ALL
+ example: ANY
+ type: string
+ x-enum-varnames:
+ - ANY
+ - ALL
RelationType:
description: Supported relation types.
enum:
@@ -22860,6 +23396,41 @@ components:
required:
- data
type: object
+ RetryStrategy:
+ description: The definition of `RetryStrategy` object.
+ properties:
+ kind:
+ $ref: '#/components/schemas/RetryStrategyKind'
+ linear:
+ $ref: '#/components/schemas/RetryStrategyLinear'
+ required:
+ - kind
+ type: object
+ RetryStrategyKind:
+ description: The definition of `RetryStrategyKind` object.
+ enum:
+ - RETRY_STRATEGY_LINEAR
+ example: RETRY_STRATEGY_LINEAR
+ type: string
+ x-enum-varnames:
+ - RETRY_STRATEGY_LINEAR
+ RetryStrategyLinear:
+ description: The definition of `RetryStrategyLinear` object.
+ properties:
+ interval:
+ description: The `RetryStrategyLinear` `interval`. The expected format is
+ the number of seconds ending with an s. For example, 1 day is 86400s
+ example: ''
+ type: string
+ maxRetries:
+ description: The `RetryStrategyLinear` `maxRetries`.
+ example: 0.0
+ format: double
+ type: number
+ required:
+ - interval
+ - maxRetries
+ type: object
Role:
description: Role object returned by the API.
properties:
@@ -23966,6 +24537,26 @@ components:
type:
$ref: '#/components/schemas/ScalarFormulaResponseType'
type: object
+ ScheduleTrigger:
+ description: Trigger a workflow VIA a Schedule. The workflow must be published.
+ properties:
+ rruleExpression:
+ description: Recurrence rule expression for scheduling.
+ example: ''
+ type: string
+ required:
+ - rruleExpression
+ type: object
+ ScheduleTriggerWrapper:
+ description: Schema for a Schedule-based trigger.
+ properties:
+ scheduleTrigger:
+ $ref: '#/components/schemas/ScheduleTrigger'
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - scheduleTrigger
+ type: object
ScorecardType:
default: scorecard
description: The JSON:API type for scorecard.
@@ -26216,6 +26807,23 @@ components:
nullable: true
type: string
type: object
+ SecurityTrigger:
+ description: Trigger a workflow VIA a Security Signal or Finding. For automatic
+ triggering a handle must be configured and the workflow must be published.
+ properties:
+ rateLimit:
+ $ref: '#/components/schemas/TriggerRateLimit'
+ type: object
+ SecurityTriggerWrapper:
+ description: Schema for a Security-based trigger.
+ properties:
+ securityTrigger:
+ $ref: '#/components/schemas/SecurityTrigger'
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - securityTrigger
+ type: object
Selectors:
description: 'Selectors are used to filter security issues for which notifications
should be generated.
@@ -27971,6 +28579,17 @@ components:
- channel_name
- redirect_url
type: object
+ SlackTriggerWrapper:
+ description: Schema for a Slack-based trigger.
+ properties:
+ slackTrigger:
+ description: Trigger a workflow VIA Slack. The workflow must be published.
+ type: object
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ required:
+ - slackTrigger
+ type: object
SloReportCreateRequest:
description: The SLO report request body.
properties:
@@ -28893,6 +29512,41 @@ components:
from the other indexes
type: string
type: object
+ Spec:
+ description: The spec defines what the workflow does.
+ properties:
+ annotations:
+ description: A list of annotations used in the workflow. These are like
+ sticky notes for your workflow!
+ items:
+ $ref: '#/components/schemas/Annotation'
+ type: array
+ connectionEnvs:
+ description: A list of connections or connection groups used in the workflow.
+ items:
+ $ref: '#/components/schemas/ConnectionEnv'
+ type: array
+ handle:
+ description: Unique identifier used to trigger workflows automatically in
+ Datadog.
+ type: string
+ inputSchema:
+ $ref: '#/components/schemas/InputSchema'
+ outputSchema:
+ $ref: '#/components/schemas/OutputSchema'
+ steps:
+ description: A `Step` is a sub-component of a workflow. Each `Step` performs
+ an action.
+ items:
+ $ref: '#/components/schemas/Step'
+ type: array
+ triggers:
+ description: The list of triggers that activate this workflow. At least
+ one trigger is required, and each trigger type may appear at most once.
+ items:
+ $ref: '#/components/schemas/Trigger'
+ type: array
+ type: object
SpecVersion:
description: The version of the CycloneDX specification a BOM conforms to.
enum:
@@ -28911,6 +29565,14 @@ components:
- ONE_THREE
- ONE_FOUR
- ONE_FIVE
+ StartStepNames:
+ description: A list of steps that run first after a trigger fires.
+ example:
+ - ''
+ items:
+ description: The `StartStepNames` `items`.
+ type: string
+ type: array
State:
description: The state of the rule evaluation.
enum:
@@ -28923,6 +29585,64 @@ components:
- PASS
- FAIL
- SKIP
+ Step:
+ description: A Step is a sub-component of a workflow. Each Step performs an
+ action.
+ properties:
+ actionId:
+ description: The unique identifier of an action.
+ example: ''
+ type: string
+ completionGate:
+ $ref: '#/components/schemas/CompletionGate'
+ connectionLabel:
+ description: The unique identifier of a connection defined in the spec.
+ type: string
+ display:
+ $ref: '#/components/schemas/StepDisplay'
+ errorHandlers:
+ description: The `Step` `errorHandlers`.
+ items:
+ $ref: '#/components/schemas/ErrorHandler'
+ type: array
+ name:
+ description: Name of the step.
+ example: ''
+ type: string
+ outboundEdges:
+ description: A list of subsequent actions to run.
+ items:
+ $ref: '#/components/schemas/OutboundEdge'
+ type: array
+ parameters:
+ description: A list of inputs for an action.
+ items:
+ $ref: '#/components/schemas/Parameter'
+ type: array
+ readinessGate:
+ $ref: '#/components/schemas/ReadinessGate'
+ required:
+ - name
+ - actionId
+ type: object
+ StepDisplay:
+ description: The definition of `StepDisplay` object.
+ properties:
+ bounds:
+ $ref: '#/components/schemas/StepDisplayBounds'
+ type: object
+ StepDisplayBounds:
+ description: The definition of `StepDisplayBounds` object.
+ properties:
+ x:
+ description: The `bounds` `x`.
+ format: double
+ type: number
+ y:
+ description: The `bounds` `y`.
+ format: double
+ type: number
+ type: object
TagsEventAttribute:
description: Array of tags associated with your event.
example:
@@ -29729,6 +30449,33 @@ components:
type: string
x-enum-varnames:
- SECRET
+ Trigger:
+ description: One of the triggers that can start the execution of a workflow.
+ oneOf:
+ - $ref: '#/components/schemas/APITriggerWrapper'
+ - $ref: '#/components/schemas/AppTriggerWrapper'
+ - $ref: '#/components/schemas/CaseTriggerWrapper'
+ - $ref: '#/components/schemas/ChangeEventTriggerWrapper'
+ - $ref: '#/components/schemas/DashboardTriggerWrapper'
+ - $ref: '#/components/schemas/GithubWebhookTriggerWrapper'
+ - $ref: '#/components/schemas/IncidentTriggerWrapper'
+ - $ref: '#/components/schemas/MonitorTriggerWrapper'
+ - $ref: '#/components/schemas/ScheduleTriggerWrapper'
+ - $ref: '#/components/schemas/SecurityTriggerWrapper'
+ - $ref: '#/components/schemas/SlackTriggerWrapper'
+ - $ref: '#/components/schemas/WorkflowTriggerWrapper'
+ TriggerRateLimit:
+ description: Defines a rate limit for a trigger.
+ properties:
+ count:
+ description: The `TriggerRateLimit` `count`.
+ format: int64
+ type: integer
+ interval:
+ description: The `TriggerRateLimit` `interval`. The expected format is the
+ number of seconds ending with an s. For example, 1 day is 86400s
+ type: string
+ type: object
TriggerSource:
description: 'The type of security issues on which the rule applies. Notification
rules based on security signals need to use the trigger source "security_signals",
@@ -30018,6 +30765,81 @@ components:
type:
$ref: '#/components/schemas/RuleType'
type: object
+ UpdateWorkflowRequest:
+ description: A request object for updating an existing workflow.
+ example:
+ data:
+ attributes:
+ description: A sample workflow.
+ name: Example Workflow
+ published: true
+ spec:
+ annotations:
+ - display:
+ bounds:
+ height: 150
+ width: 300
+ x: -375
+ y: -0.5
+ id: 99999999-9999-9999-9999-999999999999
+ markdownTextAnnotation:
+ text: Example annotation.
+ connectionEnvs:
+ - connections:
+ - connectionId: 11111111-1111-1111-1111-111111111111
+ label: INTEGRATION_DATADOG
+ env: default
+ handle: my-handle
+ inputSchema:
+ parameters:
+ - defaultValue: default
+ name: input
+ type: STRING
+ outputSchema:
+ parameters:
+ - name: output
+ type: ARRAY_OBJECT
+ value: '{{ Steps.Step1 }}'
+ steps:
+ - actionId: com.datadoghq.dd.monitor.listMonitors
+ connectionLabel: INTEGRATION_DATADOG
+ name: Step1
+ outboundEdges:
+ - branchName: main
+ nextStepName: Step2
+ parameters:
+ - name: tags
+ value: service:monitoring
+ - actionId: com.datadoghq.core.noop
+ name: Step2
+ triggers:
+ - monitorTrigger:
+ rateLimit:
+ count: 1
+ interval: 3600s
+ startStepNames:
+ - Step1
+ - githubWebhookTrigger: {}
+ startStepNames:
+ - Step1
+ tags:
+ - team:infra
+ - service:monitoring
+ - foo:bar
+ id: 22222222-2222-2222-2222-222222222222
+ type: workflows
+ properties:
+ data:
+ $ref: '#/components/schemas/WorkflowDataUpdate'
+ required:
+ - data
+ type: object
+ UpdateWorkflowResponse:
+ description: The response object after updating a workflow.
+ properties:
+ data:
+ $ref: '#/components/schemas/WorkflowDataUpdate'
+ type: object
UpsertCatalogEntityRequest:
description: Create or update entity request.
oneOf:
@@ -31069,6 +31891,134 @@ components:
- PAST_SIX_MONTHS
- PAST_ONE_YEAR
- ALERT
+ WorkflowData:
+ description: Data related to the workflow.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/WorkflowDataAttributes'
+ id:
+ description: The workflow identifier
+ readOnly: true
+ type: string
+ relationships:
+ $ref: '#/components/schemas/WorkflowDataRelationships'
+ type:
+ $ref: '#/components/schemas/WorkflowDataType'
+ required:
+ - type
+ - attributes
+ type: object
+ WorkflowDataAttributes:
+ description: The definition of `WorkflowDataAttributes` object.
+ properties:
+ createdAt:
+ description: When the workflow was created.
+ format: date-time
+ readOnly: true
+ type: string
+ description:
+ description: Description of the workflow.
+ type: string
+ name:
+ description: Name of the workflow.
+ example: ''
+ type: string
+ published:
+ description: Set the workflow to published or unpublished. Workflows in
+ an unpublished state will only be executable via manual runs. Automatic
+ triggers such as Schedule will not execute the workflow until it is published.
+ type: boolean
+ spec:
+ $ref: '#/components/schemas/Spec'
+ tags:
+ description: Tags of the workflow.
+ items:
+ type: string
+ type: array
+ updatedAt:
+ description: When the workflow was last updated.
+ format: date-time
+ readOnly: true
+ type: string
+ webhookSecret:
+ description: If a Webhook trigger is defined on this workflow, a webhookSecret
+ is required and should be provided here.
+ type: string
+ writeOnly: true
+ required:
+ - name
+ - spec
+ type: object
+ WorkflowDataRelationships:
+ description: The definition of `WorkflowDataRelationships` object.
+ properties:
+ creator:
+ $ref: '#/components/schemas/WorkflowUserRelationship'
+ owner:
+ $ref: '#/components/schemas/WorkflowUserRelationship'
+ readOnly: true
+ type: object
+ WorkflowDataType:
+ description: The definition of `WorkflowDataType` object.
+ enum:
+ - workflows
+ example: workflows
+ type: string
+ x-enum-varnames:
+ - WORKFLOWS
+ WorkflowDataUpdate:
+ description: Data related to the workflow being updated.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/WorkflowDataUpdateAttributes'
+ id:
+ description: The workflow identifier
+ type: string
+ relationships:
+ $ref: '#/components/schemas/WorkflowDataRelationships'
+ type:
+ $ref: '#/components/schemas/WorkflowDataType'
+ required:
+ - type
+ - attributes
+ type: object
+ WorkflowDataUpdateAttributes:
+ description: The definition of `WorkflowDataUpdateAttributes` object.
+ properties:
+ createdAt:
+ description: When the workflow was created.
+ format: date-time
+ readOnly: true
+ type: string
+ description:
+ description: Description of the workflow.
+ type: string
+ name:
+ description: Name of the workflow.
+ type: string
+ published:
+ description: Set the workflow to published or unpublished. Workflows in
+ an unpublished state will only be executable via manual runs. Automatic
+ triggers such as Schedule will not execute the workflow until it is published.
+ type: boolean
+ spec:
+ $ref: '#/components/schemas/Spec'
+ tags:
+ description: Tags of the workflow.
+ items:
+ type: string
+ type: array
+ updatedAt:
+ description: When the workflow was last updated.
+ format: date-time
+ readOnly: true
+ type: string
+ webhookSecret:
+ description: If a Webhook trigger is defined on this workflow, a webhookSecret
+ is required and should be provided here.
+ type: string
+ writeOnly: true
+ type: object
WorkflowInstanceCreateMeta:
description: Additional information for creating a workflow instance.
properties:
@@ -31135,6 +32085,45 @@ components:
format: int64
type: integer
type: object
+ WorkflowTriggerWrapper:
+ description: Schema for a Workflow-based trigger.
+ properties:
+ startStepNames:
+ $ref: '#/components/schemas/StartStepNames'
+ workflowTrigger:
+ description: Trigger a workflow VIA the Datadog UI. Only required if no
+ other trigger exists.
+ type: object
+ required:
+ - workflowTrigger
+ type: object
+ WorkflowUserRelationship:
+ description: The definition of `WorkflowUserRelationship` object.
+ properties:
+ data:
+ $ref: '#/components/schemas/WorkflowUserRelationshipData'
+ type: object
+ WorkflowUserRelationshipData:
+ description: The definition of `WorkflowUserRelationshipData` object.
+ properties:
+ id:
+ description: The user identifier
+ example: ''
+ type: string
+ type:
+ $ref: '#/components/schemas/WorkflowUserRelationshipType'
+ required:
+ - type
+ - id
+ type: object
+ WorkflowUserRelationshipType:
+ description: The definition of `WorkflowUserRelationshipType` object.
+ enum:
+ - users
+ example: users
+ type: string
+ x-enum-varnames:
+ - USERS
WorklflowCancelInstanceResponse:
description: Information about the canceled instance.
properties:
@@ -49835,6 +50824,178 @@ paths:
operator: OR
permissions:
- teams_read
+ /api/v2/workflows:
+ post:
+ description: Create a new workflow, returning the workflow ID. This API requires
+ an application key scoped with the `workflows_write` permission.
+ operationId: CreateWorkflow
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateWorkflowRequest'
+ required: true
+ responses:
+ '201':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateWorkflowResponse'
+ description: Successfully created a workflow.
+ '400':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Bad request
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ '429':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Too many requests
+ summary: Create a Workflow
+ tags:
+ - Workflow Automation
+ x-permission:
+ operator: OR
+ permissions:
+ - workflows_write
+ /api/v2/workflows/{workflow_id}:
+ delete:
+ description: Delete a workflow by ID. This API requires an application key scoped
+ with the `workflows_write` permission.
+ operationId: DeleteWorkflow
+ parameters:
+ - $ref: '#/components/parameters/WorkflowId'
+ responses:
+ '204':
+ description: Successfully deleted a workflow.
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ '404':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Not found
+ '429':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Too many requests
+ summary: Delete an existing Workflow
+ tags:
+ - Workflow Automation
+ x-permission:
+ operator: OR
+ permissions:
+ - workflows_write
+ get:
+ description: Get a workflow by ID. This API requires an application key scoped
+ with the `workflows_read` permission.
+ operationId: GetWorkflow
+ parameters:
+ - $ref: '#/components/parameters/WorkflowId'
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GetWorkflowResponse'
+ description: Successfully got a workflow.
+ '400':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Bad request
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ '404':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Not found
+ '429':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Too many requests
+ summary: Get an existing Workflow
+ tags:
+ - Workflow Automation
+ x-permission:
+ operator: OR
+ permissions:
+ - workflows_read
+ patch:
+ description: Update a workflow by ID. This API requires an application key scoped
+ with the `workflows_write` permission.
+ operationId: UpdateWorkflow
+ parameters:
+ - $ref: '#/components/parameters/WorkflowId'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateWorkflowRequest'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateWorkflowResponse'
+ description: Successfully updated a workflow.
+ '400':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Bad request
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ '404':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Not found
+ '429':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Too many requests
+ summary: Update an existing Workflow
+ tags:
+ - Workflow Automation
+ x-permission:
+ operator: OR
+ permissions:
+ - workflows_write
/api/v2/workflows/{workflow_id}/instances:
get:
description: List all instances of a given workflow. This API requires an application
@@ -50438,7 +51599,12 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/account_management/users
name: Users
-- description: Automate your teams operational processes with Datadog Workflow Automation.
+- description: Datadog Workflow Automation allows you to automate your end-to-end
+ processes by connecting Datadog with the rest of your tech stack. Build workflows
+ to auto-remediate your alerts, streamline your incident and security processes,
+ and reduce manual toil. Workflow Automation supports over 1,000+ OOTB actions,
+ including AWS, JIRA, ServiceNow, GitHub, and OpenAI. Learn more in our Workflow
+ Automation docs [here](https://docs.datadoghq.com/service_management/workflows/).
externalDocs:
description: Find out more at
url: https://docs.datadoghq.com/service_management/workflows/
diff --git a/examples/v2_workflow-automation_CreateWorkflow.rs b/examples/v2_workflow-automation_CreateWorkflow.rs
new file mode 100644
index 000000000..42987d452
--- /dev/null
+++ b/examples/v2_workflow-automation_CreateWorkflow.rs
@@ -0,0 +1,103 @@
+// Create a Workflow returns "Successfully created a workflow." response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;
+use datadog_api_client::datadogV2::model::Connection;
+use datadog_api_client::datadogV2::model::ConnectionEnv;
+use datadog_api_client::datadogV2::model::ConnectionEnvEnv;
+use datadog_api_client::datadogV2::model::CreateWorkflowRequest;
+use datadog_api_client::datadogV2::model::GithubWebhookTrigger;
+use datadog_api_client::datadogV2::model::GithubWebhookTriggerWrapper;
+use datadog_api_client::datadogV2::model::InputSchema;
+use datadog_api_client::datadogV2::model::InputSchemaParameters;
+use datadog_api_client::datadogV2::model::InputSchemaParametersType;
+use datadog_api_client::datadogV2::model::MonitorTrigger;
+use datadog_api_client::datadogV2::model::MonitorTriggerWrapper;
+use datadog_api_client::datadogV2::model::OutboundEdge;
+use datadog_api_client::datadogV2::model::OutputSchema;
+use datadog_api_client::datadogV2::model::OutputSchemaParameters;
+use datadog_api_client::datadogV2::model::OutputSchemaParametersType;
+use datadog_api_client::datadogV2::model::Parameter;
+use datadog_api_client::datadogV2::model::Spec;
+use datadog_api_client::datadogV2::model::Step;
+use datadog_api_client::datadogV2::model::Trigger;
+use datadog_api_client::datadogV2::model::TriggerRateLimit;
+use datadog_api_client::datadogV2::model::WorkflowData;
+use datadog_api_client::datadogV2::model::WorkflowDataAttributes;
+use datadog_api_client::datadogV2::model::WorkflowDataType;
+use serde_json::Value;
+
+#[tokio::main]
+async fn main() {
+ let body = CreateWorkflowRequest::new(WorkflowData::new(
+ WorkflowDataAttributes::new(
+ "Example Workflow".to_string(),
+ Spec::new()
+ .connection_envs(vec![ConnectionEnv::new(ConnectionEnvEnv::DEFAULT)
+ .connections(vec![Connection::new(
+ "11111111-1111-1111-1111-111111111111".to_string(),
+ "INTEGRATION_DATADOG".to_string(),
+ )])])
+ .handle("my-handle".to_string())
+ .input_schema(InputSchema::new().parameters(vec![
+ InputSchemaParameters::new(
+ "input".to_string(),
+ InputSchemaParametersType::STRING,
+ ).default_value(Value::from("default"))
+ ]))
+ .output_schema(OutputSchema::new().parameters(vec![
+ OutputSchemaParameters::new(
+ "output".to_string(),
+ OutputSchemaParametersType::ARRAY_OBJECT,
+ ).value(Value::from("outputValue"))
+ ]))
+ .steps(vec![
+ Step::new(
+ "com.datadoghq.dd.monitor.listMonitors".to_string(),
+ "Step1".to_string(),
+ )
+ .connection_label("INTEGRATION_DATADOG".to_string())
+ .outbound_edges(vec![OutboundEdge::new(
+ "main".to_string(),
+ "Step2".to_string(),
+ )])
+ .parameters(vec![Parameter::new(
+ "tags".to_string(),
+ Value::from("service:monitoring"),
+ )]),
+ Step::new("com.datadoghq.core.noop".to_string(), "Step2".to_string()),
+ ])
+ .triggers(vec![
+ Trigger::MonitorTriggerWrapper(Box::new(
+ MonitorTriggerWrapper::new(
+ MonitorTrigger::new().rate_limit(
+ TriggerRateLimit::new()
+ .count(1)
+ .interval("3600s".to_string()),
+ ),
+ )
+ .start_step_names(vec!["Step1".to_string()]),
+ )),
+ Trigger::GithubWebhookTriggerWrapper(Box::new(
+ GithubWebhookTriggerWrapper::new(GithubWebhookTrigger::new())
+ .start_step_names(vec!["Step1".to_string()]),
+ )),
+ ]),
+ )
+ .description("A sample workflow.".to_string())
+ .published(true)
+ .tags(vec![
+ "team:infra".to_string(),
+ "service:monitoring".to_string(),
+ "foo:bar".to_string(),
+ ]),
+ WorkflowDataType::WORKFLOWS,
+ ));
+ let configuration = datadog::Configuration::new();
+ let api = WorkflowAutomationAPI::with_config(configuration);
+ let resp = api.create_workflow(body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_workflow-automation_DeleteWorkflow.rs b/examples/v2_workflow-automation_DeleteWorkflow.rs
new file mode 100644
index 000000000..597daeb70
--- /dev/null
+++ b/examples/v2_workflow-automation_DeleteWorkflow.rs
@@ -0,0 +1,17 @@
+// Delete an existing Workflow returns "Successfully deleted a workflow." response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "workflow" in the system
+ let workflow_data_id = std::env::var("WORKFLOW_DATA_ID").unwrap();
+ let configuration = datadog::Configuration::new();
+ let api = WorkflowAutomationAPI::with_config(configuration);
+ let resp = api.delete_workflow(workflow_data_id.clone()).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_workflow-automation_GetWorkflow.rs b/examples/v2_workflow-automation_GetWorkflow.rs
new file mode 100644
index 000000000..b2b8721d8
--- /dev/null
+++ b/examples/v2_workflow-automation_GetWorkflow.rs
@@ -0,0 +1,17 @@
+// Get an existing Workflow returns "Successfully got a workflow." response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "workflow" in the system
+ let workflow_data_id = std::env::var("WORKFLOW_DATA_ID").unwrap();
+ let configuration = datadog::Configuration::new();
+ let api = WorkflowAutomationAPI::with_config(configuration);
+ let resp = api.get_workflow(workflow_data_id.clone()).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_workflow-automation_UpdateWorkflow.rs b/examples/v2_workflow-automation_UpdateWorkflow.rs
new file mode 100644
index 000000000..4e8e6eeb4
--- /dev/null
+++ b/examples/v2_workflow-automation_UpdateWorkflow.rs
@@ -0,0 +1,109 @@
+// Update an existing Workflow returns "Successfully updated a workflow." response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;
+use datadog_api_client::datadogV2::model::Connection;
+use datadog_api_client::datadogV2::model::ConnectionEnv;
+use datadog_api_client::datadogV2::model::ConnectionEnvEnv;
+use datadog_api_client::datadogV2::model::GithubWebhookTrigger;
+use datadog_api_client::datadogV2::model::GithubWebhookTriggerWrapper;
+use datadog_api_client::datadogV2::model::InputSchema;
+use datadog_api_client::datadogV2::model::InputSchemaParameters;
+use datadog_api_client::datadogV2::model::InputSchemaParametersType;
+use datadog_api_client::datadogV2::model::MonitorTrigger;
+use datadog_api_client::datadogV2::model::MonitorTriggerWrapper;
+use datadog_api_client::datadogV2::model::OutboundEdge;
+use datadog_api_client::datadogV2::model::OutputSchema;
+use datadog_api_client::datadogV2::model::OutputSchemaParameters;
+use datadog_api_client::datadogV2::model::OutputSchemaParametersType;
+use datadog_api_client::datadogV2::model::Parameter;
+use datadog_api_client::datadogV2::model::Spec;
+use datadog_api_client::datadogV2::model::Step;
+use datadog_api_client::datadogV2::model::Trigger;
+use datadog_api_client::datadogV2::model::TriggerRateLimit;
+use datadog_api_client::datadogV2::model::UpdateWorkflowRequest;
+use datadog_api_client::datadogV2::model::WorkflowDataType;
+use datadog_api_client::datadogV2::model::WorkflowDataUpdate;
+use datadog_api_client::datadogV2::model::WorkflowDataUpdateAttributes;
+use serde_json::Value;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "workflow" in the system
+ let workflow_data_id = std::env::var("WORKFLOW_DATA_ID").unwrap();
+ let body = UpdateWorkflowRequest::new(
+ WorkflowDataUpdate::new(
+ WorkflowDataUpdateAttributes::new()
+ .description("A sample workflow.".to_string())
+ .name("Example Workflow".to_string())
+ .published(true)
+ .spec(
+ Spec::new()
+ .connection_envs(vec![ConnectionEnv::new(ConnectionEnvEnv::DEFAULT)
+ .connections(vec![Connection::new(
+ "11111111-1111-1111-1111-111111111111".to_string(),
+ "INTEGRATION_DATADOG".to_string(),
+ )])])
+ .handle("my-handle".to_string())
+ .input_schema(InputSchema::new().parameters(vec![
+ InputSchemaParameters::new(
+ "input".to_string(),
+ InputSchemaParametersType::STRING,
+ ).default_value(Value::from("default"))
+ ]))
+ .output_schema(OutputSchema::new().parameters(vec![
+ OutputSchemaParameters::new(
+ "output".to_string(),
+ OutputSchemaParametersType::ARRAY_OBJECT,
+ ).value(Value::from("outputValue"))
+ ]))
+ .steps(vec![
+ Step::new(
+ "com.datadoghq.dd.monitor.listMonitors".to_string(),
+ "Step1".to_string(),
+ )
+ .connection_label("INTEGRATION_DATADOG".to_string())
+ .outbound_edges(vec![OutboundEdge::new(
+ "main".to_string(),
+ "Step2".to_string(),
+ )])
+ .parameters(vec![Parameter::new(
+ "tags".to_string(),
+ Value::from("service:monitoring"),
+ )]),
+ Step::new("com.datadoghq.core.noop".to_string(), "Step2".to_string()),
+ ])
+ .triggers(vec![
+ Trigger::MonitorTriggerWrapper(Box::new(
+ MonitorTriggerWrapper::new(
+ MonitorTrigger::new().rate_limit(
+ TriggerRateLimit::new()
+ .count(1)
+ .interval("3600s".to_string()),
+ ),
+ )
+ .start_step_names(vec!["Step1".to_string()]),
+ )),
+ Trigger::GithubWebhookTriggerWrapper(Box::new(
+ GithubWebhookTriggerWrapper::new(GithubWebhookTrigger::new())
+ .start_step_names(vec!["Step1".to_string()]),
+ )),
+ ]),
+ )
+ .tags(vec![
+ "team:infra".to_string(),
+ "service:monitoring".to_string(),
+ "foo:bar".to_string(),
+ ]),
+ WorkflowDataType::WORKFLOWS,
+ )
+ .id("22222222-2222-2222-2222-222222222222".to_string()),
+ );
+ let configuration = datadog::Configuration::new();
+ let api = WorkflowAutomationAPI::with_config(configuration);
+ let resp = api.update_workflow(workflow_data_id.clone(), body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/src/datadogV2/api/api_workflow_automation.rs b/src/datadogV2/api/api_workflow_automation.rs
index 44c1983ef..024d3763c 100644
--- a/src/datadogV2/api/api_workflow_automation.rs
+++ b/src/datadogV2/api/api_workflow_automation.rs
@@ -41,6 +41,14 @@ pub enum CancelWorkflowInstanceError {
UnknownValue(serde_json::Value),
}
+/// CreateWorkflowError is a struct for typed errors of method [`WorkflowAutomationAPI::create_workflow`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum CreateWorkflowError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
/// CreateWorkflowInstanceError is a struct for typed errors of method [`WorkflowAutomationAPI::create_workflow_instance`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -49,6 +57,22 @@ pub enum CreateWorkflowInstanceError {
UnknownValue(serde_json::Value),
}
+/// DeleteWorkflowError is a struct for typed errors of method [`WorkflowAutomationAPI::delete_workflow`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum DeleteWorkflowError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// GetWorkflowError is a struct for typed errors of method [`WorkflowAutomationAPI::get_workflow`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum GetWorkflowError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
/// GetWorkflowInstanceError is a struct for typed errors of method [`WorkflowAutomationAPI::get_workflow_instance`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -65,7 +89,15 @@ pub enum ListWorkflowInstancesError {
UnknownValue(serde_json::Value),
}
-/// Automate your teams operational processes with Datadog Workflow Automation.
+/// UpdateWorkflowError is a struct for typed errors of method [`WorkflowAutomationAPI::update_workflow`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum UpdateWorkflowError {
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// Datadog Workflow Automation allows you to automate your end-to-end processes by connecting Datadog with the rest of your tech stack. Build workflows to auto-remediate your alerts, streamline your incident and security processes, and reduce manual toil. Workflow Automation supports over 1,000+ OOTB actions, including AWS, JIRA, ServiceNow, GitHub, and OpenAI. Learn more in our Workflow Automation docs [here]().
#[derive(Debug, Clone)]
pub struct WorkflowAutomationAPI {
config: datadog::Configuration,
@@ -245,6 +277,158 @@ impl WorkflowAutomationAPI {
}
}
+ /// Create a new workflow, returning the workflow ID. This API requires an application key scoped with the `workflows_write` permission.
+ pub async fn create_workflow(
+ &self,
+ body: crate::datadogV2::model::CreateWorkflowRequest,
+ ) -> Result>
+ {
+ match self.create_workflow_with_http_info(body).await {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Create a new workflow, returning the workflow ID. This API requires an application key scoped with the `workflows_write` permission.
+ pub async fn create_workflow_with_http_info(
+ &self,
+ body: crate::datadogV2::model::CreateWorkflowRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.create_workflow";
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/workflows",
+ local_configuration.get_operation_host(operation_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::POST, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
/// Execute the given workflow. This API requires an application key scoped with the workflows_run permission.
pub async fn create_workflow_instance(
&self,
@@ -405,6 +589,200 @@ impl WorkflowAutomationAPI {
}
}
+ /// Delete a workflow by ID. This API requires an application key scoped with the `workflows_write` permission.
+ pub async fn delete_workflow(
+ &self,
+ workflow_id: String,
+ ) -> Result<(), datadog::Error> {
+ match self.delete_workflow_with_http_info(workflow_id).await {
+ Ok(_) => Ok(()),
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Delete a workflow by ID. This API requires an application key scoped with the `workflows_write` permission.
+ pub async fn delete_workflow_with_http_info(
+ &self,
+ workflow_id: String,
+ ) -> Result, datadog::Error> {
+ let local_configuration = &self.config;
+ let operation_id = "v2.delete_workflow";
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/workflows/{workflow_id}",
+ local_configuration.get_operation_host(operation_id),
+ workflow_id = datadog::urlencode(workflow_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("*/*"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: None,
+ })
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Get a workflow by ID. This API requires an application key scoped with the `workflows_read` permission.
+ pub async fn get_workflow(
+ &self,
+ workflow_id: String,
+ ) -> Result>
+ {
+ match self.get_workflow_with_http_info(workflow_id).await {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Get a workflow by ID. This API requires an application key scoped with the `workflows_read` permission.
+ pub async fn get_workflow_with_http_info(
+ &self,
+ workflow_id: String,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.get_workflow";
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/workflows/{workflow_id}",
+ local_configuration.get_operation_host(operation_id),
+ workflow_id = datadog::urlencode(workflow_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option = serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
/// Get a specific execution of a given workflow. This API requires an application key scoped with the workflows_read permission.
pub async fn get_workflow_instance(
&self,
@@ -646,4 +1024,159 @@ impl WorkflowAutomationAPI {
Err(datadog::Error::ResponseError(local_error))
}
}
+
+ /// Update a workflow by ID. This API requires an application key scoped with the `workflows_write` permission.
+ pub async fn update_workflow(
+ &self,
+ workflow_id: String,
+ body: crate::datadogV2::model::UpdateWorkflowRequest,
+ ) -> Result>
+ {
+ match self.update_workflow_with_http_info(workflow_id, body).await {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Update a workflow by ID. This API requires an application key scoped with the `workflows_write` permission.
+ pub async fn update_workflow_with_http_info(
+ &self,
+ workflow_id: String,
+ body: crate::datadogV2::model::UpdateWorkflowRequest,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.update_workflow";
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/workflows/{workflow_id}",
+ local_configuration.get_operation_host(operation_id),
+ workflow_id = datadog::urlencode(workflow_id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
}
diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs
index 6d3539230..4a3fbeaa8 100644
--- a/src/datadogV2/model/mod.rs
+++ b/src/datadogV2/model/mod.rs
@@ -3864,6 +3864,134 @@ pub mod model_user_update_data;
pub use self::model_user_update_data::UserUpdateData;
pub mod model_user_update_attributes;
pub use self::model_user_update_attributes::UserUpdateAttributes;
+pub mod model_create_workflow_request;
+pub use self::model_create_workflow_request::CreateWorkflowRequest;
+pub mod model_workflow_data;
+pub use self::model_workflow_data::WorkflowData;
+pub mod model_workflow_data_attributes;
+pub use self::model_workflow_data_attributes::WorkflowDataAttributes;
+pub mod model_spec;
+pub use self::model_spec::Spec;
+pub mod model_annotation;
+pub use self::model_annotation::Annotation;
+pub mod model_annotation_display;
+pub use self::model_annotation_display::AnnotationDisplay;
+pub mod model_annotation_display_bounds;
+pub use self::model_annotation_display_bounds::AnnotationDisplayBounds;
+pub mod model_annotation_markdown_text_annotation;
+pub use self::model_annotation_markdown_text_annotation::AnnotationMarkdownTextAnnotation;
+pub mod model_connection_env;
+pub use self::model_connection_env::ConnectionEnv;
+pub mod model_connection_group;
+pub use self::model_connection_group::ConnectionGroup;
+pub mod model_connection;
+pub use self::model_connection::Connection;
+pub mod model_connection_env_env;
+pub use self::model_connection_env_env::ConnectionEnvEnv;
+pub mod model_input_schema;
+pub use self::model_input_schema::InputSchema;
+pub mod model_input_schema_parameters;
+pub use self::model_input_schema_parameters::InputSchemaParameters;
+pub mod model_input_schema_parameters_type;
+pub use self::model_input_schema_parameters_type::InputSchemaParametersType;
+pub mod model_output_schema;
+pub use self::model_output_schema::OutputSchema;
+pub mod model_output_schema_parameters;
+pub use self::model_output_schema_parameters::OutputSchemaParameters;
+pub mod model_output_schema_parameters_type;
+pub use self::model_output_schema_parameters_type::OutputSchemaParametersType;
+pub mod model_step;
+pub use self::model_step::Step;
+pub mod model_completion_gate;
+pub use self::model_completion_gate::CompletionGate;
+pub mod model_completion_condition;
+pub use self::model_completion_condition::CompletionCondition;
+pub mod model_completion_condition_operator;
+pub use self::model_completion_condition_operator::CompletionConditionOperator;
+pub mod model_retry_strategy;
+pub use self::model_retry_strategy::RetryStrategy;
+pub mod model_retry_strategy_kind;
+pub use self::model_retry_strategy_kind::RetryStrategyKind;
+pub mod model_retry_strategy_linear;
+pub use self::model_retry_strategy_linear::RetryStrategyLinear;
+pub mod model_step_display;
+pub use self::model_step_display::StepDisplay;
+pub mod model_step_display_bounds;
+pub use self::model_step_display_bounds::StepDisplayBounds;
+pub mod model_error_handler;
+pub use self::model_error_handler::ErrorHandler;
+pub mod model_outbound_edge;
+pub use self::model_outbound_edge::OutboundEdge;
+pub mod model_parameter;
+pub use self::model_parameter::Parameter;
+pub mod model_readiness_gate;
+pub use self::model_readiness_gate::ReadinessGate;
+pub mod model_readiness_gate_threshold_type;
+pub use self::model_readiness_gate_threshold_type::ReadinessGateThresholdType;
+pub mod model_api_trigger_wrapper;
+pub use self::model_api_trigger_wrapper::APITriggerWrapper;
+pub mod model_api_trigger;
+pub use self::model_api_trigger::APITrigger;
+pub mod model_trigger_rate_limit;
+pub use self::model_trigger_rate_limit::TriggerRateLimit;
+pub mod model_app_trigger_wrapper;
+pub use self::model_app_trigger_wrapper::AppTriggerWrapper;
+pub mod model_case_trigger_wrapper;
+pub use self::model_case_trigger_wrapper::CaseTriggerWrapper;
+pub mod model_case_trigger;
+pub use self::model_case_trigger::CaseTrigger;
+pub mod model_change_event_trigger_wrapper;
+pub use self::model_change_event_trigger_wrapper::ChangeEventTriggerWrapper;
+pub mod model_dashboard_trigger_wrapper;
+pub use self::model_dashboard_trigger_wrapper::DashboardTriggerWrapper;
+pub mod model_github_webhook_trigger_wrapper;
+pub use self::model_github_webhook_trigger_wrapper::GithubWebhookTriggerWrapper;
+pub mod model_github_webhook_trigger;
+pub use self::model_github_webhook_trigger::GithubWebhookTrigger;
+pub mod model_incident_trigger_wrapper;
+pub use self::model_incident_trigger_wrapper::IncidentTriggerWrapper;
+pub mod model_incident_trigger;
+pub use self::model_incident_trigger::IncidentTrigger;
+pub mod model_monitor_trigger_wrapper;
+pub use self::model_monitor_trigger_wrapper::MonitorTriggerWrapper;
+pub mod model_monitor_trigger;
+pub use self::model_monitor_trigger::MonitorTrigger;
+pub mod model_schedule_trigger_wrapper;
+pub use self::model_schedule_trigger_wrapper::ScheduleTriggerWrapper;
+pub mod model_schedule_trigger;
+pub use self::model_schedule_trigger::ScheduleTrigger;
+pub mod model_security_trigger_wrapper;
+pub use self::model_security_trigger_wrapper::SecurityTriggerWrapper;
+pub mod model_security_trigger;
+pub use self::model_security_trigger::SecurityTrigger;
+pub mod model_slack_trigger_wrapper;
+pub use self::model_slack_trigger_wrapper::SlackTriggerWrapper;
+pub mod model_workflow_trigger_wrapper;
+pub use self::model_workflow_trigger_wrapper::WorkflowTriggerWrapper;
+pub mod model_trigger;
+pub use self::model_trigger::Trigger;
+pub mod model_workflow_data_relationships;
+pub use self::model_workflow_data_relationships::WorkflowDataRelationships;
+pub mod model_workflow_user_relationship;
+pub use self::model_workflow_user_relationship::WorkflowUserRelationship;
+pub mod model_workflow_user_relationship_data;
+pub use self::model_workflow_user_relationship_data::WorkflowUserRelationshipData;
+pub mod model_workflow_user_relationship_type;
+pub use self::model_workflow_user_relationship_type::WorkflowUserRelationshipType;
+pub mod model_workflow_data_type;
+pub use self::model_workflow_data_type::WorkflowDataType;
+pub mod model_create_workflow_response;
+pub use self::model_create_workflow_response::CreateWorkflowResponse;
+pub mod model_get_workflow_response;
+pub use self::model_get_workflow_response::GetWorkflowResponse;
+pub mod model_update_workflow_request;
+pub use self::model_update_workflow_request::UpdateWorkflowRequest;
+pub mod model_workflow_data_update;
+pub use self::model_workflow_data_update::WorkflowDataUpdate;
+pub mod model_workflow_data_update_attributes;
+pub use self::model_workflow_data_update_attributes::WorkflowDataUpdateAttributes;
+pub mod model_update_workflow_response;
+pub use self::model_update_workflow_response::UpdateWorkflowResponse;
pub mod model_workflow_list_instances_response;
pub use self::model_workflow_list_instances_response::WorkflowListInstancesResponse;
pub mod model_workflow_instance_list_item;
diff --git a/src/datadogV2/model/model_annotation.rs b/src/datadogV2/model/model_annotation.rs
new file mode 100644
index 000000000..04469bfb2
--- /dev/null
+++ b/src/datadogV2/model/model_annotation.rs
@@ -0,0 +1,120 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// A list of annotations used in the workflow. These are like sticky notes for your workflow!
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct Annotation {
+ /// The definition of `AnnotationDisplay` object.
+ #[serde(rename = "display")]
+ pub display: crate::datadogV2::model::AnnotationDisplay,
+ /// The `Annotation` `id`.
+ #[serde(rename = "id")]
+ pub id: String,
+ /// The definition of `AnnotationMarkdownTextAnnotation` object.
+ #[serde(rename = "markdownTextAnnotation")]
+ pub markdown_text_annotation: crate::datadogV2::model::AnnotationMarkdownTextAnnotation,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl Annotation {
+ pub fn new(
+ display: crate::datadogV2::model::AnnotationDisplay,
+ id: String,
+ markdown_text_annotation: crate::datadogV2::model::AnnotationMarkdownTextAnnotation,
+ ) -> Annotation {
+ Annotation {
+ display,
+ id,
+ markdown_text_annotation,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for Annotation {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct AnnotationVisitor;
+ impl<'a> Visitor<'a> for AnnotationVisitor {
+ type Value = Annotation;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut display: Option = None;
+ let mut id: Option = None;
+ let mut markdown_text_annotation: Option<
+ crate::datadogV2::model::AnnotationMarkdownTextAnnotation,
+ > = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "display" => {
+ display = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "id" => {
+ id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "markdownTextAnnotation" => {
+ markdown_text_annotation =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let display = display.ok_or_else(|| M::Error::missing_field("display"))?;
+ let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
+ let markdown_text_annotation = markdown_text_annotation
+ .ok_or_else(|| M::Error::missing_field("markdown_text_annotation"))?;
+
+ let content = Annotation {
+ display,
+ id,
+ markdown_text_annotation,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(AnnotationVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_annotation_display.rs b/src/datadogV2/model/model_annotation_display.rs
new file mode 100644
index 000000000..d8084780c
--- /dev/null
+++ b/src/datadogV2/model/model_annotation_display.rs
@@ -0,0 +1,105 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// The definition of `AnnotationDisplay` object.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct AnnotationDisplay {
+ /// The definition of `AnnotationDisplayBounds` object.
+ #[serde(rename = "bounds")]
+ pub bounds: Option,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl AnnotationDisplay {
+ pub fn new() -> AnnotationDisplay {
+ AnnotationDisplay {
+ bounds: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn bounds(mut self, value: crate::datadogV2::model::AnnotationDisplayBounds) -> Self {
+ self.bounds = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl Default for AnnotationDisplay {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl<'de> Deserialize<'de> for AnnotationDisplay {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct AnnotationDisplayVisitor;
+ impl<'a> Visitor<'a> for AnnotationDisplayVisitor {
+ type Value = AnnotationDisplay;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut bounds: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "bounds" => {
+ if v.is_null() {
+ continue;
+ }
+ bounds = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+
+ let content = AnnotationDisplay {
+ bounds,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(AnnotationDisplayVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_annotation_display_bounds.rs b/src/datadogV2/model/model_annotation_display_bounds.rs
new file mode 100644
index 000000000..0d6eb5282
--- /dev/null
+++ b/src/datadogV2/model/model_annotation_display_bounds.rs
@@ -0,0 +1,156 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// The definition of `AnnotationDisplayBounds` object.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct AnnotationDisplayBounds {
+ /// The `bounds` `height`.
+ #[serde(rename = "height")]
+ pub height: Option,
+ /// The `bounds` `width`.
+ #[serde(rename = "width")]
+ pub width: Option,
+ /// The `bounds` `x`.
+ #[serde(rename = "x")]
+ pub x: Option,
+ /// The `bounds` `y`.
+ #[serde(rename = "y")]
+ pub y: Option,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl AnnotationDisplayBounds {
+ pub fn new() -> AnnotationDisplayBounds {
+ AnnotationDisplayBounds {
+ height: None,
+ width: None,
+ x: None,
+ y: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn height(mut self, value: f64) -> Self {
+ self.height = Some(value);
+ self
+ }
+
+ pub fn width(mut self, value: f64) -> Self {
+ self.width = Some(value);
+ self
+ }
+
+ pub fn x(mut self, value: f64) -> Self {
+ self.x = Some(value);
+ self
+ }
+
+ pub fn y(mut self, value: f64) -> Self {
+ self.y = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl Default for AnnotationDisplayBounds {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl<'de> Deserialize<'de> for AnnotationDisplayBounds {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct AnnotationDisplayBoundsVisitor;
+ impl<'a> Visitor<'a> for AnnotationDisplayBoundsVisitor {
+ type Value = AnnotationDisplayBounds;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut height: Option = None;
+ let mut width: Option = None;
+ let mut x: Option = None;
+ let mut y: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "height" => {
+ if v.is_null() {
+ continue;
+ }
+ height = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "width" => {
+ if v.is_null() {
+ continue;
+ }
+ width = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "x" => {
+ if v.is_null() {
+ continue;
+ }
+ x = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "y" => {
+ if v.is_null() {
+ continue;
+ }
+ y = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+
+ let content = AnnotationDisplayBounds {
+ height,
+ width,
+ x,
+ y,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(AnnotationDisplayBoundsVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_annotation_markdown_text_annotation.rs b/src/datadogV2/model/model_annotation_markdown_text_annotation.rs
new file mode 100644
index 000000000..494728d88
--- /dev/null
+++ b/src/datadogV2/model/model_annotation_markdown_text_annotation.rs
@@ -0,0 +1,105 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// The definition of `AnnotationMarkdownTextAnnotation` object.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct AnnotationMarkdownTextAnnotation {
+ /// The `markdownTextAnnotation` `text`.
+ #[serde(rename = "text")]
+ pub text: Option,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl AnnotationMarkdownTextAnnotation {
+ pub fn new() -> AnnotationMarkdownTextAnnotation {
+ AnnotationMarkdownTextAnnotation {
+ text: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn text(mut self, value: String) -> Self {
+ self.text = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl Default for AnnotationMarkdownTextAnnotation {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl<'de> Deserialize<'de> for AnnotationMarkdownTextAnnotation {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct AnnotationMarkdownTextAnnotationVisitor;
+ impl<'a> Visitor<'a> for AnnotationMarkdownTextAnnotationVisitor {
+ type Value = AnnotationMarkdownTextAnnotation;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut text: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "text" => {
+ if v.is_null() {
+ continue;
+ }
+ text = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+
+ let content = AnnotationMarkdownTextAnnotation {
+ text,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(AnnotationMarkdownTextAnnotationVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_api_trigger.rs b/src/datadogV2/model/model_api_trigger.rs
new file mode 100644
index 000000000..d0f908d43
--- /dev/null
+++ b/src/datadogV2/model/model_api_trigger.rs
@@ -0,0 +1,105 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Trigger a workflow VIA an API. The workflow must be published.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct APITrigger {
+ /// Defines a rate limit for a trigger.
+ #[serde(rename = "rateLimit")]
+ pub rate_limit: Option,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl APITrigger {
+ pub fn new() -> APITrigger {
+ APITrigger {
+ rate_limit: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn rate_limit(mut self, value: crate::datadogV2::model::TriggerRateLimit) -> Self {
+ self.rate_limit = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl Default for APITrigger {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl<'de> Deserialize<'de> for APITrigger {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct APITriggerVisitor;
+ impl<'a> Visitor<'a> for APITriggerVisitor {
+ type Value = APITrigger;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut rate_limit: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "rateLimit" => {
+ if v.is_null() {
+ continue;
+ }
+ rate_limit = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+
+ let content = APITrigger {
+ rate_limit,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(APITriggerVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_api_trigger_wrapper.rs b/src/datadogV2/model/model_api_trigger_wrapper.rs
new file mode 100644
index 000000000..673e26328
--- /dev/null
+++ b/src/datadogV2/model/model_api_trigger_wrapper.rs
@@ -0,0 +1,112 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Schema for an API-based trigger.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct APITriggerWrapper {
+ /// Trigger a workflow VIA an API. The workflow must be published.
+ #[serde(rename = "apiTrigger")]
+ pub api_trigger: crate::datadogV2::model::APITrigger,
+ /// A list of steps that run first after a trigger fires.
+ #[serde(rename = "startStepNames")]
+ pub start_step_names: Option>,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl APITriggerWrapper {
+ pub fn new(api_trigger: crate::datadogV2::model::APITrigger) -> APITriggerWrapper {
+ APITriggerWrapper {
+ api_trigger,
+ start_step_names: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn start_step_names(mut self, value: Vec) -> Self {
+ self.start_step_names = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for APITriggerWrapper {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct APITriggerWrapperVisitor;
+ impl<'a> Visitor<'a> for APITriggerWrapperVisitor {
+ type Value = APITriggerWrapper;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut api_trigger: Option = None;
+ let mut start_step_names: Option> = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "apiTrigger" => {
+ api_trigger =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "startStepNames" => {
+ if v.is_null() {
+ continue;
+ }
+ start_step_names =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let api_trigger =
+ api_trigger.ok_or_else(|| M::Error::missing_field("api_trigger"))?;
+
+ let content = APITriggerWrapper {
+ api_trigger,
+ start_step_names,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(APITriggerWrapperVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_app_trigger_wrapper.rs b/src/datadogV2/model/model_app_trigger_wrapper.rs
new file mode 100644
index 000000000..1a42d3283
--- /dev/null
+++ b/src/datadogV2/model/model_app_trigger_wrapper.rs
@@ -0,0 +1,115 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Schema for an App-based trigger.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct AppTriggerWrapper {
+ /// Trigger a workflow VIA an App.
+ #[serde(rename = "appTrigger")]
+ pub app_trigger: std::collections::BTreeMap,
+ /// A list of steps that run first after a trigger fires.
+ #[serde(rename = "startStepNames")]
+ pub start_step_names: Option>,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl AppTriggerWrapper {
+ pub fn new(
+ app_trigger: std::collections::BTreeMap,
+ ) -> AppTriggerWrapper {
+ AppTriggerWrapper {
+ app_trigger,
+ start_step_names: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn start_step_names(mut self, value: Vec) -> Self {
+ self.start_step_names = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for AppTriggerWrapper {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct AppTriggerWrapperVisitor;
+ impl<'a> Visitor<'a> for AppTriggerWrapperVisitor {
+ type Value = AppTriggerWrapper;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut app_trigger: Option> =
+ None;
+ let mut start_step_names: Option> = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "appTrigger" => {
+ app_trigger =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "startStepNames" => {
+ if v.is_null() {
+ continue;
+ }
+ start_step_names =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let app_trigger =
+ app_trigger.ok_or_else(|| M::Error::missing_field("app_trigger"))?;
+
+ let content = AppTriggerWrapper {
+ app_trigger,
+ start_step_names,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(AppTriggerWrapperVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_case_trigger.rs b/src/datadogV2/model/model_case_trigger.rs
new file mode 100644
index 000000000..1bfec2f46
--- /dev/null
+++ b/src/datadogV2/model/model_case_trigger.rs
@@ -0,0 +1,105 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Trigger a workflow VIA a Case. For automatic triggering a handle must be configured and the workflow must be published.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct CaseTrigger {
+ /// Defines a rate limit for a trigger.
+ #[serde(rename = "rateLimit")]
+ pub rate_limit: Option,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl CaseTrigger {
+ pub fn new() -> CaseTrigger {
+ CaseTrigger {
+ rate_limit: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn rate_limit(mut self, value: crate::datadogV2::model::TriggerRateLimit) -> Self {
+ self.rate_limit = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl Default for CaseTrigger {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl<'de> Deserialize<'de> for CaseTrigger {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct CaseTriggerVisitor;
+ impl<'a> Visitor<'a> for CaseTriggerVisitor {
+ type Value = CaseTrigger;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut rate_limit: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "rateLimit" => {
+ if v.is_null() {
+ continue;
+ }
+ rate_limit = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+
+ let content = CaseTrigger {
+ rate_limit,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(CaseTriggerVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_case_trigger_wrapper.rs b/src/datadogV2/model/model_case_trigger_wrapper.rs
new file mode 100644
index 000000000..f284ee9d1
--- /dev/null
+++ b/src/datadogV2/model/model_case_trigger_wrapper.rs
@@ -0,0 +1,112 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Schema for a Case-based trigger.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct CaseTriggerWrapper {
+ /// Trigger a workflow VIA a Case. For automatic triggering a handle must be configured and the workflow must be published.
+ #[serde(rename = "caseTrigger")]
+ pub case_trigger: crate::datadogV2::model::CaseTrigger,
+ /// A list of steps that run first after a trigger fires.
+ #[serde(rename = "startStepNames")]
+ pub start_step_names: Option>,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl CaseTriggerWrapper {
+ pub fn new(case_trigger: crate::datadogV2::model::CaseTrigger) -> CaseTriggerWrapper {
+ CaseTriggerWrapper {
+ case_trigger,
+ start_step_names: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn start_step_names(mut self, value: Vec) -> Self {
+ self.start_step_names = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for CaseTriggerWrapper {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct CaseTriggerWrapperVisitor;
+ impl<'a> Visitor<'a> for CaseTriggerWrapperVisitor {
+ type Value = CaseTriggerWrapper;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut case_trigger: Option = None;
+ let mut start_step_names: Option> = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "caseTrigger" => {
+ case_trigger =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "startStepNames" => {
+ if v.is_null() {
+ continue;
+ }
+ start_step_names =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let case_trigger =
+ case_trigger.ok_or_else(|| M::Error::missing_field("case_trigger"))?;
+
+ let content = CaseTriggerWrapper {
+ case_trigger,
+ start_step_names,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(CaseTriggerWrapperVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_change_event_trigger_wrapper.rs b/src/datadogV2/model/model_change_event_trigger_wrapper.rs
new file mode 100644
index 000000000..4d9f5dd16
--- /dev/null
+++ b/src/datadogV2/model/model_change_event_trigger_wrapper.rs
@@ -0,0 +1,116 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Schema for a Change Event-based trigger.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct ChangeEventTriggerWrapper {
+ /// Trigger a workflow VIA a Change Event.
+ #[serde(rename = "changeEventTrigger")]
+ pub change_event_trigger: std::collections::BTreeMap,
+ /// A list of steps that run first after a trigger fires.
+ #[serde(rename = "startStepNames")]
+ pub start_step_names: Option>,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl ChangeEventTriggerWrapper {
+ pub fn new(
+ change_event_trigger: std::collections::BTreeMap,
+ ) -> ChangeEventTriggerWrapper {
+ ChangeEventTriggerWrapper {
+ change_event_trigger,
+ start_step_names: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn start_step_names(mut self, value: Vec) -> Self {
+ self.start_step_names = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for ChangeEventTriggerWrapper {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct ChangeEventTriggerWrapperVisitor;
+ impl<'a> Visitor<'a> for ChangeEventTriggerWrapperVisitor {
+ type Value = ChangeEventTriggerWrapper;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut change_event_trigger: Option<
+ std::collections::BTreeMap,
+ > = None;
+ let mut start_step_names: Option> = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "changeEventTrigger" => {
+ change_event_trigger =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "startStepNames" => {
+ if v.is_null() {
+ continue;
+ }
+ start_step_names =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let change_event_trigger = change_event_trigger
+ .ok_or_else(|| M::Error::missing_field("change_event_trigger"))?;
+
+ let content = ChangeEventTriggerWrapper {
+ change_event_trigger,
+ start_step_names,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(ChangeEventTriggerWrapperVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_completion_condition.rs b/src/datadogV2/model/model_completion_condition.rs
new file mode 100644
index 000000000..167068db7
--- /dev/null
+++ b/src/datadogV2/model/model_completion_condition.rs
@@ -0,0 +1,131 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// The definition of `CompletionCondition` object.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct CompletionCondition {
+ /// The `CompletionCondition` `operand1`.
+ #[serde(rename = "operand1")]
+ pub operand1: serde_json::Value,
+ /// The `CompletionCondition` `operand2`.
+ #[serde(rename = "operand2")]
+ pub operand2: Option,
+ /// The definition of `CompletionConditionOperator` object.
+ #[serde(rename = "operator")]
+ pub operator: crate::datadogV2::model::CompletionConditionOperator,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl CompletionCondition {
+ pub fn new(
+ operand1: serde_json::Value,
+ operator: crate::datadogV2::model::CompletionConditionOperator,
+ ) -> CompletionCondition {
+ CompletionCondition {
+ operand1,
+ operand2: None,
+ operator,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn operand2(mut self, value: serde_json::Value) -> Self {
+ self.operand2 = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for CompletionCondition {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct CompletionConditionVisitor;
+ impl<'a> Visitor<'a> for CompletionConditionVisitor {
+ type Value = CompletionCondition;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut operand1: Option = None;
+ let mut operand2: Option = None;
+ let mut operator: Option =
+ None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "operand1" => {
+ operand1 = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "operand2" => {
+ if v.is_null() {
+ continue;
+ }
+ operand2 = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "operator" => {
+ operator = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ if let Some(ref _operator) = operator {
+ match _operator {
+ crate::datadogV2::model::CompletionConditionOperator::UnparsedObject(_operator) => {
+ _unparsed = true;
+ },
+ _ => {}
+ }
+ }
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let operand1 = operand1.ok_or_else(|| M::Error::missing_field("operand1"))?;
+ let operator = operator.ok_or_else(|| M::Error::missing_field("operator"))?;
+
+ let content = CompletionCondition {
+ operand1,
+ operand2,
+ operator,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(CompletionConditionVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_completion_condition_operator.rs b/src/datadogV2/model/model_completion_condition_operator.rs
new file mode 100644
index 000000000..991536593
--- /dev/null
+++ b/src/datadogV2/model/model_completion_condition_operator.rs
@@ -0,0 +1,83 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+
+use serde::{Deserialize, Deserializer, Serialize, Serializer};
+
+#[non_exhaustive]
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum CompletionConditionOperator {
+ OPERATOR_EQUAL,
+ OPERATOR_NOT_EQUAL,
+ OPERATOR_GREATER_THAN,
+ OPERATOR_LESS_THAN,
+ OPERATOR_GREATER_THAN_OR_EQUAL_TO,
+ OPERATOR_LESS_THAN_OR_EQUAL_TO,
+ OPERATOR_CONTAINS,
+ OPERATOR_DOES_NOT_CONTAIN,
+ OPERATOR_IS_NULL,
+ OPERATOR_IS_NOT_NULL,
+ OPERATOR_IS_EMPTY,
+ OPERATOR_IS_NOT_EMPTY,
+ UnparsedObject(crate::datadog::UnparsedObject),
+}
+
+impl ToString for CompletionConditionOperator {
+ fn to_string(&self) -> String {
+ match self {
+ Self::OPERATOR_EQUAL => String::from("OPERATOR_EQUAL"),
+ Self::OPERATOR_NOT_EQUAL => String::from("OPERATOR_NOT_EQUAL"),
+ Self::OPERATOR_GREATER_THAN => String::from("OPERATOR_GREATER_THAN"),
+ Self::OPERATOR_LESS_THAN => String::from("OPERATOR_LESS_THAN"),
+ Self::OPERATOR_GREATER_THAN_OR_EQUAL_TO => {
+ String::from("OPERATOR_GREATER_THAN_OR_EQUAL_TO")
+ }
+ Self::OPERATOR_LESS_THAN_OR_EQUAL_TO => String::from("OPERATOR_LESS_THAN_OR_EQUAL_TO"),
+ Self::OPERATOR_CONTAINS => String::from("OPERATOR_CONTAINS"),
+ Self::OPERATOR_DOES_NOT_CONTAIN => String::from("OPERATOR_DOES_NOT_CONTAIN"),
+ Self::OPERATOR_IS_NULL => String::from("OPERATOR_IS_NULL"),
+ Self::OPERATOR_IS_NOT_NULL => String::from("OPERATOR_IS_NOT_NULL"),
+ Self::OPERATOR_IS_EMPTY => String::from("OPERATOR_IS_EMPTY"),
+ Self::OPERATOR_IS_NOT_EMPTY => String::from("OPERATOR_IS_NOT_EMPTY"),
+ Self::UnparsedObject(v) => v.value.to_string(),
+ }
+ }
+}
+
+impl Serialize for CompletionConditionOperator {
+ fn serialize(&self, serializer: S) -> Result
+ where
+ S: Serializer,
+ {
+ match self {
+ Self::UnparsedObject(v) => v.serialize(serializer),
+ _ => serializer.serialize_str(self.to_string().as_str()),
+ }
+ }
+}
+
+impl<'de> Deserialize<'de> for CompletionConditionOperator {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ let s: String = String::deserialize(deserializer)?;
+ Ok(match s.as_str() {
+ "OPERATOR_EQUAL" => Self::OPERATOR_EQUAL,
+ "OPERATOR_NOT_EQUAL" => Self::OPERATOR_NOT_EQUAL,
+ "OPERATOR_GREATER_THAN" => Self::OPERATOR_GREATER_THAN,
+ "OPERATOR_LESS_THAN" => Self::OPERATOR_LESS_THAN,
+ "OPERATOR_GREATER_THAN_OR_EQUAL_TO" => Self::OPERATOR_GREATER_THAN_OR_EQUAL_TO,
+ "OPERATOR_LESS_THAN_OR_EQUAL_TO" => Self::OPERATOR_LESS_THAN_OR_EQUAL_TO,
+ "OPERATOR_CONTAINS" => Self::OPERATOR_CONTAINS,
+ "OPERATOR_DOES_NOT_CONTAIN" => Self::OPERATOR_DOES_NOT_CONTAIN,
+ "OPERATOR_IS_NULL" => Self::OPERATOR_IS_NULL,
+ "OPERATOR_IS_NOT_NULL" => Self::OPERATOR_IS_NOT_NULL,
+ "OPERATOR_IS_EMPTY" => Self::OPERATOR_IS_EMPTY,
+ "OPERATOR_IS_NOT_EMPTY" => Self::OPERATOR_IS_NOT_EMPTY,
+ _ => Self::UnparsedObject(crate::datadog::UnparsedObject {
+ value: serde_json::Value::String(s.into()),
+ }),
+ })
+ }
+}
diff --git a/src/datadogV2/model/model_completion_gate.rs b/src/datadogV2/model/model_completion_gate.rs
new file mode 100644
index 000000000..4029b2105
--- /dev/null
+++ b/src/datadogV2/model/model_completion_gate.rs
@@ -0,0 +1,110 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Used to create conditions before running subsequent actions.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct CompletionGate {
+ /// The definition of `CompletionCondition` object.
+ #[serde(rename = "completionCondition")]
+ pub completion_condition: crate::datadogV2::model::CompletionCondition,
+ /// The definition of `RetryStrategy` object.
+ #[serde(rename = "retryStrategy")]
+ pub retry_strategy: crate::datadogV2::model::RetryStrategy,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl CompletionGate {
+ pub fn new(
+ completion_condition: crate::datadogV2::model::CompletionCondition,
+ retry_strategy: crate::datadogV2::model::RetryStrategy,
+ ) -> CompletionGate {
+ CompletionGate {
+ completion_condition,
+ retry_strategy,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for CompletionGate {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct CompletionGateVisitor;
+ impl<'a> Visitor<'a> for CompletionGateVisitor {
+ type Value = CompletionGate;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut completion_condition: Option =
+ None;
+ let mut retry_strategy: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "completionCondition" => {
+ completion_condition =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "retryStrategy" => {
+ retry_strategy =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let completion_condition = completion_condition
+ .ok_or_else(|| M::Error::missing_field("completion_condition"))?;
+ let retry_strategy =
+ retry_strategy.ok_or_else(|| M::Error::missing_field("retry_strategy"))?;
+
+ let content = CompletionGate {
+ completion_condition,
+ retry_strategy,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(CompletionGateVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_connection.rs b/src/datadogV2/model/model_connection.rs
new file mode 100644
index 000000000..a795a868d
--- /dev/null
+++ b/src/datadogV2/model/model_connection.rs
@@ -0,0 +1,104 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// The definition of `Connection` object.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct Connection {
+ /// The `Connection` `connectionId`.
+ #[serde(rename = "connectionId")]
+ pub connection_id: String,
+ /// The `Connection` `label`.
+ #[serde(rename = "label")]
+ pub label: String,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl Connection {
+ pub fn new(connection_id: String, label: String) -> Connection {
+ Connection {
+ connection_id,
+ label,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for Connection {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct ConnectionVisitor;
+ impl<'a> Visitor<'a> for ConnectionVisitor {
+ type Value = Connection;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut connection_id: Option = None;
+ let mut label: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "connectionId" => {
+ connection_id =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "label" => {
+ label = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let connection_id =
+ connection_id.ok_or_else(|| M::Error::missing_field("connection_id"))?;
+ let label = label.ok_or_else(|| M::Error::missing_field("label"))?;
+
+ let content = Connection {
+ connection_id,
+ label,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(ConnectionVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_connection_env.rs b/src/datadogV2/model/model_connection_env.rs
new file mode 100644
index 000000000..184d39cbf
--- /dev/null
+++ b/src/datadogV2/model/model_connection_env.rs
@@ -0,0 +1,142 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// A list of connections or connection groups used in the workflow.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct ConnectionEnv {
+ /// The `ConnectionEnv` `connectionGroups`.
+ #[serde(rename = "connectionGroups")]
+ pub connection_groups: Option>,
+ /// The `ConnectionEnv` `connections`.
+ #[serde(rename = "connections")]
+ pub connections: Option>,
+ /// The definition of `ConnectionEnvEnv` object.
+ #[serde(rename = "env")]
+ pub env: crate::datadogV2::model::ConnectionEnvEnv,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl ConnectionEnv {
+ pub fn new(env: crate::datadogV2::model::ConnectionEnvEnv) -> ConnectionEnv {
+ ConnectionEnv {
+ connection_groups: None,
+ connections: None,
+ env,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn connection_groups(
+ mut self,
+ value: Vec,
+ ) -> Self {
+ self.connection_groups = Some(value);
+ self
+ }
+
+ pub fn connections(mut self, value: Vec) -> Self {
+ self.connections = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for ConnectionEnv {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct ConnectionEnvVisitor;
+ impl<'a> Visitor<'a> for ConnectionEnvVisitor {
+ type Value = ConnectionEnv;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut connection_groups: Option> =
+ None;
+ let mut connections: Option> = None;
+ let mut env: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "connectionGroups" => {
+ if v.is_null() {
+ continue;
+ }
+ connection_groups =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "connections" => {
+ if v.is_null() {
+ continue;
+ }
+ connections =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "env" => {
+ env = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ if let Some(ref _env) = env {
+ match _env {
+ crate::datadogV2::model::ConnectionEnvEnv::UnparsedObject(
+ _env,
+ ) => {
+ _unparsed = true;
+ }
+ _ => {}
+ }
+ }
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let env = env.ok_or_else(|| M::Error::missing_field("env"))?;
+
+ let content = ConnectionEnv {
+ connection_groups,
+ connections,
+ env,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(ConnectionEnvVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_connection_env_env.rs b/src/datadogV2/model/model_connection_env_env.rs
new file mode 100644
index 000000000..3d872a2ed
--- /dev/null
+++ b/src/datadogV2/model/model_connection_env_env.rs
@@ -0,0 +1,48 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+
+use serde::{Deserialize, Deserializer, Serialize, Serializer};
+
+#[non_exhaustive]
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum ConnectionEnvEnv {
+ DEFAULT,
+ UnparsedObject(crate::datadog::UnparsedObject),
+}
+
+impl ToString for ConnectionEnvEnv {
+ fn to_string(&self) -> String {
+ match self {
+ Self::DEFAULT => String::from("default"),
+ Self::UnparsedObject(v) => v.value.to_string(),
+ }
+ }
+}
+
+impl Serialize for ConnectionEnvEnv {
+ fn serialize(&self, serializer: S) -> Result
+ where
+ S: Serializer,
+ {
+ match self {
+ Self::UnparsedObject(v) => v.serialize(serializer),
+ _ => serializer.serialize_str(self.to_string().as_str()),
+ }
+ }
+}
+
+impl<'de> Deserialize<'de> for ConnectionEnvEnv {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ let s: String = String::deserialize(deserializer)?;
+ Ok(match s.as_str() {
+ "default" => Self::DEFAULT,
+ _ => Self::UnparsedObject(crate::datadog::UnparsedObject {
+ value: serde_json::Value::String(s.into()),
+ }),
+ })
+ }
+}
diff --git a/src/datadogV2/model/model_connection_group.rs b/src/datadogV2/model/model_connection_group.rs
new file mode 100644
index 000000000..0b0bf01ad
--- /dev/null
+++ b/src/datadogV2/model/model_connection_group.rs
@@ -0,0 +1,114 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// The definition of `ConnectionGroup` object.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct ConnectionGroup {
+ /// The `ConnectionGroup` `connectionGroupId`.
+ #[serde(rename = "connectionGroupId")]
+ pub connection_group_id: String,
+ /// The `ConnectionGroup` `label`.
+ #[serde(rename = "label")]
+ pub label: String,
+ /// The `ConnectionGroup` `tags`.
+ #[serde(rename = "tags")]
+ pub tags: Vec,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl ConnectionGroup {
+ pub fn new(connection_group_id: String, label: String, tags: Vec) -> ConnectionGroup {
+ ConnectionGroup {
+ connection_group_id,
+ label,
+ tags,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for ConnectionGroup {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct ConnectionGroupVisitor;
+ impl<'a> Visitor<'a> for ConnectionGroupVisitor {
+ type Value = ConnectionGroup;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut connection_group_id: Option = None;
+ let mut label: Option = None;
+ let mut tags: Option> = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "connectionGroupId" => {
+ connection_group_id =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "label" => {
+ label = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "tags" => {
+ tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let connection_group_id = connection_group_id
+ .ok_or_else(|| M::Error::missing_field("connection_group_id"))?;
+ let label = label.ok_or_else(|| M::Error::missing_field("label"))?;
+ let tags = tags.ok_or_else(|| M::Error::missing_field("tags"))?;
+
+ let content = ConnectionGroup {
+ connection_group_id,
+ label,
+ tags,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(ConnectionGroupVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_create_workflow_request.rs b/src/datadogV2/model/model_create_workflow_request.rs
new file mode 100644
index 000000000..6f3d26cbd
--- /dev/null
+++ b/src/datadogV2/model/model_create_workflow_request.rs
@@ -0,0 +1,92 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// A request object for creating a new workflow.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct CreateWorkflowRequest {
+ /// Data related to the workflow.
+ #[serde(rename = "data")]
+ pub data: crate::datadogV2::model::WorkflowData,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl CreateWorkflowRequest {
+ pub fn new(data: crate::datadogV2::model::WorkflowData) -> CreateWorkflowRequest {
+ CreateWorkflowRequest {
+ data,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for CreateWorkflowRequest {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct CreateWorkflowRequestVisitor;
+ impl<'a> Visitor<'a> for CreateWorkflowRequestVisitor {
+ type Value = CreateWorkflowRequest;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut data: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "data" => {
+ data = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let data = data.ok_or_else(|| M::Error::missing_field("data"))?;
+
+ let content = CreateWorkflowRequest {
+ data,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(CreateWorkflowRequestVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_create_workflow_response.rs b/src/datadogV2/model/model_create_workflow_response.rs
new file mode 100644
index 000000000..64437a37f
--- /dev/null
+++ b/src/datadogV2/model/model_create_workflow_response.rs
@@ -0,0 +1,92 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// The response object after creating a new workflow.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct CreateWorkflowResponse {
+ /// Data related to the workflow.
+ #[serde(rename = "data")]
+ pub data: crate::datadogV2::model::WorkflowData,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl CreateWorkflowResponse {
+ pub fn new(data: crate::datadogV2::model::WorkflowData) -> CreateWorkflowResponse {
+ CreateWorkflowResponse {
+ data,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for CreateWorkflowResponse {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct CreateWorkflowResponseVisitor;
+ impl<'a> Visitor<'a> for CreateWorkflowResponseVisitor {
+ type Value = CreateWorkflowResponse;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut data: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "data" => {
+ data = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let data = data.ok_or_else(|| M::Error::missing_field("data"))?;
+
+ let content = CreateWorkflowResponse {
+ data,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(CreateWorkflowResponseVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_dashboard_trigger_wrapper.rs b/src/datadogV2/model/model_dashboard_trigger_wrapper.rs
new file mode 100644
index 000000000..b6473f3e2
--- /dev/null
+++ b/src/datadogV2/model/model_dashboard_trigger_wrapper.rs
@@ -0,0 +1,116 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Schema for a Dashboard-based trigger.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct DashboardTriggerWrapper {
+ /// Trigger a workflow VIA a Dashboard.
+ #[serde(rename = "dashboardTrigger")]
+ pub dashboard_trigger: std::collections::BTreeMap,
+ /// A list of steps that run first after a trigger fires.
+ #[serde(rename = "startStepNames")]
+ pub start_step_names: Option>,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl DashboardTriggerWrapper {
+ pub fn new(
+ dashboard_trigger: std::collections::BTreeMap,
+ ) -> DashboardTriggerWrapper {
+ DashboardTriggerWrapper {
+ dashboard_trigger,
+ start_step_names: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn start_step_names(mut self, value: Vec) -> Self {
+ self.start_step_names = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for DashboardTriggerWrapper {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct DashboardTriggerWrapperVisitor;
+ impl<'a> Visitor<'a> for DashboardTriggerWrapperVisitor {
+ type Value = DashboardTriggerWrapper;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut dashboard_trigger: Option<
+ std::collections::BTreeMap,
+ > = None;
+ let mut start_step_names: Option> = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "dashboardTrigger" => {
+ dashboard_trigger =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "startStepNames" => {
+ if v.is_null() {
+ continue;
+ }
+ start_step_names =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let dashboard_trigger = dashboard_trigger
+ .ok_or_else(|| M::Error::missing_field("dashboard_trigger"))?;
+
+ let content = DashboardTriggerWrapper {
+ dashboard_trigger,
+ start_step_names,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(DashboardTriggerWrapperVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_error_handler.rs b/src/datadogV2/model/model_error_handler.rs
new file mode 100644
index 000000000..50afacf37
--- /dev/null
+++ b/src/datadogV2/model/model_error_handler.rs
@@ -0,0 +1,109 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Used to handle errors in an action.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct ErrorHandler {
+ /// The `ErrorHandler` `fallbackStepName`.
+ #[serde(rename = "fallbackStepName")]
+ pub fallback_step_name: String,
+ /// The definition of `RetryStrategy` object.
+ #[serde(rename = "retryStrategy")]
+ pub retry_strategy: crate::datadogV2::model::RetryStrategy,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl ErrorHandler {
+ pub fn new(
+ fallback_step_name: String,
+ retry_strategy: crate::datadogV2::model::RetryStrategy,
+ ) -> ErrorHandler {
+ ErrorHandler {
+ fallback_step_name,
+ retry_strategy,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for ErrorHandler {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct ErrorHandlerVisitor;
+ impl<'a> Visitor<'a> for ErrorHandlerVisitor {
+ type Value = ErrorHandler;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut fallback_step_name: Option = None;
+ let mut retry_strategy: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "fallbackStepName" => {
+ fallback_step_name =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ "retryStrategy" => {
+ retry_strategy =
+ Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+ let fallback_step_name = fallback_step_name
+ .ok_or_else(|| M::Error::missing_field("fallback_step_name"))?;
+ let retry_strategy =
+ retry_strategy.ok_or_else(|| M::Error::missing_field("retry_strategy"))?;
+
+ let content = ErrorHandler {
+ fallback_step_name,
+ retry_strategy,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(ErrorHandlerVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_get_workflow_response.rs b/src/datadogV2/model/model_get_workflow_response.rs
new file mode 100644
index 000000000..ab2e5efb0
--- /dev/null
+++ b/src/datadogV2/model/model_get_workflow_response.rs
@@ -0,0 +1,105 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// The response object after getting a workflow.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct GetWorkflowResponse {
+ /// Data related to the workflow.
+ #[serde(rename = "data")]
+ pub data: Option,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl GetWorkflowResponse {
+ pub fn new() -> GetWorkflowResponse {
+ GetWorkflowResponse {
+ data: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn data(mut self, value: crate::datadogV2::model::WorkflowData) -> Self {
+ self.data = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl Default for GetWorkflowResponse {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl<'de> Deserialize<'de> for GetWorkflowResponse {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct GetWorkflowResponseVisitor;
+ impl<'a> Visitor<'a> for GetWorkflowResponseVisitor {
+ type Value = GetWorkflowResponse;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut data: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "data" => {
+ if v.is_null() {
+ continue;
+ }
+ data = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+
+ let content = GetWorkflowResponse {
+ data,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(GetWorkflowResponseVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_github_webhook_trigger.rs b/src/datadogV2/model/model_github_webhook_trigger.rs
new file mode 100644
index 000000000..939b14408
--- /dev/null
+++ b/src/datadogV2/model/model_github_webhook_trigger.rs
@@ -0,0 +1,105 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Trigger a workflow VIA GitHub webhook. To trigger a workflow from GitHub, you must set a `webhookSecret`. In your GitHub Webhook Settings, set the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for the content type, and be highly recommend enabling SSL verification for security. The workflow must be published.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct GithubWebhookTrigger {
+ /// Defines a rate limit for a trigger.
+ #[serde(rename = "rateLimit")]
+ pub rate_limit: Option,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl GithubWebhookTrigger {
+ pub fn new() -> GithubWebhookTrigger {
+ GithubWebhookTrigger {
+ rate_limit: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn rate_limit(mut self, value: crate::datadogV2::model::TriggerRateLimit) -> Self {
+ self.rate_limit = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl Default for GithubWebhookTrigger {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl<'de> Deserialize<'de> for GithubWebhookTrigger {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct GithubWebhookTriggerVisitor;
+ impl<'a> Visitor<'a> for GithubWebhookTriggerVisitor {
+ type Value = GithubWebhookTrigger;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut rate_limit: Option = None;
+ let mut additional_properties: std::collections::BTreeMap<
+ String,
+ serde_json::Value,
+ > = std::collections::BTreeMap::new();
+ let mut _unparsed = false;
+
+ while let Some((k, v)) = map.next_entry::()? {
+ match k.as_str() {
+ "rateLimit" => {
+ if v.is_null() {
+ continue;
+ }
+ rate_limit = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
+ }
+ &_ => {
+ if let Ok(value) = serde_json::from_value(v.clone()) {
+ additional_properties.insert(k, value);
+ }
+ }
+ }
+ }
+
+ let content = GithubWebhookTrigger {
+ rate_limit,
+ additional_properties,
+ _unparsed,
+ };
+
+ Ok(content)
+ }
+ }
+
+ deserializer.deserialize_any(GithubWebhookTriggerVisitor)
+ }
+}
diff --git a/src/datadogV2/model/model_github_webhook_trigger_wrapper.rs b/src/datadogV2/model/model_github_webhook_trigger_wrapper.rs
new file mode 100644
index 000000000..d72446ee5
--- /dev/null
+++ b/src/datadogV2/model/model_github_webhook_trigger_wrapper.rs
@@ -0,0 +1,116 @@
+// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+// This product includes software developed at Datadog (https://www.datadoghq.com/).
+// Copyright 2019-Present Datadog, Inc.
+use serde::de::{Error, MapAccess, Visitor};
+use serde::{Deserialize, Deserializer, Serialize};
+use serde_with::skip_serializing_none;
+use std::fmt::{self, Formatter};
+
+/// Schema for a GitHub webhook-based trigger.
+#[non_exhaustive]
+#[skip_serializing_none]
+#[derive(Clone, Debug, PartialEq, Serialize)]
+pub struct GithubWebhookTriggerWrapper {
+ /// Trigger a workflow VIA GitHub webhook. To trigger a workflow from GitHub, you must set a `webhookSecret`. In your GitHub Webhook Settings, set the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for the content type, and be highly recommend enabling SSL verification for security. The workflow must be published.
+ #[serde(rename = "githubWebhookTrigger")]
+ pub github_webhook_trigger: crate::datadogV2::model::GithubWebhookTrigger,
+ /// A list of steps that run first after a trigger fires.
+ #[serde(rename = "startStepNames")]
+ pub start_step_names: Option>,
+ #[serde(flatten)]
+ pub additional_properties: std::collections::BTreeMap,
+ #[serde(skip)]
+ #[serde(default)]
+ pub(crate) _unparsed: bool,
+}
+
+impl GithubWebhookTriggerWrapper {
+ pub fn new(
+ github_webhook_trigger: crate::datadogV2::model::GithubWebhookTrigger,
+ ) -> GithubWebhookTriggerWrapper {
+ GithubWebhookTriggerWrapper {
+ github_webhook_trigger,
+ start_step_names: None,
+ additional_properties: std::collections::BTreeMap::new(),
+ _unparsed: false,
+ }
+ }
+
+ pub fn start_step_names(mut self, value: Vec) -> Self {
+ self.start_step_names = Some(value);
+ self
+ }
+
+ pub fn additional_properties(
+ mut self,
+ value: std::collections::BTreeMap,
+ ) -> Self {
+ self.additional_properties = value;
+ self
+ }
+}
+
+impl<'de> Deserialize<'de> for GithubWebhookTriggerWrapper {
+ fn deserialize(deserializer: D) -> Result
+ where
+ D: Deserializer<'de>,
+ {
+ struct GithubWebhookTriggerWrapperVisitor;
+ impl<'a> Visitor<'a> for GithubWebhookTriggerWrapperVisitor {
+ type Value = GithubWebhookTriggerWrapper;
+
+ fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
+ f.write_str("a mapping")
+ }
+
+ fn visit_map(self, mut map: M) -> Result
+ where
+ M: MapAccess<'a>,
+ {
+ let mut github_webhook_trigger: Option<
+ crate::datadogV2::model::GithubWebhookTrigger,
+ > = None;
+ let mut start_step_names: Option