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

com.azure.resourcemanager.mediaservices.fluent.models.ListPathsResponseInner 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.fluent.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 com.azure.resourcemanager.mediaservices.models.StreamingPath;
import java.io.IOException;
import java.util.List;

/**
 * Class of response for listPaths action.
 */
@Fluent
public final class ListPathsResponseInner implements JsonSerializable {
    /*
     * Streaming Paths supported by current Streaming Locator
     */
    private List streamingPaths;

    /*
     * Download Paths supported by current Streaming Locator
     */
    private List downloadPaths;

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

    /**
     * Get the streamingPaths property: Streaming Paths supported by current Streaming Locator.
     * 
     * @return the streamingPaths value.
     */
    public List streamingPaths() {
        return this.streamingPaths;
    }

    /**
     * Set the streamingPaths property: Streaming Paths supported by current Streaming Locator.
     * 
     * @param streamingPaths the streamingPaths value to set.
     * @return the ListPathsResponseInner object itself.
     */
    public ListPathsResponseInner withStreamingPaths(List streamingPaths) {
        this.streamingPaths = streamingPaths;
        return this;
    }

    /**
     * Get the downloadPaths property: Download Paths supported by current Streaming Locator.
     * 
     * @return the downloadPaths value.
     */
    public List downloadPaths() {
        return this.downloadPaths;
    }

    /**
     * Set the downloadPaths property: Download Paths supported by current Streaming Locator.
     * 
     * @param downloadPaths the downloadPaths value to set.
     * @return the ListPathsResponseInner object itself.
     */
    public ListPathsResponseInner withDownloadPaths(List downloadPaths) {
        this.downloadPaths = downloadPaths;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (streamingPaths() != null) {
            streamingPaths().forEach(e -> e.validate());
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeArrayField("streamingPaths", this.streamingPaths,
            (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("downloadPaths", this.downloadPaths,
            (writer, element) -> writer.writeString(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("streamingPaths".equals(fieldName)) {
                    List streamingPaths = reader.readArray(reader1 -> StreamingPath.fromJson(reader1));
                    deserializedListPathsResponseInner.streamingPaths = streamingPaths;
                } else if ("downloadPaths".equals(fieldName)) {
                    List downloadPaths = reader.readArray(reader1 -> reader1.getString());
                    deserializedListPathsResponseInner.downloadPaths = downloadPaths;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedListPathsResponseInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy