
com.azure.resourcemanager.appcontainers.models.WorkflowEnvelopeProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-appcontainers Show documentation
Show all versions of azure-resourcemanager-appcontainers Show documentation
This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-03.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.appcontainers.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Additional workflow properties.
*/
@Fluent
public final class WorkflowEnvelopeProperties implements JsonSerializable {
/*
* Gets or sets the files.
*/
private Object files;
/*
* Gets or sets the state of the workflow.
*/
private WorkflowState flowState;
/*
* Gets or sets workflow health.
*/
private WorkflowHealth health;
/**
* Creates an instance of WorkflowEnvelopeProperties class.
*/
public WorkflowEnvelopeProperties() {
}
/**
* Get the files property: Gets or sets the files.
*
* @return the files value.
*/
public Object files() {
return this.files;
}
/**
* Set the files property: Gets or sets the files.
*
* @param files the files value to set.
* @return the WorkflowEnvelopeProperties object itself.
*/
public WorkflowEnvelopeProperties withFiles(Object files) {
this.files = files;
return this;
}
/**
* Get the flowState property: Gets or sets the state of the workflow.
*
* @return the flowState value.
*/
public WorkflowState flowState() {
return this.flowState;
}
/**
* Set the flowState property: Gets or sets the state of the workflow.
*
* @param flowState the flowState value to set.
* @return the WorkflowEnvelopeProperties object itself.
*/
public WorkflowEnvelopeProperties withFlowState(WorkflowState flowState) {
this.flowState = flowState;
return this;
}
/**
* Get the health property: Gets or sets workflow health.
*
* @return the health value.
*/
public WorkflowHealth health() {
return this.health;
}
/**
* Set the health property: Gets or sets workflow health.
*
* @param health the health value to set.
* @return the WorkflowEnvelopeProperties object itself.
*/
public WorkflowEnvelopeProperties withHealth(WorkflowHealth health) {
this.health = health;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (health() != null) {
health().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeUntypedField("files", this.files);
jsonWriter.writeStringField("flowState", this.flowState == null ? null : this.flowState.toString());
jsonWriter.writeJsonField("health", this.health);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of WorkflowEnvelopeProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of WorkflowEnvelopeProperties if the JsonReader was pointing to an instance of it, or null if
* it was pointing to JSON null.
* @throws IOException If an error occurs while reading the WorkflowEnvelopeProperties.
*/
public static WorkflowEnvelopeProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
WorkflowEnvelopeProperties deserializedWorkflowEnvelopeProperties = new WorkflowEnvelopeProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("files".equals(fieldName)) {
deserializedWorkflowEnvelopeProperties.files = reader.readUntyped();
} else if ("flowState".equals(fieldName)) {
deserializedWorkflowEnvelopeProperties.flowState = WorkflowState.fromString(reader.getString());
} else if ("health".equals(fieldName)) {
deserializedWorkflowEnvelopeProperties.health = WorkflowHealth.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedWorkflowEnvelopeProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy