com.azure.resourcemanager.hybridcompute.fluent.models.MachineUpdateProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-hybridcompute Show documentation
Show all versions of azure-resourcemanager-hybridcompute Show documentation
This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2024-07.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.hybridcompute.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.hybridcompute.models.AgentUpgrade;
import com.azure.resourcemanager.hybridcompute.models.CloudMetadata;
import com.azure.resourcemanager.hybridcompute.models.LocationData;
import com.azure.resourcemanager.hybridcompute.models.OSProfile;
import java.io.IOException;
/**
* Describes the ARM updatable properties of a hybrid machine.
*/
@Fluent
public final class MachineUpdateProperties implements JsonSerializable {
/*
* Metadata pertaining to the geographic location of the resource.
*/
private LocationData locationData;
/*
* Specifies the operating system settings for the hybrid machine.
*/
private OSProfile osProfile;
/*
* The metadata of the cloud environment (Azure/GCP/AWS/OCI...).
*/
private CloudMetadata cloudMetadata;
/*
* The info of the machine w.r.t Agent Upgrade
*/
private AgentUpgrade agentUpgrade;
/*
* The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any.
*/
private String parentClusterResourceId;
/*
* The resource id of the private link scope this machine is assigned to, if any.
*/
private String privateLinkScopeResourceId;
/**
* Creates an instance of MachineUpdateProperties class.
*/
public MachineUpdateProperties() {
}
/**
* Get the locationData property: Metadata pertaining to the geographic location of the resource.
*
* @return the locationData value.
*/
public LocationData locationData() {
return this.locationData;
}
/**
* Set the locationData property: Metadata pertaining to the geographic location of the resource.
*
* @param locationData the locationData value to set.
* @return the MachineUpdateProperties object itself.
*/
public MachineUpdateProperties withLocationData(LocationData locationData) {
this.locationData = locationData;
return this;
}
/**
* Get the osProfile property: Specifies the operating system settings for the hybrid machine.
*
* @return the osProfile value.
*/
public OSProfile osProfile() {
return this.osProfile;
}
/**
* Set the osProfile property: Specifies the operating system settings for the hybrid machine.
*
* @param osProfile the osProfile value to set.
* @return the MachineUpdateProperties object itself.
*/
public MachineUpdateProperties withOsProfile(OSProfile osProfile) {
this.osProfile = osProfile;
return this;
}
/**
* Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...).
*
* @return the cloudMetadata value.
*/
public CloudMetadata cloudMetadata() {
return this.cloudMetadata;
}
/**
* Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...).
*
* @param cloudMetadata the cloudMetadata value to set.
* @return the MachineUpdateProperties object itself.
*/
public MachineUpdateProperties withCloudMetadata(CloudMetadata cloudMetadata) {
this.cloudMetadata = cloudMetadata;
return this;
}
/**
* Get the agentUpgrade property: The info of the machine w.r.t Agent Upgrade.
*
* @return the agentUpgrade value.
*/
public AgentUpgrade agentUpgrade() {
return this.agentUpgrade;
}
/**
* Set the agentUpgrade property: The info of the machine w.r.t Agent Upgrade.
*
* @param agentUpgrade the agentUpgrade value to set.
* @return the MachineUpdateProperties object itself.
*/
public MachineUpdateProperties withAgentUpgrade(AgentUpgrade agentUpgrade) {
this.agentUpgrade = agentUpgrade;
return this;
}
/**
* Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is
* assigned to, if any.
*
* @return the parentClusterResourceId value.
*/
public String parentClusterResourceId() {
return this.parentClusterResourceId;
}
/**
* Set the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is
* assigned to, if any.
*
* @param parentClusterResourceId the parentClusterResourceId value to set.
* @return the MachineUpdateProperties object itself.
*/
public MachineUpdateProperties withParentClusterResourceId(String parentClusterResourceId) {
this.parentClusterResourceId = parentClusterResourceId;
return this;
}
/**
* Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned
* to, if any.
*
* @return the privateLinkScopeResourceId value.
*/
public String privateLinkScopeResourceId() {
return this.privateLinkScopeResourceId;
}
/**
* Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned
* to, if any.
*
* @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set.
* @return the MachineUpdateProperties object itself.
*/
public MachineUpdateProperties withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) {
this.privateLinkScopeResourceId = privateLinkScopeResourceId;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (locationData() != null) {
locationData().validate();
}
if (osProfile() != null) {
osProfile().validate();
}
if (cloudMetadata() != null) {
cloudMetadata().validate();
}
if (agentUpgrade() != null) {
agentUpgrade().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("locationData", this.locationData);
jsonWriter.writeJsonField("osProfile", this.osProfile);
jsonWriter.writeJsonField("cloudMetadata", this.cloudMetadata);
jsonWriter.writeJsonField("agentUpgrade", this.agentUpgrade);
jsonWriter.writeStringField("parentClusterResourceId", this.parentClusterResourceId);
jsonWriter.writeStringField("privateLinkScopeResourceId", this.privateLinkScopeResourceId);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MachineUpdateProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MachineUpdateProperties 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 MachineUpdateProperties.
*/
public static MachineUpdateProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MachineUpdateProperties deserializedMachineUpdateProperties = new MachineUpdateProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("locationData".equals(fieldName)) {
deserializedMachineUpdateProperties.locationData = LocationData.fromJson(reader);
} else if ("osProfile".equals(fieldName)) {
deserializedMachineUpdateProperties.osProfile = OSProfile.fromJson(reader);
} else if ("cloudMetadata".equals(fieldName)) {
deserializedMachineUpdateProperties.cloudMetadata = CloudMetadata.fromJson(reader);
} else if ("agentUpgrade".equals(fieldName)) {
deserializedMachineUpdateProperties.agentUpgrade = AgentUpgrade.fromJson(reader);
} else if ("parentClusterResourceId".equals(fieldName)) {
deserializedMachineUpdateProperties.parentClusterResourceId = reader.getString();
} else if ("privateLinkScopeResourceId".equals(fieldName)) {
deserializedMachineUpdateProperties.privateLinkScopeResourceId = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedMachineUpdateProperties;
});
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy