Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26764,6 +26764,8 @@ components:
description: "A sample workflow."
name: "Example Workflow"
published: true
runAs:
type: owner
spec:
annotations:
- display:
Expand Down Expand Up @@ -121077,6 +121079,8 @@ components:
description: "A sample workflow."
name: "Example Workflow"
published: true
runAs:
type: owner
spec:
annotations:
- display:
Expand Down Expand Up @@ -124160,6 +124164,12 @@ components:
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
runAs:
$ref: "#/components/schemas/WorkflowRunAs"
writeOnly: true
runAsUserMode:
$ref: "#/components/schemas/WorkflowRunAsUserMode"
readOnly: true
spec:
$ref: "#/components/schemas/Spec"
tags:
Expand Down Expand Up @@ -124188,6 +124198,9 @@ components:
$ref: "#/components/schemas/WorkflowUserRelationship"
owner:
$ref: "#/components/schemas/WorkflowUserRelationship"
runAs:
$ref: "#/components/schemas/WorkflowUserRelationship"
description: The service account used to run the workflow. Present when `runAsUserMode` is `service_account`.
readOnly: true
type: object
WorkflowDataType:
Expand Down Expand Up @@ -124231,6 +124244,12 @@ components:
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
runAs:
$ref: "#/components/schemas/WorkflowRunAs"
writeOnly: true
runAsUserMode:
$ref: "#/components/schemas/WorkflowRunAsUserMode"
readOnly: true
spec:
$ref: "#/components/schemas/Spec"
tags:
Expand Down Expand Up @@ -124349,6 +124368,9 @@ components:
published:
description: Whether the workflow is published. Unpublished workflows can only be run manually. Automatic triggers such as Schedule do not fire until the workflow is published.
type: boolean
runAsUserMode:
$ref: "#/components/schemas/WorkflowRunAsUserMode"
readOnly: true
spec:
$ref: "#/components/schemas/Spec"
nullable: true
Expand All @@ -124366,6 +124388,82 @@ components:
required:
- name
type: object
WorkflowRunAs:
description: Identity used to run the workflow.
example:
type: owner
oneOf:
- $ref: "#/components/schemas/WorkflowRunAsOwner"
- $ref: "#/components/schemas/WorkflowRunAsServiceAccount"
- $ref: "#/components/schemas/WorkflowRunAsInitiator"
WorkflowRunAsInitiator:
additionalProperties: false
description: Run the workflow as the user who initiates the execution.
properties:
type:
$ref: "#/components/schemas/WorkflowRunAsInitiatorType"
required:
- type
type: object
WorkflowRunAsInitiatorType:
description: The initiator run-as type.
enum:
- initiator
example: initiator
type: string
x-enum-varnames:
- INITIATOR
WorkflowRunAsOwner:
additionalProperties: false
description: Run the workflow as its owner.
properties:
type:
$ref: "#/components/schemas/WorkflowRunAsOwnerType"
required:
- type
type: object
WorkflowRunAsOwnerType:
description: The owner run-as type.
enum:
- owner
example: owner
type: string
x-enum-varnames:
- OWNER
WorkflowRunAsServiceAccount:
additionalProperties: false
description: Run the workflow as a service account.
properties:
id:
description: The service account identifier.
example: 00000000-0000-0000-0000-000000000007
type: string
type:
$ref: "#/components/schemas/WorkflowRunAsServiceAccountType"
required:
- type
- id
type: object
WorkflowRunAsServiceAccountType:
description: The service account run-as type.
enum:
- service_account
example: service_account
type: string
x-enum-varnames:
- SERVICE_ACCOUNT
WorkflowRunAsUserMode:
description: The effective type of identity used to run the workflow.
enum:
- owner
- service_account
- initiator
example: owner
type: string
x-enum-varnames:
- OWNER
- SERVICE_ACCOUNT
- INITIATOR
WorkflowTriggerWrapper:
description: "Schema for a Workflow-based trigger."
properties:
Expand Down Expand Up @@ -220413,6 +220511,7 @@ paths:
description: A sample workflow.
name: Example Workflow
published: true
runAsUserMode: owner
spec: {}
tags:
- team:infra
Expand Down Expand Up @@ -220467,6 +220566,8 @@ paths:
description: A sample workflow.
name: Example Workflow
published: true
runAs:
type: owner
spec:
annotations:
- display:
Expand Down Expand Up @@ -220533,6 +220634,7 @@ paths:
data:
attributes:
name: Example Workflow
runAsUserMode: owner
spec: {}
id: 00000000-0000-0000-0000-000000000001
type: workflows
Expand Down Expand Up @@ -220616,6 +220718,7 @@ paths:
description: A sample workflow.
name: Example Workflow
published: true
runAsUserMode: owner
spec: {}
tags:
- team:infra
Expand Down Expand Up @@ -220672,6 +220775,8 @@ paths:
description: A sample workflow.
name: Example Workflow
published: true
runAs:
type: owner
spec:
annotations:
- display:
Expand Down Expand Up @@ -220739,6 +220844,7 @@ paths:
data:
attributes:
name: Example Workflow
runAsUserMode: owner
id: 00000000-0000-0000-0000-000000000003
type: workflows
schema:
Expand Down
6 changes: 6 additions & 0 deletions examples/v2_workflow-automation_CreateWorkflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ 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 datadog_api_client::datadogV2::model::WorkflowRunAs;
use datadog_api_client::datadogV2::model::WorkflowRunAsOwner;
use datadog_api_client::datadogV2::model::WorkflowRunAsOwnerType;
use serde_json::Value;

