com.azure.resourcemanager.servicefabricmanagedclusters.fluent.models.VmssExtensionProperties 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.core.util.logging.ClientLogger;
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.VmssExtensionSetupOrder;
import java.io.IOException;
import java.util.List;
/**
* Describes the properties of a Virtual Machine Scale Set Extension.
*/
@Fluent
public final class VmssExtensionProperties implements JsonSerializable {
/*
* The name of the extension handler publisher.
*/
private String publisher;
/*
* Specifies the type of the extension; an example is "CustomScriptExtension".
*/
private String type;
/*
* Specifies the version of the script handler.
*/
private String typeHandlerVersion;
/*
* Indicates whether the extension should use a newer minor version if one is available at deployment time. Once
* deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set
* to true.
*/
private Boolean autoUpgradeMinorVersion;
/*
* Json formatted public settings for the extension.
*/
private Object settings;
/*
* The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at
* all.
*/
private Object protectedSettings;
/*
* If a value is provided and is different from the previous value, the extension handler will be forced to update
* even if the extension configuration has not changed.
*/
private String forceUpdateTag;
/*
* Collection of extension names after which this extension needs to be provisioned.
*/
private List provisionAfterExtensions;
/*
* The provisioning state, which only appears in the response.
*/
private String provisioningState;
/*
* Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of
* the extension available.
*/
private Boolean enableAutomaticUpgrade;
/*
* Indicates the setup order for the extension.
*/
private List setupOrder;
/**
* Creates an instance of VmssExtensionProperties class.
*/
public VmssExtensionProperties() {
}
/**
* Get the publisher property: The name of the extension handler publisher.
*
* @return the publisher value.
*/
public String publisher() {
return this.publisher;
}
/**
* Set the publisher property: The name of the extension handler publisher.
*
* @param publisher the publisher value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withPublisher(String publisher) {
this.publisher = publisher;
return this;
}
/**
* Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension".
*
* @return the type value.
*/
public String type() {
return this.type;
}
/**
* Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension".
*
* @param type the type value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withType(String type) {
this.type = type;
return this;
}
/**
* Get the typeHandlerVersion property: Specifies the version of the script handler.
*
* @return the typeHandlerVersion value.
*/
public String typeHandlerVersion() {
return this.typeHandlerVersion;
}
/**
* Set the typeHandlerVersion property: Specifies the version of the script handler.
*
* @param typeHandlerVersion the typeHandlerVersion value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) {
this.typeHandlerVersion = typeHandlerVersion;
return this;
}
/**
* Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one
* is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless
* redeployed, even with this property set to true.
*
* @return the autoUpgradeMinorVersion value.
*/
public Boolean autoUpgradeMinorVersion() {
return this.autoUpgradeMinorVersion;
}
/**
* Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one
* is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless
* redeployed, even with this property set to true.
*
* @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) {
this.autoUpgradeMinorVersion = autoUpgradeMinorVersion;
return this;
}
/**
* Get the settings property: Json formatted public settings for the extension.
*
* @return the settings value.
*/
public Object settings() {
return this.settings;
}
/**
* Set the settings property: Json formatted public settings for the extension.
*
* @param settings the settings value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withSettings(Object settings) {
this.settings = settings;
return this;
}
/**
* Get the protectedSettings property: The extension can contain either protectedSettings or
* protectedSettingsFromKeyVault or no protected settings at all.
*
* @return the protectedSettings value.
*/
public Object protectedSettings() {
return this.protectedSettings;
}
/**
* Set the protectedSettings property: The extension can contain either protectedSettings or
* protectedSettingsFromKeyVault or no protected settings at all.
*
* @param protectedSettings the protectedSettings value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withProtectedSettings(Object protectedSettings) {
this.protectedSettings = protectedSettings;
return this;
}
/**
* Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension
* handler will be forced to update even if the extension configuration has not changed.
*
* @return the forceUpdateTag value.
*/
public String forceUpdateTag() {
return this.forceUpdateTag;
}
/**
* Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension
* handler will be forced to update even if the extension configuration has not changed.
*
* @param forceUpdateTag the forceUpdateTag value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withForceUpdateTag(String forceUpdateTag) {
this.forceUpdateTag = forceUpdateTag;
return this;
}
/**
* Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be
* provisioned.
*
* @return the provisionAfterExtensions value.
*/
public List provisionAfterExtensions() {
return this.provisionAfterExtensions;
}
/**
* Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be
* provisioned.
*
* @param provisionAfterExtensions the provisionAfterExtensions value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withProvisionAfterExtensions(List provisionAfterExtensions) {
this.provisionAfterExtensions = provisionAfterExtensions;
return this;
}
/**
* Get the provisioningState property: The provisioning state, which only appears in the response.
*
* @return the provisioningState value.
*/
public String provisioningState() {
return this.provisioningState;
}
/**
* Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the
* platform if there is a newer version of the extension available.
*
* @return the enableAutomaticUpgrade value.
*/
public Boolean enableAutomaticUpgrade() {
return this.enableAutomaticUpgrade;
}
/**
* Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the
* platform if there is a newer version of the extension available.
*
* @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) {
this.enableAutomaticUpgrade = enableAutomaticUpgrade;
return this;
}
/**
* Get the setupOrder property: Indicates the setup order for the extension.
*
* @return the setupOrder value.
*/
public List setupOrder() {
return this.setupOrder;
}
/**
* Set the setupOrder property: Indicates the setup order for the extension.
*
* @param setupOrder the setupOrder value to set.
* @return the VmssExtensionProperties object itself.
*/
public VmssExtensionProperties withSetupOrder(List setupOrder) {
this.setupOrder = setupOrder;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (publisher() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property publisher in model VmssExtensionProperties"));
}
if (type() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException("Missing required property type in model VmssExtensionProperties"));
}
if (typeHandlerVersion() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property typeHandlerVersion in model VmssExtensionProperties"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(VmssExtensionProperties.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("publisher", this.publisher);
jsonWriter.writeStringField("type", this.type);
jsonWriter.writeStringField("typeHandlerVersion", this.typeHandlerVersion);
jsonWriter.writeBooleanField("autoUpgradeMinorVersion", this.autoUpgradeMinorVersion);
jsonWriter.writeUntypedField("settings", this.settings);
jsonWriter.writeUntypedField("protectedSettings", this.protectedSettings);
jsonWriter.writeStringField("forceUpdateTag", this.forceUpdateTag);
jsonWriter.writeArrayField("provisionAfterExtensions", this.provisionAfterExtensions,
(writer, element) -> writer.writeString(element));
jsonWriter.writeBooleanField("enableAutomaticUpgrade", this.enableAutomaticUpgrade);
jsonWriter.writeArrayField("setupOrder", this.setupOrder,
(writer, element) -> writer.writeString(element == null ? null : element.toString()));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of VmssExtensionProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of VmssExtensionProperties if the JsonReader was pointing to an instance of it, or null if it
* was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the VmssExtensionProperties.
*/
public static VmssExtensionProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
VmssExtensionProperties deserializedVmssExtensionProperties = new VmssExtensionProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("publisher".equals(fieldName)) {
deserializedVmssExtensionProperties.publisher = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedVmssExtensionProperties.type = reader.getString();
} else if ("typeHandlerVersion".equals(fieldName)) {
deserializedVmssExtensionProperties.typeHandlerVersion = reader.getString();
} else if ("autoUpgradeMinorVersion".equals(fieldName)) {
deserializedVmssExtensionProperties.autoUpgradeMinorVersion
= reader.getNullable(JsonReader::getBoolean);
} else if ("settings".equals(fieldName)) {
deserializedVmssExtensionProperties.settings = reader.readUntyped();
} else if ("protectedSettings".equals(fieldName)) {
deserializedVmssExtensionProperties.protectedSettings = reader.readUntyped();
} else if ("forceUpdateTag".equals(fieldName)) {
deserializedVmssExtensionProperties.forceUpdateTag = reader.getString();
} else if ("provisionAfterExtensions".equals(fieldName)) {
List provisionAfterExtensions = reader.readArray(reader1 -> reader1.getString());
deserializedVmssExtensionProperties.provisionAfterExtensions = provisionAfterExtensions;
} else if ("provisioningState".equals(fieldName)) {
deserializedVmssExtensionProperties.provisioningState = reader.getString();
} else if ("enableAutomaticUpgrade".equals(fieldName)) {
deserializedVmssExtensionProperties.enableAutomaticUpgrade
= reader.getNullable(JsonReader::getBoolean);
} else if ("setupOrder".equals(fieldName)) {
List setupOrder
= reader.readArray(reader1 -> VmssExtensionSetupOrder.fromString(reader1.getString()));
deserializedVmssExtensionProperties.setupOrder = setupOrder;
} else {
reader.skipChildren();
}
}
return deserializedVmssExtensionProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy