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

com.azure.resourcemanager.mediaservices.models.EnabledProtocols 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;

/**
 * Class to specify which protocols are enabled.
 */
@Fluent
public final class EnabledProtocols implements JsonSerializable {
    /*
     * Enable Download protocol or not
     */
    private boolean download;

    /*
     * Enable DASH protocol or not
     */
    private boolean dash;

    /*
     * Enable HLS protocol or not
     */
    private boolean hls;

    /*
     * Enable SmoothStreaming protocol or not
     */
    private boolean smoothStreaming;

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

    /**
     * Get the download property: Enable Download protocol or not.
     * 
     * @return the download value.
     */
    public boolean download() {
        return this.download;
    }

    /**
     * Set the download property: Enable Download protocol or not.
     * 
     * @param download the download value to set.
     * @return the EnabledProtocols object itself.
     */
    public EnabledProtocols withDownload(boolean download) {
        this.download = download;
        return this;
    }

    /**
     * Get the dash property: Enable DASH protocol or not.
     * 
     * @return the dash value.
     */
    public boolean dash() {
        return this.dash;
    }

    /**
     * Set the dash property: Enable DASH protocol or not.
     * 
     * @param dash the dash value to set.
     * @return the EnabledProtocols object itself.
     */
    public EnabledProtocols withDash(boolean dash) {
        this.dash = dash;
        return this;
    }

    /**
     * Get the hls property: Enable HLS protocol or not.
     * 
     * @return the hls value.
     */
    public boolean hls() {
        return this.hls;
    }

    /**
     * Set the hls property: Enable HLS protocol or not.
     * 
     * @param hls the hls value to set.
     * @return the EnabledProtocols object itself.
     */
    public EnabledProtocols withHls(boolean hls) {
        this.hls = hls;
        return this;
    }

    /**
     * Get the smoothStreaming property: Enable SmoothStreaming protocol or not.
     * 
     * @return the smoothStreaming value.
     */
    public boolean smoothStreaming() {
        return this.smoothStreaming;
    }

    /**
     * Set the smoothStreaming property: Enable SmoothStreaming protocol or not.
     * 
     * @param smoothStreaming the smoothStreaming value to set.
     * @return the EnabledProtocols object itself.
     */
    public EnabledProtocols withSmoothStreaming(boolean smoothStreaming) {
        this.smoothStreaming = smoothStreaming;
        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.writeBooleanField("download", this.download);
        jsonWriter.writeBooleanField("dash", this.dash);
        jsonWriter.writeBooleanField("hls", this.hls);
        jsonWriter.writeBooleanField("smoothStreaming", this.smoothStreaming);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of EnabledProtocols from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of EnabledProtocols if the JsonReader was pointing to an instance of it, or null if it was
     * pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the EnabledProtocols.
     */
    public static EnabledProtocols fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            EnabledProtocols deserializedEnabledProtocols = new EnabledProtocols();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("download".equals(fieldName)) {
                    deserializedEnabledProtocols.download = reader.getBoolean();
                } else if ("dash".equals(fieldName)) {
                    deserializedEnabledProtocols.dash = reader.getBoolean();
                } else if ("hls".equals(fieldName)) {
                    deserializedEnabledProtocols.hls = reader.getBoolean();
                } else if ("smoothStreaming".equals(fieldName)) {
                    deserializedEnabledProtocols.smoothStreaming = reader.getBoolean();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedEnabledProtocols;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy