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

com.azure.resourcemanager.mediaservices.models.ArmStreamingEndpointCurrentSku Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-account-2023-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.mediaservices.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;

/**
 * The streaming endpoint current sku.
 */
@Fluent
public final class ArmStreamingEndpointCurrentSku implements JsonSerializable {
    /*
     * The streaming endpoint sku name.
     */
    private String name;

    /*
     * The streaming endpoint sku capacity.
     */
    private Integer capacity;

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

    /**
     * Get the name property: The streaming endpoint sku name.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the capacity property: The streaming endpoint sku capacity.
     * 
     * @return the capacity value.
     */
    public Integer capacity() {
        return this.capacity;
    }

    /**
     * Set the capacity property: The streaming endpoint sku capacity.
     * 
     * @param capacity the capacity value to set.
     * @return the ArmStreamingEndpointCurrentSku object itself.
     */
    public ArmStreamingEndpointCurrentSku withCapacity(Integer capacity) {
        this.capacity = capacity;
        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.writeNumberField("capacity", this.capacity);
        return jsonWriter.writeEndObject();
    }

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

                if ("name".equals(fieldName)) {
                    deserializedArmStreamingEndpointCurrentSku.name = reader.getString();
                } else if ("capacity".equals(fieldName)) {
                    deserializedArmStreamingEndpointCurrentSku.capacity = reader.getNullable(JsonReader::getInt);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedArmStreamingEndpointCurrentSku;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy