Skip to content

Commit 1ca8118

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5fcfa50 of spec repo
1 parent c86924e commit 1ca8118

21 files changed

Lines changed: 736 additions & 29 deletions

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

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26764,6 +26764,9 @@ components:
2676426764
description: "A sample workflow."
2676526765
name: "Example Workflow"
2676626766
published: true
26767+
runAs:
26768+
id: 00000000-0000-0000-0000-000000000007
26769+
type: service_account
2676726770
spec:
2676826771
annotations:
2676926772
- display:
@@ -121033,6 +121036,9 @@ components:
121033121036
description: "A sample workflow."
121034121037
name: "Example Workflow"
121035121038
published: true
121039+
runAs:
121040+
id: 00000000-0000-0000-0000-000000000007
121041+
type: service_account
121036121042
spec:
121037121043
annotations:
121038121044
- display:
@@ -124116,6 +124122,12 @@ components:
124116124122
published:
124117124123
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.
124118124124
type: boolean
124125+
runAs:
124126+
$ref: "#/components/schemas/WorkflowRunAs"
124127+
writeOnly: true
124128+
runAsUserMode:
124129+
$ref: "#/components/schemas/WorkflowRunAsUserMode"
124130+
readOnly: true
124119124131
spec:
124120124132
$ref: "#/components/schemas/Spec"
124121124133
tags:
@@ -124144,6 +124156,9 @@ components:
124144124156
$ref: "#/components/schemas/WorkflowUserRelationship"
124145124157
owner:
124146124158
$ref: "#/components/schemas/WorkflowUserRelationship"
124159+
runAs:
124160+
$ref: "#/components/schemas/WorkflowUserRelationship"
124161+
description: The service account used to run the workflow. Present when `runAsUserMode` is `service_account`.
124147124162
readOnly: true
124148124163
type: object
124149124164
WorkflowDataType:
@@ -124187,6 +124202,12 @@ components:
124187124202
published:
124188124203
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.
124189124204
type: boolean
124205+
runAs:
124206+
$ref: "#/components/schemas/WorkflowRunAs"
124207+
writeOnly: true
124208+
runAsUserMode:
124209+
$ref: "#/components/schemas/WorkflowRunAsUserMode"
124210+
readOnly: true
124190124211
spec:
124191124212
$ref: "#/components/schemas/Spec"
124192124213
tags:
@@ -124305,6 +124326,9 @@ components:
124305124326
published:
124306124327
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.
124307124328
type: boolean
124329+
runAsUserMode:
124330+
$ref: "#/components/schemas/WorkflowRunAsUserMode"
124331+
readOnly: true
124308124332
spec:
124309124333
$ref: "#/components/schemas/Spec"
124310124334
nullable: true
@@ -124322,6 +124346,83 @@ components:
124322124346
required:
124323124347
- name
124324124348
type: object
124349+
WorkflowRunAs:
124350+
description: Identity used to run the workflow.
124351+
example:
124352+
id: 00000000-0000-0000-0000-000000000007
124353+
type: service_account
124354+
oneOf:
124355+
- $ref: "#/components/schemas/WorkflowRunAsOwner"
124356+
- $ref: "#/components/schemas/WorkflowRunAsServiceAccount"
124357+
- $ref: "#/components/schemas/WorkflowRunAsInitiator"
124358+
WorkflowRunAsInitiator:
124359+
additionalProperties: false
124360+
description: Run the workflow as the user who initiates the execution.
124361+
properties:
124362+
type:
124363+
$ref: "#/components/schemas/WorkflowRunAsInitiatorType"
124364+
required:
124365+
- type
124366+
type: object
124367+
WorkflowRunAsInitiatorType:
124368+
description: The initiator run-as type.
124369+
enum:
124370+
- initiator
124371+
example: initiator
124372+
type: string
124373+
x-enum-varnames:
124374+
- INITIATOR
124375+
WorkflowRunAsOwner:
124376+
additionalProperties: false
124377+
description: Run the workflow as its owner.
124378+
properties:
124379+
type:
124380+
$ref: "#/components/schemas/WorkflowRunAsOwnerType"
124381+
required:
124382+
- type
124383+
type: object
124384+
WorkflowRunAsOwnerType:
124385+
description: The owner run-as type.
124386+
enum:
124387+
- owner
124388+
example: owner
124389+
type: string
124390+
x-enum-varnames:
124391+
- OWNER
124392+
WorkflowRunAsServiceAccount:
124393+
additionalProperties: false
124394+
description: Run the workflow as a service account.
124395+
properties:
124396+
id:
124397+
description: The service account identifier.
124398+
example: 00000000-0000-0000-0000-000000000007
124399+
type: string
124400+
type:
124401+
$ref: "#/components/schemas/WorkflowRunAsServiceAccountType"
124402+
required:
124403+
- type
124404+
- id
124405+
type: object
124406+
WorkflowRunAsServiceAccountType:
124407+
description: The service account run-as type.
124408+
enum:
124409+
- service_account
124410+
example: service_account
124411+
type: string
124412+
x-enum-varnames:
124413+
- SERVICE_ACCOUNT
124414+
WorkflowRunAsUserMode:
124415+
description: The effective type of identity used to run the workflow.
124416+
enum:
124417+
- owner
124418+
- service_account
124419+
- initiator
124420+
example: service_account
124421+
type: string
124422+
x-enum-varnames:
124423+
- OWNER
124424+
- SERVICE_ACCOUNT
124425+
- INITIATOR
124325124426
WorkflowTriggerWrapper:
124326124427
description: "Schema for a Workflow-based trigger."
124327124428
properties:
@@ -220369,6 +220470,7 @@ paths:
220369220470
description: A sample workflow.
220370220471
name: Example Workflow
220371220472
published: true
220473+
runAsUserMode: service_account
220372220474
spec: {}
220373220475
tags:
220374220476
- team:infra
@@ -220383,6 +220485,10 @@ paths:
220383220485
data:
220384220486
id: 00000000-0000-0000-0000-000000000009
220385220487
type: users
220488+
runAs:
220489+
data:
220490+
id: 00000000-0000-0000-0000-000000000007
220491+
type: users
220386220492
type: workflows
220387220493
meta:
220388220494
page:
@@ -220423,6 +220529,9 @@ paths:
220423220529
description: A sample workflow.
220424220530
name: Example Workflow
220425220531
published: true
220532+
runAs:
220533+
id: 00000000-0000-0000-0000-000000000007
220534+
type: service_account
220426220535
spec:
220427220536
annotations:
220428220537
- display:
@@ -220489,8 +220598,14 @@ paths:
220489220598
data:
220490220599
attributes:
220491220600
name: Example Workflow
220601+
runAsUserMode: service_account
220492220602
spec: {}
220493220603
id: 00000000-0000-0000-0000-000000000001
220604+
relationships:
220605+
runAs:
220606+
data:
220607+
id: 00000000-0000-0000-0000-000000000007
220608+
type: users
220494220609
type: workflows
220495220610
schema:
220496220611
$ref: "#/components/schemas/CreateWorkflowResponse"
@@ -220572,11 +220687,17 @@ paths:
220572220687
description: A sample workflow.
220573220688
name: Example Workflow
220574220689
published: true
220690+
runAsUserMode: service_account
220575220691
spec: {}
220576220692
tags:
220577220693
- team:infra
220578220694
updatedAt: "2024-01-01T00:00:00+00:00"
220579220695
id: 00000000-0000-0000-0000-000000000002
220696+
relationships:
220697+
runAs:
220698+
data:
220699+
id: 00000000-0000-0000-0000-000000000007
220700+
type: users
220580220701
type: workflows
220581220702
schema:
220582220703
$ref: "#/components/schemas/GetWorkflowResponse"
@@ -220628,6 +220749,9 @@ paths:
220628220749
description: A sample workflow.
220629220750
name: Example Workflow
220630220751
published: true
220752+
runAs:
220753+
id: 00000000-0000-0000-0000-000000000007
220754+
type: service_account
220631220755
spec:
220632220756
annotations:
220633220757
- display:
@@ -220695,7 +220819,13 @@ paths:
220695220819
data:
220696220820
attributes:
220697220821
name: Example Workflow
220822+
runAsUserMode: service_account
220698220823
id: 00000000-0000-0000-0000-000000000003
220824+
relationships:
220825+
runAs:
220826+
data:
220827+
id: 00000000-0000-0000-0000-000000000007
220828+
type: users
220699220829
type: workflows
220700220830
schema:
220701220831
$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)