#[tokio::main]
Expand Down Expand Up @@ -84,6 +87,9 @@ async fn main() {
)
.description("A sample workflow.".to_string())
.published(true)
.run_as(WorkflowRunAs::WorkflowRunAsOwner(Box::new(
WorkflowRunAsOwner::new(WorkflowRunAsOwnerType::OWNER),
)))
.tags(vec![
"team:infra".to_string(),
"service:monitoring".to_string(),
Expand Down
6 changes: 6 additions & 0 deletions examples/v2_workflow-automation_UpdateWorkflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ 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 datadog_api_client::datadogV2::model::WorkflowRunAs;
use datadog_api_client::datadogV2::model::WorkflowRunAsOwner;
use datadog_api_client::datadogV2::model::WorkflowRunAsOwnerType;
use serde_json::Value;

#[tokio::main]
Expand All @@ -36,6 +39,9 @@ async fn main() {
.description("A sample workflow.".to_string())
.name("Example Workflow".to_string())
.published(true)
.run_as(WorkflowRunAs::WorkflowRunAsOwner(Box::new(
WorkflowRunAsOwner::new(WorkflowRunAsOwnerType::OWNER),
)))
.spec(
Spec::new()
.connection_envs(vec![ConnectionEnv::new(ConnectionEnvEnv::DEFAULT)
Expand Down
16 changes: 16 additions & 0 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15120,6 +15120,8 @@ pub mod model_workflow_list_item;
pub use self::model_workflow_list_item::WorkflowListItem;
pub mod model_workflow_list_item_attributes;
pub use self::model_workflow_list_item_attributes::WorkflowListItemAttributes;
pub mod model_workflow_run_as_user_mode;
pub use self::model_workflow_run_as_user_mode::WorkflowRunAsUserMode;
pub mod model_spec;
pub use self::model_spec::Spec;
pub mod model_annotation;
Expand Down Expand Up @@ -15266,6 +15268,20 @@ 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_workflow_run_as_owner;
pub use self::model_workflow_run_as_owner::WorkflowRunAsOwner;
pub mod model_workflow_run_as_owner_type;
pub use self::model_workflow_run_as_owner_type::WorkflowRunAsOwnerType;
pub mod model_workflow_run_as_service_account;
pub use self::model_workflow_run_as_service_account::WorkflowRunAsServiceAccount;
pub mod model_workflow_run_as_service_account_type;
pub use self::model_workflow_run_as_service_account_type::WorkflowRunAsServiceAccountType;
pub mod model_workflow_run_as_initiator;
pub use self::model_workflow_run_as_initiator::WorkflowRunAsInitiator;
pub mod model_workflow_run_as_initiator_type;
pub use self::model_workflow_run_as_initiator_type::WorkflowRunAsInitiatorType;
pub mod model_workflow_run_as;
pub use self::model_workflow_run_as::WorkflowRunAs;
pub mod model_create_workflow_response;
pub use self::model_create_workflow_response::CreateWorkflowResponse;
pub mod model_get_workflow_response;
Expand Down
57 changes: 57 additions & 0 deletions src/datadogV2/model/model_workflow_data_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ pub struct WorkflowDataAttributes {
/// 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.
#[serde(rename = "published")]
pub published: Option<bool>,
/// Identity used to run the workflow.
#[serde(rename = "runAs")]
pub run_as: Option<crate::datadogV2::model::WorkflowRunAs>,
/// The effective type of identity used to run the workflow.
#[serde(rename = "runAsUserMode")]
pub run_as_user_mode: Option<crate::datadogV2::model::WorkflowRunAsUserMode>,
/// A complete Workflow Automation definition, including its triggers, steps, and connections.
#[serde(rename = "spec")]
pub spec: crate::datadogV2::model::Spec,
Expand All @@ -49,6 +55,8 @@ impl WorkflowDataAttributes {
description: None,
name,
published: None,
run_as: None,
run_as_user_mode: None,
spec,
tags: None,
updated_at: None,
Expand All @@ -73,6 +81,19 @@ impl WorkflowDataAttributes {
self
}

pub fn run_as(mut self, value: crate::datadogV2::model::WorkflowRunAs) -> Self {
self.run_as = Some(value);
self
}

pub fn run_as_user_mode(
mut self,
value: crate::datadogV2::model::WorkflowRunAsUserMode,
) -> Self {
self.run_as_user_mode = Some(value);
self
}

pub fn tags(mut self, value: Vec<String>) -> Self {
self.tags = Some(value);
self
Expand Down Expand Up @@ -118,6 +139,9 @@ impl<'de> Deserialize<'de> for WorkflowDataAttributes {
let mut description: Option<String> = None;
let mut name: Option<String> = None;
let mut published: Option<bool> = None;
let mut run_as: Option<crate::datadogV2::model::WorkflowRunAs> = None;
let mut run_as_user_mode: Option<crate::datadogV2::model::WorkflowRunAsUserMode> =
None;
let mut spec: Option<crate::datadogV2::model::Spec> = None;
let mut tags: Option<Vec<String>> = None;
let mut updated_at: Option<chrono::DateTime<chrono::Utc>> = None;
Expand Down Expand Up @@ -152,6 +176,37 @@ impl<'de> Deserialize<'de> for WorkflowDataAttributes {
}
published = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"runAs" => {
if v.is_null() {
continue;
}
run_as = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
if let Some(ref _run_as) = run_as {
match _run_as {
crate::datadogV2::model::WorkflowRunAs::UnparsedObject(
_run_as,
) => {
_unparsed = true;
}
_ => {}
}
}
}
"runAsUserMode" => {
if v.is_null() {
continue;
}
run_as_user_mode =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
if let Some(ref _run_as_user_mode) = run_as_user_mode {
match _run_as_user_mode {
crate::datadogV2::model::WorkflowRunAsUserMode::UnparsedObject(_run_as_user_mode) => {
_unparsed = true;
},
_ => {}
}
}
}
"spec" => {
spec = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
Expand Down Expand Up @@ -189,6 +244,8 @@ impl<'de> Deserialize<'de> for WorkflowDataAttributes {
description,
name,
published,
run_as,
run_as_user_mode,
spec,
tags,
updated_at,
Expand Down
Loading
Loading