com.azure.resourcemanager.azurestackhci.models.DeploymentStep Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-azurestackhci Show documentation
Show all versions of azure-resourcemanager-azurestackhci Show documentation
This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2024-04.
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.azurestackhci.models;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;
/**
* The Step of AzureStackHCI Cluster.
*/
@Immutable
public final class DeploymentStep implements JsonSerializable {
/*
* Name of step.
*/
private String name;
/*
* Description of step.
*/
private String description;
/*
* FullStepIndex of step.
*/
private String fullStepIndex;
/*
* Start time of step.
*/
private String startTimeUtc;
/*
* End time of step.
*/
private String endTimeUtc;
/*
* Status of step. Allowed values are 'Error', 'Success', 'InProgress'
*/
private String status;
/*
* List of nested steps of AzureStackHCI Cluster Deployment.
*/
private List steps;
/*
* List of exceptions in AzureStackHCI Cluster Deployment.
*/
private List exception;
/**
* Creates an instance of DeploymentStep class.
*/
public DeploymentStep() {
}
/**
* Get the name property: Name of step.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Get the description property: Description of step.
*
* @return the description value.
*/
public String description() {
return this.description;
}
/**
* Get the fullStepIndex property: FullStepIndex of step.
*
* @return the fullStepIndex value.
*/
public String fullStepIndex() {
return this.fullStepIndex;
}
/**
* Get the startTimeUtc property: Start time of step.
*
* @return the startTimeUtc value.
*/
public String startTimeUtc() {
return this.startTimeUtc;
}
/**
* Get the endTimeUtc property: End time of step.
*
* @return the endTimeUtc value.
*/
public String endTimeUtc() {
return this.endTimeUtc;
}
/**
* Get the status property: Status of step. Allowed values are 'Error', 'Success', 'InProgress'.
*
* @return the status value.
*/
public String status() {
return this.status;
}
/**
* Get the steps property: List of nested steps of AzureStackHCI Cluster Deployment.
*
* @return the steps value.
*/
public List steps() {
return this.steps;
}
/**
* Get the exception property: List of exceptions in AzureStackHCI Cluster Deployment.
*
* @return the exception value.
*/
public List exception() {
return this.exception;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (steps() != null) {
steps().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of DeploymentStep from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DeploymentStep 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 DeploymentStep.
*/
public static DeploymentStep fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DeploymentStep deserializedDeploymentStep = new DeploymentStep();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedDeploymentStep.name = reader.getString();
} else if ("description".equals(fieldName)) {
deserializedDeploymentStep.description = reader.getString();
} else if ("fullStepIndex".equals(fieldName)) {
deserializedDeploymentStep.fullStepIndex = reader.getString();
} else if ("startTimeUtc".equals(fieldName)) {
deserializedDeploymentStep.startTimeUtc = reader.getString();
} else if ("endTimeUtc".equals(fieldName)) {
deserializedDeploymentStep.endTimeUtc = reader.getString();
} else if ("status".equals(fieldName)) {
deserializedDeploymentStep.status = reader.getString();
} else if ("steps".equals(fieldName)) {
List steps = reader.readArray(reader1 -> DeploymentStep.fromJson(reader1));
deserializedDeploymentStep.steps = steps;
} else if ("exception".equals(fieldName)) {
List exception = reader.readArray(reader1 -> reader1.getString());
deserializedDeploymentStep.exception = exception;
} else {
reader.skipChildren();
}
}
return deserializedDeploymentStep;
});
}
}