com.azure.resourcemanager.compute.models.VirtualMachineScaleSetUpdateVMProfile 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.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;
/**
* Describes a virtual machine scale set virtual machine profile.
*/
@Fluent
public final class VirtualMachineScaleSetUpdateVMProfile
implements JsonSerializable {
/*
* The virtual machine scale set OS profile.
*/
private VirtualMachineScaleSetUpdateOSProfile osProfile;
/*
* The virtual machine scale set storage profile.
*/
private VirtualMachineScaleSetUpdateStorageProfile storageProfile;
/*
* The virtual machine scale set network profile.
*/
private VirtualMachineScaleSetUpdateNetworkProfile networkProfile;
/*
* The virtual machine scale set security posture reference.
*/
private SecurityPostureReferenceUpdate securityPostureReference;
/*
* The virtual machine scale set Security profile
*/
private SecurityProfile securityProfile;
/*
* The virtual machine scale set diagnostics profile.
*/
private DiagnosticsProfile diagnosticsProfile;
/*
* The virtual machine scale set extension profile.
*/
private VirtualMachineScaleSetExtensionProfile extensionProfile;
/*
* The license type, which is for bring your own license scenario.
*/
private String licenseType;
/*
* Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01.
*/
private BillingProfile billingProfile;
/*
* Specifies Scheduled Event related configurations.
*/
private ScheduledEventsProfile scheduledEventsProfile;
/*
* UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.
Minimum
* api-version: 2021-03-01
*/
private String userData;
/*
* Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01.
*/
private VirtualMachineScaleSetHardwareProfile hardwareProfile;
/**
* Creates an instance of VirtualMachineScaleSetUpdateVMProfile class.
*/
public VirtualMachineScaleSetUpdateVMProfile() {
}
/**
* Get the osProfile property: The virtual machine scale set OS profile.
*
* @return the osProfile value.
*/
public VirtualMachineScaleSetUpdateOSProfile osProfile() {
return this.osProfile;
}
/**
* Set the osProfile property: The virtual machine scale set OS profile.
*
* @param osProfile the osProfile value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile withOsProfile(VirtualMachineScaleSetUpdateOSProfile osProfile) {
this.osProfile = osProfile;
return this;
}
/**
* Get the storageProfile property: The virtual machine scale set storage profile.
*
* @return the storageProfile value.
*/
public VirtualMachineScaleSetUpdateStorageProfile storageProfile() {
return this.storageProfile;
}
/**
* Set the storageProfile property: The virtual machine scale set storage profile.
*
* @param storageProfile the storageProfile value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile
withStorageProfile(VirtualMachineScaleSetUpdateStorageProfile storageProfile) {
this.storageProfile = storageProfile;
return this;
}
/**
* Get the networkProfile property: The virtual machine scale set network profile.
*
* @return the networkProfile value.
*/
public VirtualMachineScaleSetUpdateNetworkProfile networkProfile() {
return this.networkProfile;
}
/**
* Set the networkProfile property: The virtual machine scale set network profile.
*
* @param networkProfile the networkProfile value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile
withNetworkProfile(VirtualMachineScaleSetUpdateNetworkProfile networkProfile) {
this.networkProfile = networkProfile;
return this;
}
/**
* Get the securityPostureReference property: The virtual machine scale set security posture reference.
*
* @return the securityPostureReference value.
*/
public SecurityPostureReferenceUpdate securityPostureReference() {
return this.securityPostureReference;
}
/**
* Set the securityPostureReference property: The virtual machine scale set security posture reference.
*
* @param securityPostureReference the securityPostureReference value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile
withSecurityPostureReference(SecurityPostureReferenceUpdate securityPostureReference) {
this.securityPostureReference = securityPostureReference;
return this;
}
/**
* Get the securityProfile property: The virtual machine scale set Security profile.
*
* @return the securityProfile value.
*/
public SecurityProfile securityProfile() {
return this.securityProfile;
}
/**
* Set the securityProfile property: The virtual machine scale set Security profile.
*
* @param securityProfile the securityProfile value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile withSecurityProfile(SecurityProfile securityProfile) {
this.securityProfile = securityProfile;
return this;
}
/**
* Get the diagnosticsProfile property: The virtual machine scale set diagnostics profile.
*
* @return the diagnosticsProfile value.
*/
public DiagnosticsProfile diagnosticsProfile() {
return this.diagnosticsProfile;
}
/**
* Set the diagnosticsProfile property: The virtual machine scale set diagnostics profile.
*
* @param diagnosticsProfile the diagnosticsProfile value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) {
this.diagnosticsProfile = diagnosticsProfile;
return this;
}
/**
* Get the extensionProfile property: The virtual machine scale set extension profile.
*
* @return the extensionProfile value.
*/
public VirtualMachineScaleSetExtensionProfile extensionProfile() {
return this.extensionProfile;
}
/**
* Set the extensionProfile property: The virtual machine scale set extension profile.
*
* @param extensionProfile the extensionProfile value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile
withExtensionProfile(VirtualMachineScaleSetExtensionProfile extensionProfile) {
this.extensionProfile = extensionProfile;
return this;
}
/**
* Get the licenseType property: The license type, which is for bring your own license scenario.
*
* @return the licenseType value.
*/
public String licenseType() {
return this.licenseType;
}
/**
* Set the licenseType property: The license type, which is for bring your own license scenario.
*
* @param licenseType the licenseType value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile withLicenseType(String licenseType) {
this.licenseType = licenseType;
return this;
}
/**
* Get the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. Minimum api-version:
* 2019-03-01.
*
* @return the billingProfile value.
*/
public BillingProfile billingProfile() {
return this.billingProfile;
}
/**
* Set the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. Minimum api-version:
* 2019-03-01.
*
* @param billingProfile the billingProfile value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile withBillingProfile(BillingProfile billingProfile) {
this.billingProfile = billingProfile;
return this;
}
/**
* Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations.
*
* @return the scheduledEventsProfile value.
*/
public ScheduledEventsProfile scheduledEventsProfile() {
return this.scheduledEventsProfile;
}
/**
* Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations.
*
* @param scheduledEventsProfile the scheduledEventsProfile value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile
withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) {
this.scheduledEventsProfile = scheduledEventsProfile;
return this;
}
/**
* Get the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any
* secrets in here. <br><br>Minimum api-version: 2021-03-01.
*
* @return the userData value.
*/
public String userData() {
return this.userData;
}
/**
* Set the userData property: UserData for the VM, which must be base-64 encoded. Customer should not pass any
* secrets in here. <br><br>Minimum api-version: 2021-03-01.
*
* @param userData the userData value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile withUserData(String userData) {
this.userData = userData;
return this;
}
/**
* Get the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum
* api-version: 2021-11-01.
*
* @return the hardwareProfile value.
*/
public VirtualMachineScaleSetHardwareProfile hardwareProfile() {
return this.hardwareProfile;
}
/**
* Set the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum
* api-version: 2021-11-01.
*
* @param hardwareProfile the hardwareProfile value to set.
* @return the VirtualMachineScaleSetUpdateVMProfile object itself.
*/
public VirtualMachineScaleSetUpdateVMProfile
withHardwareProfile(VirtualMachineScaleSetHardwareProfile hardwareProfile) {
this.hardwareProfile = hardwareProfile;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (osProfile() != null) {
osProfile().validate();
}
if (storageProfile() != null) {
storageProfile().validate();
}
if (networkProfile() != null) {
networkProfile().validate();
}
if (securityPostureReference() != null) {
securityPostureReference().validate();
}
if (securityProfile() != null) {
securityProfile().validate();
}
if (diagnosticsProfile() != null) {
diagnosticsProfile().validate();
}
if (extensionProfile() != null) {
extensionProfile().validate();
}
if (billingProfile() != null) {
billingProfile().validate();
}
if (scheduledEventsProfile() != null) {
scheduledEventsProfile().validate();
}
if (hardwareProfile() != null) {
hardwareProfile().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("osProfile", this.osProfile);
jsonWriter.writeJsonField("storageProfile", this.storageProfile);
jsonWriter.writeJsonField("networkProfile", this.networkProfile);
jsonWriter.writeJsonField("securityPostureReference", this.securityPostureReference);
jsonWriter.writeJsonField("securityProfile", this.securityProfile);
jsonWriter.writeJsonField("diagnosticsProfile", this.diagnosticsProfile);
jsonWriter.writeJsonField("extensionProfile", this.extensionProfile);
jsonWriter.writeStringField("licenseType", this.licenseType);
jsonWriter.writeJsonField("billingProfile", this.billingProfile);
jsonWriter.writeJsonField("scheduledEventsProfile", this.scheduledEventsProfile);
jsonWriter.writeStringField("userData", this.userData);
jsonWriter.writeJsonField("hardwareProfile", this.hardwareProfile);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of VirtualMachineScaleSetUpdateVMProfile from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of VirtualMachineScaleSetUpdateVMProfile 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 VirtualMachineScaleSetUpdateVMProfile.
*/
public static VirtualMachineScaleSetUpdateVMProfile fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
VirtualMachineScaleSetUpdateVMProfile deserializedVirtualMachineScaleSetUpdateVMProfile
= new VirtualMachineScaleSetUpdateVMProfile();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("osProfile".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.osProfile
= VirtualMachineScaleSetUpdateOSProfile.fromJson(reader);
} else if ("storageProfile".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.storageProfile
= VirtualMachineScaleSetUpdateStorageProfile.fromJson(reader);
} else if ("networkProfile".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.networkProfile
= VirtualMachineScaleSetUpdateNetworkProfile.fromJson(reader);
} else if ("securityPostureReference".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.securityPostureReference
= SecurityPostureReferenceUpdate.fromJson(reader);
} else if ("securityProfile".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.securityProfile
= SecurityProfile.fromJson(reader);
} else if ("diagnosticsProfile".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.diagnosticsProfile
= DiagnosticsProfile.fromJson(reader);
} else if ("extensionProfile".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.extensionProfile
= VirtualMachineScaleSetExtensionProfile.fromJson(reader);
} else if ("licenseType".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.licenseType = reader.getString();
} else if ("billingProfile".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.billingProfile = BillingProfile.fromJson(reader);
} else if ("scheduledEventsProfile".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.scheduledEventsProfile
= ScheduledEventsProfile.fromJson(reader);
} else if ("userData".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.userData = reader.getString();
} else if ("hardwareProfile".equals(fieldName)) {
deserializedVirtualMachineScaleSetUpdateVMProfile.hardwareProfile
= VirtualMachineScaleSetHardwareProfile.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedVirtualMachineScaleSetUpdateVMProfile;
});
}
}