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

com.azure.resourcemanager.hybridcompute.models.ProductFeatureUpdate 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-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.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;

/**
 * Product Feature.
 */
@Fluent
public final class ProductFeatureUpdate implements JsonSerializable {
    /*
     * Product feature name.
     */
    private String name;

    /*
     * Indicates the new status of the product feature.
     */
    private LicenseProfileSubscriptionStatusUpdate subscriptionStatus;

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

    /**
     * Get the name property: Product feature name.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Product feature name.
     * 
     * @param name the name value to set.
     * @return the ProductFeatureUpdate object itself.
     */
    public ProductFeatureUpdate withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the subscriptionStatus property: Indicates the new status of the product feature.
     * 
     * @return the subscriptionStatus value.
     */
    public LicenseProfileSubscriptionStatusUpdate subscriptionStatus() {
        return this.subscriptionStatus;
    }

    /**
     * Set the subscriptionStatus property: Indicates the new status of the product feature.
     * 
     * @param subscriptionStatus the subscriptionStatus value to set.
     * @return the ProductFeatureUpdate object itself.
     */
    public ProductFeatureUpdate withSubscriptionStatus(LicenseProfileSubscriptionStatusUpdate subscriptionStatus) {
        this.subscriptionStatus = subscriptionStatus;
        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("name", this.name);
        jsonWriter.writeStringField("subscriptionStatus",
            this.subscriptionStatus == null ? null : this.subscriptionStatus.toString());
        return jsonWriter.writeEndObject();
    }

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

                if ("name".equals(fieldName)) {
                    deserializedProductFeatureUpdate.name = reader.getString();
                } else if ("subscriptionStatus".equals(fieldName)) {
                    deserializedProductFeatureUpdate.subscriptionStatus
                        = LicenseProfileSubscriptionStatusUpdate.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedProductFeatureUpdate;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy