com.azure.resourcemanager.compute.fluent.models.CommunityGalleryImageVersionInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-compute Show documentation
Show all versions of azure-resourcemanager-compute Show documentation
This package contains Microsoft Azure Compute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.compute.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.compute.models.PirCommunityGalleryResource;
import com.azure.resourcemanager.compute.models.SharedGalleryImageVersionStorageProfile;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.Map;
/**
* Specifies information about the gallery image version that you want to create or update.
*/
@Fluent
public final class CommunityGalleryImageVersionInner extends PirCommunityGalleryResource {
/*
* Describes the properties of a gallery image version.
*/
private CommunityGalleryImageVersionProperties innerProperties;
/*
* Resource name
*/
private String name;
/*
* Resource location
*/
private String location;
/*
* Resource type
*/
private String type;
/*
* The identifier information of community gallery.
*/
private CommunityGalleryIdentifier innerIdentifier;
/**
* Creates an instance of CommunityGalleryImageVersionInner class.
*/
public CommunityGalleryImageVersionInner() {
}
/**
* Get the innerProperties property: Describes the properties of a gallery image version.
*
* @return the innerProperties value.
*/
private CommunityGalleryImageVersionProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the name property: Resource name.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* Get the location property: Resource location.
*
* @return the location value.
*/
@Override
public String location() {
return this.location;
}
/**
* Get the type property: Resource type.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the innerIdentifier property: The identifier information of community gallery.
*
* @return the innerIdentifier value.
*/
private CommunityGalleryIdentifier innerIdentifier() {
return this.innerIdentifier;
}
/**
* Get the uniqueId property: The unique id of this community gallery.
*
* @return the uniqueId value.
*/
public String uniqueId() {
return this.innerIdentifier() == null ? null : this.innerIdentifier().uniqueId();
}
/**
* Set the uniqueId property: The unique id of this community gallery.
*
* @param uniqueId the uniqueId value to set.
* @return the CommunityGalleryImageVersionInner object itself.
*/
public CommunityGalleryImageVersionInner withUniqueId(String uniqueId) {
if (this.innerIdentifier() == null) {
this.innerIdentifier = new CommunityGalleryIdentifier();
}
this.innerIdentifier().withUniqueId(uniqueId);
return this;
}
/**
* Get the publishedDate property: The published date of the gallery image version Definition. This property can be
* used for decommissioning purposes. This property is updatable.
*
* @return the publishedDate value.
*/
public OffsetDateTime publishedDate() {
return this.innerProperties() == null ? null : this.innerProperties().publishedDate();
}
/**
* Set the publishedDate property: The published date of the gallery image version Definition. This property can be
* used for decommissioning purposes. This property is updatable.
*
* @param publishedDate the publishedDate value to set.
* @return the CommunityGalleryImageVersionInner object itself.
*/
public CommunityGalleryImageVersionInner withPublishedDate(OffsetDateTime publishedDate) {
if (this.innerProperties() == null) {
this.innerProperties = new CommunityGalleryImageVersionProperties();
}
this.innerProperties().withPublishedDate(publishedDate);
return this;
}
/**
* Get the endOfLifeDate property: The end of life date of the gallery image version Definition. This property can
* be used for decommissioning purposes. This property is updatable.
*
* @return the endOfLifeDate value.
*/
public OffsetDateTime endOfLifeDate() {
return this.innerProperties() == null ? null : this.innerProperties().endOfLifeDate();
}
/**
* Set the endOfLifeDate property: The end of life date of the gallery image version Definition. This property can
* be used for decommissioning purposes. This property is updatable.
*
* @param endOfLifeDate the endOfLifeDate value to set.
* @return the CommunityGalleryImageVersionInner object itself.
*/
public CommunityGalleryImageVersionInner withEndOfLifeDate(OffsetDateTime endOfLifeDate) {
if (this.innerProperties() == null) {
this.innerProperties = new CommunityGalleryImageVersionProperties();
}
this.innerProperties().withEndOfLifeDate(endOfLifeDate);
return this;
}
/**
* Get the excludeFromLatest property: If set to true, Virtual Machines deployed from the latest version of the
* Image Definition won't use this Image Version.
*
* @return the excludeFromLatest value.
*/
public Boolean excludeFromLatest() {
return this.innerProperties() == null ? null : this.innerProperties().excludeFromLatest();
}
/**
* Set the excludeFromLatest property: If set to true, Virtual Machines deployed from the latest version of the
* Image Definition won't use this Image Version.
*
* @param excludeFromLatest the excludeFromLatest value to set.
* @return the CommunityGalleryImageVersionInner object itself.
*/
public CommunityGalleryImageVersionInner withExcludeFromLatest(Boolean excludeFromLatest) {
if (this.innerProperties() == null) {
this.innerProperties = new CommunityGalleryImageVersionProperties();
}
this.innerProperties().withExcludeFromLatest(excludeFromLatest);
return this;
}
/**
* Get the storageProfile property: Describes the storage profile of the image version.
*
* @return the storageProfile value.
*/
public SharedGalleryImageVersionStorageProfile storageProfile() {
return this.innerProperties() == null ? null : this.innerProperties().storageProfile();
}
/**
* Set the storageProfile property: Describes the storage profile of the image version.
*
* @param storageProfile the storageProfile value to set.
* @return the CommunityGalleryImageVersionInner object itself.
*/
public CommunityGalleryImageVersionInner
withStorageProfile(SharedGalleryImageVersionStorageProfile storageProfile) {
if (this.innerProperties() == null) {
this.innerProperties = new CommunityGalleryImageVersionProperties();
}
this.innerProperties().withStorageProfile(storageProfile);
return this;
}
/**
* Get the disclaimer property: The disclaimer for a community gallery resource.
*
* @return the disclaimer value.
*/
public String disclaimer() {
return this.innerProperties() == null ? null : this.innerProperties().disclaimer();
}
/**
* Set the disclaimer property: The disclaimer for a community gallery resource.
*
* @param disclaimer the disclaimer value to set.
* @return the CommunityGalleryImageVersionInner object itself.
*/
public CommunityGalleryImageVersionInner withDisclaimer(String disclaimer) {
if (this.innerProperties() == null) {
this.innerProperties = new CommunityGalleryImageVersionProperties();
}
this.innerProperties().withDisclaimer(disclaimer);
return this;
}
/**
* Get the artifactTags property: The artifact tags of a community gallery resource.
*
* @return the artifactTags value.
*/
public Map artifactTags() {
return this.innerProperties() == null ? null : this.innerProperties().artifactTags();
}
/**
* Set the artifactTags property: The artifact tags of a community gallery resource.
*
* @param artifactTags the artifactTags value to set.
* @return the CommunityGalleryImageVersionInner object itself.
*/
public CommunityGalleryImageVersionInner withArtifactTags(Map artifactTags) {
if (this.innerProperties() == null) {
this.innerProperties = new CommunityGalleryImageVersionProperties();
}
this.innerProperties().withArtifactTags(artifactTags);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
super.validate();
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("identifier", innerIdentifier());
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of CommunityGalleryImageVersionInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CommunityGalleryImageVersionInner 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 CommunityGalleryImageVersionInner.
*/
public static CommunityGalleryImageVersionInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CommunityGalleryImageVersionInner deserializedCommunityGalleryImageVersionInner
= new CommunityGalleryImageVersionInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedCommunityGalleryImageVersionInner.name = reader.getString();
} else if ("location".equals(fieldName)) {
deserializedCommunityGalleryImageVersionInner.location = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedCommunityGalleryImageVersionInner.type = reader.getString();
} else if ("identifier".equals(fieldName)) {
deserializedCommunityGalleryImageVersionInner.innerIdentifier
= CommunityGalleryIdentifier.fromJson(reader);
} else if ("properties".equals(fieldName)) {
deserializedCommunityGalleryImageVersionInner.innerProperties
= CommunityGalleryImageVersionProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedCommunityGalleryImageVersionInner;
});
}
}