All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.hybridcompute.models.ExtensionTargetProperties Maven / Gradle / Ivy

Go to download

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-05.

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.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 the Machine Extension Target Version Properties.
 */
@Fluent
public final class ExtensionTargetProperties implements JsonSerializable {
    /*
     * Properties for the specified Extension to Upgrade.
     */
    private String targetVersion;

    /**
     * Creates an instance of ExtensionTargetProperties class.
     */
    public ExtensionTargetProperties() {
    }

    /**
     * Get the targetVersion property: Properties for the specified Extension to Upgrade.
     * 
     * @return the targetVersion value.
     */
    public String targetVersion() {
        return this.targetVersion;
    }

    /**
     * Set the targetVersion property: Properties for the specified Extension to Upgrade.
     * 
     * @param targetVersion the targetVersion value to set.
     * @return the ExtensionTargetProperties object itself.
     */
    public ExtensionTargetProperties withTargetVersion(String targetVersion) {
        this.targetVersion = targetVersion;
        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("targetVersion", this.targetVersion);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of ExtensionTargetProperties from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of ExtensionTargetProperties 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 ExtensionTargetProperties.
     */
    public static ExtensionTargetProperties fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            ExtensionTargetProperties deserializedExtensionTargetProperties = new ExtensionTargetProperties();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("targetVersion".equals(fieldName)) {
                    deserializedExtensionTargetProperties.targetVersion = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedExtensionTargetProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy