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
67 changes: 67 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26760,6 +26760,8 @@ components:
description: "A sample workflow."
name: "Example Workflow"
published: true
runAs:
type: owner
spec:
annotations:
- display:
Expand Down Expand Up @@ -120650,6 +120652,8 @@ components:
description: "A sample workflow."
name: "Example Workflow"
published: true
runAs:
type: owner
spec:
annotations:
- display:
Expand Down Expand Up @@ -123733,6 +123737,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 @@ -123761,6 +123771,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 @@ -123804,6 +123817,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 @@ -123922,6 +123941,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 @@ -123939,6 +123961,43 @@ components:
required:
- name
type: object
WorkflowRunAs:
description: Identity used to run the workflow.
properties:
id:
description: The service account identifier. Required when `type` is `service_account`; must be omitted for `owner` and `initiator`.
type: string
type:
$ref: "#/components/schemas/WorkflowRunAsType"
required:
- type
type: object
WorkflowRunAsType:
description: The type of identity used to run the workflow.
enum:
- owner
- service_account
- initiator
example: owner
type: string
x-enum-varnames:
- OWNER
- SERVICE_ACCOUNT
- INITIATOR
WorkflowRunAsUserMode:
description: The effective type of identity used to run the workflow. `internal_user` is returned for workflows configured through internal surfaces.
enum:
- owner
- internal_user
- service_account
- initiator
example: owner
type: string
x-enum-varnames:
- OWNER
- INTERNAL_USER
- SERVICE_ACCOUNT
- INITIATOR
WorkflowTriggerWrapper:
description: "Schema for a Workflow-based trigger."
properties:
Expand Down Expand Up @@ -219909,6 +219968,7 @@ paths:
description: A sample workflow.
name: Example Workflow
published: true
runAsUserMode: owner
spec: {}
tags:
- team:infra
Expand Down Expand Up @@ -219963,6 +220023,8 @@ paths:
description: A sample workflow.
name: Example Workflow
published: true
runAs:
type: owner
spec:
annotations:
- display:
Expand Down Expand Up @@ -220029,6 +220091,7 @@ paths:
data:
attributes:
name: Example Workflow
runAsUserMode: owner
spec: {}
id: 00000000-0000-0000-0000-000000000001
type: workflows
Expand Down Expand Up @@ -220112,6 +220175,7 @@ paths:
description: A sample workflow.
name: Example Workflow
published: true
runAsUserMode: owner
spec: {}
tags:
- team:infra
Expand Down Expand Up @@ -220168,6 +220232,8 @@ paths:
description: A sample workflow.
name: Example Workflow
published: true
runAs:
type: owner
spec:
annotations:
- display:
Expand Down Expand Up @@ -220235,6 +220301,7 @@ paths:
data:
attributes:
name: Example Workflow
runAsUserMode: owner
id: 00000000-0000-0000-0000-000000000003
type: workflows
schema:
Expand Down
3 changes: 3 additions & 0 deletions examples/v2/workflow-automation/CreateWorkflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import com.datadog.api.client.v2.model.WorkflowData;
import com.datadog.api.client.v2.model.WorkflowDataAttributes;
import com.datadog.api.client.v2.model.WorkflowDataType;
import com.datadog.api.client.v2.model.WorkflowRunAs;
import com.datadog.api.client.v2.model.WorkflowRunAsType;
import java.util.Arrays;
import java.util.Collections;

Expand All @@ -44,6 +46,7 @@ public static void main(String[] args) {
.description("A sample workflow.")
.name("Example Workflow")
.published(true)
.runAs(new WorkflowRunAs().type(WorkflowRunAsType.OWNER))
.spec(
new Spec()
.connectionEnvs(
Expand Down
3 changes: 3 additions & 0 deletions examples/v2/workflow-automation/UpdateWorkflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import com.datadog.api.client.v2.model.WorkflowDataType;
import com.datadog.api.client.v2.model.WorkflowDataUpdate;
import com.datadog.api.client.v2.model.WorkflowDataUpdateAttributes;
import com.datadog.api.client.v2.model.WorkflowRunAs;
import com.datadog.api.client.v2.model.WorkflowRunAsType;
import java.util.Arrays;
import java.util.Collections;

Expand All @@ -47,6 +49,7 @@ public static void main(String[] args) {
.description("A sample workflow.")
.name("Example Workflow")
.published(true)
.runAs(new WorkflowRunAs().type(WorkflowRunAsType.OWNER))
.spec(
new Spec()
.connectionEnvs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
WorkflowDataAttributes.JSON_PROPERTY_DESCRIPTION,
WorkflowDataAttributes.JSON_PROPERTY_NAME,
WorkflowDataAttributes.JSON_PROPERTY_PUBLISHED,
WorkflowDataAttributes.JSON_PROPERTY_RUN_AS,
WorkflowDataAttributes.JSON_PROPERTY_RUN_AS_USER_MODE,
WorkflowDataAttributes.JSON_PROPERTY_SPEC,
WorkflowDataAttributes.JSON_PROPERTY_TAGS,
WorkflowDataAttributes.JSON_PROPERTY_UPDATED_AT,
Expand All @@ -47,6 +49,12 @@ public class WorkflowDataAttributes {
public static final String JSON_PROPERTY_PUBLISHED = "published";
private Boolean published;

public static final String JSON_PROPERTY_RUN_AS = "runAs";
private WorkflowRunAs runAs;

public static final String JSON_PROPERTY_RUN_AS_USER_MODE = "runAsUserMode";
private WorkflowRunAsUserMode runAsUserMode;

public static final String JSON_PROPERTY_SPEC = "spec";
private Spec spec;

Expand Down Expand Up @@ -146,6 +154,57 @@ public void setPublished(Boolean published) {
this.published = published;
}

public WorkflowDataAttributes runAs(WorkflowRunAs runAs) {
this.runAs = runAs;
this.unparsed |= runAs.unparsed;
return this;
}

/**
* Identity used to run the workflow.
*
* @return runAs
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RUN_AS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public WorkflowRunAs getRunAs() {
return runAs;
}

public void setRunAs(WorkflowRunAs runAs) {
this.runAs = runAs;
if (runAs != null) {
this.unparsed |= runAs.unparsed;
}
}

public WorkflowDataAttributes runAsUserMode(WorkflowRunAsUserMode runAsUserMode) {
this.runAsUserMode = runAsUserMode;
this.unparsed |= !runAsUserMode.isValid();
return this;
}

/**
* The effective type of identity used to run the workflow. <code>internal_user</code> is returned
* for workflows configured through internal surfaces.
*
* @return runAsUserMode
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RUN_AS_USER_MODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public WorkflowRunAsUserMode getRunAsUserMode() {
return runAsUserMode;
}

public void setRunAsUserMode(WorkflowRunAsUserMode runAsUserMode) {
if (!runAsUserMode.isValid()) {
this.unparsed = true;
}
this.runAsUserMode = runAsUserMode;
}

public WorkflowDataAttributes spec(Spec spec) {
this.spec = spec;
this.unparsed |= spec.unparsed;
Expand Down Expand Up @@ -293,6 +352,8 @@ public boolean equals(Object o) {
&& Objects.equals(this.description, workflowDataAttributes.description)
&& Objects.equals(this.name, workflowDataAttributes.name)
&& Objects.equals(this.published, workflowDataAttributes.published)
&& Objects.equals(this.runAs, workflowDataAttributes.runAs)
&& Objects.equals(this.runAsUserMode, workflowDataAttributes.runAsUserMode)
&& Objects.equals(this.spec, workflowDataAttributes.spec)
&& Objects.equals(this.tags, workflowDataAttributes.tags)
&& Objects.equals(this.updatedAt, workflowDataAttributes.updatedAt)
Expand All @@ -307,6 +368,8 @@ public int hashCode() {
description,
name,
published,
runAs,
runAsUserMode,
spec,
tags,
updatedAt,
Expand All @@ -322,6 +385,8 @@ public String toString() {
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" published: ").append(toIndentedString(published)).append("\n");
sb.append(" runAs: ").append(toIndentedString(runAs)).append("\n");
sb.append(" runAsUserMode: ").append(toIndentedString(runAsUserMode)).append("\n");
sb.append(" spec: ").append(toIndentedString(spec)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
/** The definition of <code>WorkflowDataRelationships</code> object. */
@JsonPropertyOrder({
WorkflowDataRelationships.JSON_PROPERTY_CREATOR,
WorkflowDataRelationships.JSON_PROPERTY_OWNER
WorkflowDataRelationships.JSON_PROPERTY_OWNER,
WorkflowDataRelationships.JSON_PROPERTY_RUN_AS
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
Expand All @@ -31,6 +32,9 @@ public class WorkflowDataRelationships {
public static final String JSON_PROPERTY_OWNER = "owner";
private WorkflowUserRelationship owner;

public static final String JSON_PROPERTY_RUN_AS = "runAs";
private WorkflowUserRelationship runAs;

public WorkflowDataRelationships creator(WorkflowUserRelationship creator) {
this.creator = creator;
this.unparsed |= creator.unparsed;
Expand Down Expand Up @@ -81,6 +85,31 @@ public void setOwner(WorkflowUserRelationship owner) {
}
}

public WorkflowDataRelationships runAs(WorkflowUserRelationship runAs) {
this.runAs = runAs;
this.unparsed |= runAs.unparsed;
return this;
}

/**
* The definition of <code>WorkflowUserRelationship</code> object.
*
* @return runAs
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RUN_AS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public WorkflowUserRelationship getRunAs() {
return runAs;
}

public void setRunAs(WorkflowUserRelationship runAs) {
this.runAs = runAs;
if (runAs != null) {
this.unparsed |= runAs.unparsed;
}
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
Expand Down Expand Up @@ -139,13 +168,14 @@ public boolean equals(Object o) {
WorkflowDataRelationships workflowDataRelationships = (WorkflowDataRelationships) o;
return Objects.equals(this.creator, workflowDataRelationships.creator)
&& Objects.equals(this.owner, workflowDataRelationships.owner)
&& Objects.equals(this.runAs, workflowDataRelationships.runAs)
&& Objects.equals(
this.additionalProperties, workflowDataRelationships.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(creator, owner, additionalProperties);
return Objects.hash(creator, owner, runAs, additionalProperties);
}

@Override
Expand All @@ -154,6 +184,7 @@ public String toString() {
sb.append("class WorkflowDataRelationships {\n");
sb.append(" creator: ").append(toIndentedString(creator)).append("\n");
sb.append(" owner: ").append(toIndentedString(owner)).append("\n");
sb.append(" runAs: ").append(toIndentedString(runAs)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand Down
Loading
Loading