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

com.azure.resourcemanager.mediaservices.models.Layer 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 encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by specifying a
 * layer for each desired resolution. A layer represents the properties for the video or image at a resolution.
 */
@Fluent
public class Layer implements JsonSerializable {
    /*
     * The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage).
     * For example 50% means the output video has half as many pixels in width as the input.
     */
    private String width;

    /*
     * The height of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage).
     * For example 50% means the output video has half as many pixels in height as the input.
     */
    private String height;

    /*
     * The alphanumeric label for this layer, which can be used in multiplexing different video and audio layers, or in
     * naming the output file.
     */
    private String label;

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

    /**
     * Get the width property: The width of the output video for this layer. The value can be absolute (in pixels) or
     * relative (in percentage). For example 50% means the output video has half as many pixels in width as the input.
     * 
     * @return the width value.
     */
    public String width() {
        return this.width;
    }

    /**
     * Set the width property: The width of the output video for this layer. The value can be absolute (in pixels) or
     * relative (in percentage). For example 50% means the output video has half as many pixels in width as the input.
     * 
     * @param width the width value to set.
     * @return the Layer object itself.
     */
    public Layer withWidth(String width) {
        this.width = width;
        return this;
    }

    /**
     * Get the height property: The height of the output video for this layer. The value can be absolute (in pixels) or
     * relative (in percentage). For example 50% means the output video has half as many pixels in height as the input.
     * 
     * @return the height value.
     */
    public String height() {
        return this.height;
    }

    /**
     * Set the height property: The height of the output video for this layer. The value can be absolute (in pixels) or
     * relative (in percentage). For example 50% means the output video has half as many pixels in height as the input.
     * 
     * @param height the height value to set.
     * @return the Layer object itself.
     */
    public Layer withHeight(String height) {
        this.height = height;
        return this;
    }

    /**
     * Get the label property: The alphanumeric label for this layer, which can be used in multiplexing different video
     * and audio layers, or in naming the output file.
     * 
     * @return the label value.
     */
    public String label() {
        return this.label;
    }

    /**
     * Set the label property: The alphanumeric label for this layer, which can be used in multiplexing different video
     * and audio layers, or in naming the output file.
     * 
     * @param label the label value to set.
     * @return the Layer object itself.
     */
    public Layer withLabel(String label) {
        this.label = label;
        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("width", this.width);
        jsonWriter.writeStringField("height", this.height);
        jsonWriter.writeStringField("label", this.label);
        return jsonWriter.writeEndObject();
    }

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

                if ("width".equals(fieldName)) {
                    deserializedLayer.width = reader.getString();
                } else if ("height".equals(fieldName)) {
                    deserializedLayer.height = reader.getString();
                } else if ("label".equals(fieldName)) {
                    deserializedLayer.label = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedLayer;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy