com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-avs Show documentation
Show all versions of azure-resourcemanager-avs Show documentation
This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package tag package-2023-09-01.
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.avs.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;
/**
* Set VM DRS-driven movement to restricted (enabled) or not (disabled).
*/
@Fluent
public final class VirtualMachineRestrictMovement implements JsonSerializable {
/*
* Whether VM DRS-driven movement is restricted (enabled) or not (disabled)
*/
private VirtualMachineRestrictMovementState restrictMovement;
/**
* Creates an instance of VirtualMachineRestrictMovement class.
*/
public VirtualMachineRestrictMovement() {
}
/**
* Get the restrictMovement property: Whether VM DRS-driven movement is restricted (enabled) or not (disabled).
*
* @return the restrictMovement value.
*/
public VirtualMachineRestrictMovementState restrictMovement() {
return this.restrictMovement;
}
/**
* Set the restrictMovement property: Whether VM DRS-driven movement is restricted (enabled) or not (disabled).
*
* @param restrictMovement the restrictMovement value to set.
* @return the VirtualMachineRestrictMovement object itself.
*/
public VirtualMachineRestrictMovement withRestrictMovement(VirtualMachineRestrictMovementState restrictMovement) {
this.restrictMovement = restrictMovement;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("restrictMovement",
this.restrictMovement == null ? null : this.restrictMovement.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of VirtualMachineRestrictMovement from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of VirtualMachineRestrictMovement 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 VirtualMachineRestrictMovement.
*/
public static VirtualMachineRestrictMovement fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
VirtualMachineRestrictMovement deserializedVirtualMachineRestrictMovement
= new VirtualMachineRestrictMovement();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("restrictMovement".equals(fieldName)) {
deserializedVirtualMachineRestrictMovement.restrictMovement
= VirtualMachineRestrictMovementState.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedVirtualMachineRestrictMovement;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy