![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.securityinsights.models.DeploymentInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.securityinsights.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;
/**
* Information regarding a deployment.
*/
@Fluent
public final class DeploymentInfo implements JsonSerializable {
/*
* Status while fetching the last deployment.
*/
private DeploymentFetchStatus deploymentFetchStatus;
/*
* Deployment information.
*/
private Deployment deployment;
/*
* Additional details about the deployment that can be shown to the user.
*/
private String message;
/**
* Creates an instance of DeploymentInfo class.
*/
public DeploymentInfo() {
}
/**
* Get the deploymentFetchStatus property: Status while fetching the last deployment.
*
* @return the deploymentFetchStatus value.
*/
public DeploymentFetchStatus deploymentFetchStatus() {
return this.deploymentFetchStatus;
}
/**
* Set the deploymentFetchStatus property: Status while fetching the last deployment.
*
* @param deploymentFetchStatus the deploymentFetchStatus value to set.
* @return the DeploymentInfo object itself.
*/
public DeploymentInfo withDeploymentFetchStatus(DeploymentFetchStatus deploymentFetchStatus) {
this.deploymentFetchStatus = deploymentFetchStatus;
return this;
}
/**
* Get the deployment property: Deployment information.
*
* @return the deployment value.
*/
public Deployment deployment() {
return this.deployment;
}
/**
* Set the deployment property: Deployment information.
*
* @param deployment the deployment value to set.
* @return the DeploymentInfo object itself.
*/
public DeploymentInfo withDeployment(Deployment deployment) {
this.deployment = deployment;
return this;
}
/**
* Get the message property: Additional details about the deployment that can be shown to the user.
*
* @return the message value.
*/
public String message() {
return this.message;
}
/**
* Set the message property: Additional details about the deployment that can be shown to the user.
*
* @param message the message value to set.
* @return the DeploymentInfo object itself.
*/
public DeploymentInfo withMessage(String message) {
this.message = message;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (deployment() != null) {
deployment().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("deploymentFetchStatus",
this.deploymentFetchStatus == null ? null : this.deploymentFetchStatus.toString());
jsonWriter.writeJsonField("deployment", this.deployment);
jsonWriter.writeStringField("message", this.message);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of DeploymentInfo from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DeploymentInfo 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 DeploymentInfo.
*/
public static DeploymentInfo fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DeploymentInfo deserializedDeploymentInfo = new DeploymentInfo();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("deploymentFetchStatus".equals(fieldName)) {
deserializedDeploymentInfo.deploymentFetchStatus
= DeploymentFetchStatus.fromString(reader.getString());
} else if ("deployment".equals(fieldName)) {
deserializedDeploymentInfo.deployment = Deployment.fromJson(reader);
} else if ("message".equals(fieldName)) {
deserializedDeploymentInfo.message = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedDeploymentInfo;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy