Skip to content

Commit 24cdaee

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c7fd93c of spec repo
1 parent 4fe3c6b commit 24cdaee

21 files changed

Lines changed: 738 additions & 29 deletions

‎.generator/schemas/v2/openapi.yaml‎

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26762,6 +26762,9 @@ components:
2676226762
description: "A sample workflow."
2676326763
name: "Example Workflow"
2676426764
published: true
26765+
runAs:
26766+
id: 00000000-0000-0000-0000-000000000007
26767+
type: service_account
2676526768
spec:
2676626769
annotations:
2676726770
- display:
@@ -120857,6 +120860,9 @@ components:
120857120860
description: "A sample workflow."
120858120861
name: "Example Workflow"
120859120862
published: true
120863+
runAs:
120864+
id: 00000000-0000-0000-0000-000000000007
120865+
type: service_account
120860120866
spec:
120861120867
annotations:
120862120868
- display:
@@ -123940,6 +123946,12 @@ components:
123940123946
published:
123941123947
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.
123942123948
type: boolean
123949+
runAs:
123950+
$ref: "#/components/schemas/WorkflowRunAs"
123951+
writeOnly: true
123952+
runAsUserMode:
123953+
$ref: "#/components/schemas/WorkflowRunAsUserMode"
123954+
readOnly: true
123943123955
spec:
123944123956
$ref: "#/components/schemas/Spec"
123945123957
tags:
@@ -123968,6 +123980,9 @@ components:
123968123980
$ref: "#/components/schemas/WorkflowUserRelationship"
123969123981
owner:
123970123982
$ref: "#/components/schemas/WorkflowUserRelationship"
123983+
runAs:
123984+
$ref: "#/components/schemas/WorkflowUserRelationship"
123985+
description: The service account used to run the workflow. Present when `runAsUserMode` is `service_account`.
123971123986
readOnly: true
123972123987
type: object
123973123988
WorkflowDataType:
@@ -124011,6 +124026,12 @@ components:
124011124026
published:
124012124027
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.
124013124028
type: boolean
124029+
runAs:
124030+
$ref: "#/components/schemas/WorkflowRunAs"
124031+
writeOnly: true
124032+
runAsUserMode:
124033+
$ref: "#/components/schemas/WorkflowRunAsUserMode"
124034+
readOnly: true
124014124035
spec:
124015124036
$ref: "#/components/schemas/Spec"
124016124037
tags:
@@ -124129,6 +124150,9 @@ components:
124129124150
published:
124130124151
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.
124131124152
type: boolean
124153+
runAsUserMode:
124154+
$ref: "#/components/schemas/WorkflowRunAsUserMode"
124155+
readOnly: true
124132124156
spec:
124133124157
$ref: "#/components/schemas/Spec"
124134124158
nullable: true
@@ -124146,6 +124170,84 @@ components:
124146124170
required:
124147124171
- name
124148124172
type: object
124173+
WorkflowRunAs:
124174+
description: Identity used to run the workflow.
124175+
example:
124176+
id: 00000000-0000-0000-0000-000000000007
124177+
type: service_account
124178+
oneOf:
124179+
- $ref: "#/components/schemas/WorkflowRunAsOwner"
124180+
- $ref: "#/components/schemas/WorkflowRunAsServiceAccount"
124181+
- $ref: "#/components/schemas/WorkflowRunAsInitiator"
124182+
WorkflowRunAsInitiator:
124183+
additionalProperties: false
124184+
description: Run the workflow as the user who initiates the execution.
124185+
properties:
124186+
type:
124187+
$ref: "#/components/schemas/WorkflowRunAsInitiatorType"
124188+
required:
124189+
- type
124190+
type: object
124191+
WorkflowRunAsInitiatorType:
124192+
description: The initiator run-as type.
124193+
enum:
124194+
- initiator
124195+
example: initiator
124196+
type: string
124197+
x-enum-varnames:
124198+
- INITIATOR
124199+
WorkflowRunAsOwner:
124200+
additionalProperties: false
124201+
description: Run the workflow as its owner.
124202+
properties:
124203+
type:
124204+
$ref: "#/components/schemas/WorkflowRunAsOwnerType"
124205+
required:
124206+
- type
124207+
type: object
124208+
WorkflowRunAsOwnerType:
124209+
description: The owner run-as type.
124210+
enum:
124211+
- owner
124212+
example: owner
124213+
type: string
124214+
x-enum-varnames:
124215+
- OWNER
124216+
WorkflowRunAsServiceAccount:
124217+
additionalProperties: false
124218+
description: Run the workflow as a service account.
124219+
properties:
124220+
id:
124221+
description: The service account identifier.
124222+
example: 00000000-0000-0000-0000-000000000007
124223+
format: uuid
124224+
type: string
124225+
type:
124226+
$ref: "#/components/schemas/WorkflowRunAsServiceAccountType"
124227+
required:
124228+
- type
124229+
- id
124230+
type: object
124231+
WorkflowRunAsServiceAccountType:
124232+
description: The service account run-as type.
124233+
enum:
124234+
- service_account
124235+
example: service_account
124236+
type: string
124237+
x-enum-varnames:
124238+
- SERVICE_ACCOUNT
124239+
WorkflowRunAsUserMode:
124240+
description: The effective type of identity used to run the workflow.
124241+
enum:
124242+
- owner
124243+
- service_account
124244+
- initiator
124245+
example: service_account
124246+
type: string
124247+
x-enum-varnames:
124248+
- OWNER
124249+
- SERVICE_ACCOUNT
124250+
- INITIATOR
124149124251
WorkflowTriggerWrapper:
124150124252
description: "Schema for a Workflow-based trigger."
124151124253
properties:
@@ -220121,6 +220223,7 @@ paths:
220121220223
description: A sample workflow.
220122220224
name: Example Workflow
220123220225
published: true
220226+
runAsUserMode: service_account
220124220227
spec: {}
220125220228
tags:
220126220229
- team:infra
@@ -220135,6 +220238,10 @@ paths:
220135220238
data:
220136220239
id: 00000000-0000-0000-0000-000000000009
220137220240
type: users
220241+
runAs:
220242+
data:
220243+
id: 00000000-0000-0000-0000-000000000007
220244+
type: users
220138220245
type: workflows
220139220246
meta:
220140220247
page:
@@ -220175,6 +220282,9 @@ paths:
220175220282
description: A sample workflow.
220176220283
name: Example Workflow
220177220284
published: true
220285+
runAs:
220286+
id: 00000000-0000-0000-0000-000000000007
220287+
type: service_account
220178220288
spec:
220179220289
annotations:
220180220290
- display:
@@ -220241,8 +220351,14 @@ paths:
220241220351
data:
220242220352
attributes:
220243220353
name: Example Workflow
220354+
runAsUserMode: service_account
220244220355
spec: {}
220245220356
id: 00000000-0000-0000-0000-000000000001
220357+
relationships:
220358+
runAs:
220359+
data:
220360+
id: 00000000-0000-0000-0000-000000000007
220361+
type: users
220246220362
type: workflows
220247220363
schema:
220248220364
$ref: "#/components/schemas/CreateWorkflowResponse"
@@ -220324,11 +220440,17 @@ paths:
220324220440
description: A sample workflow.
220325220441
name: Example Workflow
220326220442
published: true
220443+
runAsUserMode: service_account
220327220444
spec: {}
220328220445
tags:
220329220446
- team:infra
220330220447
updatedAt: "2024-01-01T00:00:00+00:00"
220331220448
id: 00000000-0000-0000-0000-000000000002
220449+
relationships:
220450+
runAs:
220451+
data:
220452+
id: 00000000-0000-0000-0000-000000000007
220453+
type: users
220332220454
type: workflows
220333220455
schema:
220334220456
$ref: "#/components/schemas/GetWorkflowResponse"
@@ -220380,6 +220502,9 @@ paths:
220380220502
description: A sample workflow.
220381220503
name: Example Workflow
220382220504
published: true
220505+
runAs:
220506+
id: 00000000-0000-0000-0000-000000000007
220507+
type: service_account
220383220508
spec:
220384220509
annotations:
220385220510
- display:
@@ -220447,7 +220572,13 @@ paths:
220447220572
data:
220448220573
attributes:
220449220574
name: Example Workflow
220575+
runAsUserMode: service_account
220450220576
id: 00000000-0000-0000-0000-000000000003
220577+
relationships:
220578+
runAs:
220579+
data:
220580+
id: 00000000-0000-0000-0000-000000000007
220581+
type: users
220451220582
type: workflows
220452220583
schema:
220453220584
$ref: "#/components/schemas/UpdateWorkflowResponse"

‎examples/v2/workflow-automation/CreateWorkflow.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Create a Workflow returns "Successfully created a workflow." response
33
"""
44

5+
from os import environ
56
from datadog_api_client import ApiClient, Configuration
67
from datadog_api_client.v2.api.workflow_automation_api import WorkflowAutomationApi
78
from datadog_api_client.v2.model.connection import Connection
@@ -26,13 +27,22 @@
2627
from datadog_api_client.v2.model.workflow_data import WorkflowData
2728
from datadog_api_client.v2.model.workflow_data_attributes import WorkflowDataAttributes
2829
from datadog_api_client.v2.model.workflow_data_type import WorkflowDataType
30+
from datadog_api_client.v2.model.workflow_run_as_service_account import WorkflowRunAsServiceAccount
31+
from datadog_api_client.v2.model.workflow_run_as_service_account_type import WorkflowRunAsServiceAccountType
32+
33+
# there is a valid "service_account_user" in the system
34+
SERVICE_ACCOUNT_USER_DATA_ID = environ["SERVICE_ACCOUNT_USER_DATA_ID"]
2935

3036
body = CreateWorkflowRequest(
3137
data=WorkflowData(
3238
attributes=WorkflowDataAttributes(
3339
description="A sample workflow.",
3440
name="Example Workflow",
3541
published=True,
42+
run_as=WorkflowRunAsServiceAccount(
43+
type=WorkflowRunAsServiceAccountType.SERVICE_ACCOUNT,
44+
id=SERVICE_ACCOUNT_USER_DATA_ID,
45+
),
3646
spec=Spec(
3747
connection_envs=[
3848
ConnectionEnv(

‎examples/v2/workflow-automation/UpdateWorkflow.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,25 @@
2727
from datadog_api_client.v2.model.workflow_data_type import WorkflowDataType
2828
from datadog_api_client.v2.model.workflow_data_update import WorkflowDataUpdate
2929
from datadog_api_client.v2.model.workflow_data_update_attributes import WorkflowDataUpdateAttributes
30+
from datadog_api_client.v2.model.workflow_run_as_service_account import WorkflowRunAsServiceAccount
31+
from datadog_api_client.v2.model.workflow_run_as_service_account_type import WorkflowRunAsServiceAccountType
3032

3133
# there is a valid "workflow" in the system
3234
WORKFLOW_DATA_ID = environ["WORKFLOW_DATA_ID"]
3335

36+
# there is a valid "service_account_user" in the system
37+
SERVICE_ACCOUNT_USER_DATA_ID = environ["SERVICE_ACCOUNT_USER_DATA_ID"]
38+
3439
body = UpdateWorkflowRequest(
3540
data=WorkflowDataUpdate(
3641
attributes=WorkflowDataUpdateAttributes(
3742
description="A sample workflow.",
3843
name="Example Workflow",
3944
published=True,
45+
run_as=WorkflowRunAsServiceAccount(
46+
type=WorkflowRunAsServiceAccountType.SERVICE_ACCOUNT,
47+
id=SERVICE_ACCOUNT_USER_DATA_ID,
48+
),
4049
spec=Spec(
4150
connection_envs=[
4251
ConnectionEnv(

‎src/datadog_api_client/v2/model/workflow_data_attributes.py‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,28 @@
1515

1616

1717
if TYPE_CHECKING:
18+
from datadog_api_client.v2.model.workflow_run_as import WorkflowRunAs
19+
from datadog_api_client.v2.model.workflow_run_as_user_mode import WorkflowRunAsUserMode
1820
from datadog_api_client.v2.model.spec import Spec
21+
from datadog_api_client.v2.model.workflow_run_as_owner import WorkflowRunAsOwner
22+
from datadog_api_client.v2.model.workflow_run_as_service_account import WorkflowRunAsServiceAccount
23+
from datadog_api_client.v2.model.workflow_run_as_initiator import WorkflowRunAsInitiator
1924

2025

2126
class WorkflowDataAttributes(ModelNormal):
2227
@cached_property
2328
def openapi_types(_):
29+
from datadog_api_client.v2.model.workflow_run_as import WorkflowRunAs
30+
from datadog_api_client.v2.model.workflow_run_as_user_mode import WorkflowRunAsUserMode
2431
from datadog_api_client.v2.model.spec import Spec
2532

2633
return {
2734
"created_at": (datetime,),
2835
"description": (str,),
2936
"name": (str,),
3037
"published": (bool,),
38+
"run_as": (WorkflowRunAs,),
39+
"run_as_user_mode": (WorkflowRunAsUserMode,),
3140
"spec": (Spec,),
3241
"tags": ([str],),
3342
"updated_at": (datetime,),
@@ -39,6 +48,8 @@ def openapi_types(_):
3948
"description": "description",
4049
"name": "name",
4150
"published": "published",
51+
"run_as": "runAs",
52+
"run_as_user_mode": "runAsUserMode",
4253
"spec": "spec",
4354
"tags": "tags",
4455
"updated_at": "updatedAt",
@@ -56,6 +67,10 @@ def __init__(
5667
created_at: Union[datetime, UnsetType] = unset,
5768
description: Union[str, UnsetType] = unset,
5869
published: Union[bool, UnsetType] = unset,
70+
run_as: Union[
71+
WorkflowRunAs, WorkflowRunAsOwner, WorkflowRunAsServiceAccount, WorkflowRunAsInitiator, UnsetType
72+
] = unset,
73+
run_as_user_mode: Union[WorkflowRunAsUserMode, UnsetType] = unset,
5974
tags: Union[List[str], UnsetType] = unset,
6075
updated_at: Union[datetime, UnsetType] = unset,
6176
webhook_secret: Union[str, UnsetType] = unset,
@@ -76,6 +91,12 @@ def __init__(
7691
:param published: 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.
7792
:type published: bool, optional
7893
94+
:param run_as: Identity used to run the workflow.
95+
:type run_as: WorkflowRunAs, optional
96+
97+
:param run_as_user_mode: The effective type of identity used to run the workflow.
98+
:type run_as_user_mode: WorkflowRunAsUserMode, optional
99+
79100
:param spec: A complete Workflow Automation definition, including its triggers, steps, and connections.
80101
:type spec: Spec
81102
@@ -94,6 +115,10 @@ def __init__(
94115
kwargs["description"] = description
95116
if published is not unset:
96117
kwargs["published"] = published
118+
if run_as is not unset:
119+
kwargs["run_as"] = run_as
120+
if run_as_user_mode is not unset:
121+
kwargs["run_as_user_mode"] = run_as_user_mode
97122
if tags is not unset:
98123
kwargs["tags"] = tags
99124
if updated_at is not unset:

0 commit comments

Comments
 (0)