com.azure.resourcemanager.servicefabricmanagedclusters.fluent.models.ManagedClusterCodeVersionResultInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-servicefabricmanagedclusters Show documentation
Show all versions of azure-resourcemanager-servicefabricmanagedclusters Show documentation
This package contains Microsoft Azure SDK for Service Fabric Managed Clusters Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Service Fabric Managed Clusters Management Client. Package tag package-2024-04.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.servicefabricmanagedclusters.fluent.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 com.azure.resourcemanager.servicefabricmanagedclusters.models.OsType;
import java.io.IOException;
/**
* The result of the Service Fabric runtime versions.
*/
@Fluent
public final class ManagedClusterCodeVersionResultInner
implements JsonSerializable {
/*
* The identification of the result
*/
private String id;
/*
* The name of the result
*/
private String name;
/*
* The result resource type
*/
private String type;
/*
* The detail of the Service Fabric runtime version result
*/
private ManagedClusterVersionDetails innerProperties;
/**
* Creates an instance of ManagedClusterCodeVersionResultInner class.
*/
public ManagedClusterCodeVersionResultInner() {
}
/**
* Get the id property: The identification of the result.
*
* @return the id value.
*/
public String id() {
return this.id;
}
/**
* Set the id property: The identification of the result.
*
* @param id the id value to set.
* @return the ManagedClusterCodeVersionResultInner object itself.
*/
public ManagedClusterCodeVersionResultInner withId(String id) {
this.id = id;
return this;
}
/**
* Get the name property: The name of the result.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: The name of the result.
*
* @param name the name value to set.
* @return the ManagedClusterCodeVersionResultInner object itself.
*/
public ManagedClusterCodeVersionResultInner withName(String name) {
this.name = name;
return this;
}
/**
* Get the type property: The result resource type.
*
* @return the type value.
*/
public String type() {
return this.type;
}
/**
* Set the type property: The result resource type.
*
* @param type the type value to set.
* @return the ManagedClusterCodeVersionResultInner object itself.
*/
public ManagedClusterCodeVersionResultInner withType(String type) {
this.type = type;
return this;
}
/**
* Get the innerProperties property: The detail of the Service Fabric runtime version result.
*
* @return the innerProperties value.
*/
private ManagedClusterVersionDetails innerProperties() {
return this.innerProperties;
}
/**
* Get the clusterCodeVersion property: The Service Fabric runtime version of the cluster.
*
* @return the clusterCodeVersion value.
*/
public String clusterCodeVersion() {
return this.innerProperties() == null ? null : this.innerProperties().clusterCodeVersion();
}
/**
* Set the clusterCodeVersion property: The Service Fabric runtime version of the cluster.
*
* @param clusterCodeVersion the clusterCodeVersion value to set.
* @return the ManagedClusterCodeVersionResultInner object itself.
*/
public ManagedClusterCodeVersionResultInner withClusterCodeVersion(String clusterCodeVersion) {
if (this.innerProperties() == null) {
this.innerProperties = new ManagedClusterVersionDetails();
}
this.innerProperties().withClusterCodeVersion(clusterCodeVersion);
return this;
}
/**
* Get the supportExpiryUtc property: The date of expiry of support of the version.
*
* @return the supportExpiryUtc value.
*/
public String supportExpiryUtc() {
return this.innerProperties() == null ? null : this.innerProperties().supportExpiryUtc();
}
/**
* Set the supportExpiryUtc property: The date of expiry of support of the version.
*
* @param supportExpiryUtc the supportExpiryUtc value to set.
* @return the ManagedClusterCodeVersionResultInner object itself.
*/
public ManagedClusterCodeVersionResultInner withSupportExpiryUtc(String supportExpiryUtc) {
if (this.innerProperties() == null) {
this.innerProperties = new ManagedClusterVersionDetails();
}
this.innerProperties().withSupportExpiryUtc(supportExpiryUtc);
return this;
}
/**
* Get the osType property: Cluster operating system, the default will be Windows.
*
* @return the osType value.
*/
public OsType osType() {
return this.innerProperties() == null ? null : this.innerProperties().osType();
}
/**
* Set the osType property: Cluster operating system, the default will be Windows.
*
* @param osType the osType value to set.
* @return the ManagedClusterCodeVersionResultInner object itself.
*/
public ManagedClusterCodeVersionResultInner withOsType(OsType osType) {
if (this.innerProperties() == null) {
this.innerProperties = new ManagedClusterVersionDetails();
}
this.innerProperties().withOsType(osType);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("id", this.id);
jsonWriter.writeStringField("name", this.name);
jsonWriter.writeStringField("type", this.type);
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ManagedClusterCodeVersionResultInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ManagedClusterCodeVersionResultInner 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 ManagedClusterCodeVersionResultInner.
*/
public static ManagedClusterCodeVersionResultInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ManagedClusterCodeVersionResultInner deserializedManagedClusterCodeVersionResultInner
= new ManagedClusterCodeVersionResultInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedManagedClusterCodeVersionResultInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedManagedClusterCodeVersionResultInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedManagedClusterCodeVersionResultInner.type = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedManagedClusterCodeVersionResultInner.innerProperties
= ManagedClusterVersionDetails.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedManagedClusterCodeVersionResultInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy