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

com.azure.resourcemanager.mediaservices.fluent.models.AssetProperties 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.core.util.CoreUtils;
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.AssetStorageEncryptionFormat;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.UUID;

/**
 * The Asset properties.
 */
@Fluent
public final class AssetProperties implements JsonSerializable {
    /*
     * The Asset ID.
     */
    private UUID assetId;

    /*
     * The creation date of the Asset.
     */
    private OffsetDateTime created;

    /*
     * The last modified date of the Asset.
     */
    private OffsetDateTime lastModified;

    /*
     * The alternate ID of the Asset.
     */
    private String alternateId;

    /*
     * The Asset description.
     */
    private String description;

    /*
     * The name of the asset blob container.
     */
    private String container;

    /*
     * The name of the storage account.
     */
    private String storageAccountName;

    /*
     * The Asset encryption format. One of None or MediaStorageEncryption.
     */
    private AssetStorageEncryptionFormat storageEncryptionFormat;

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

    /**
     * Get the assetId property: The Asset ID.
     * 
     * @return the assetId value.
     */
    public UUID assetId() {
        return this.assetId;
    }

    /**
     * Get the created property: The creation date of the Asset.
     * 
     * @return the created value.
     */
    public OffsetDateTime created() {
        return this.created;
    }

    /**
     * Get the lastModified property: The last modified date of the Asset.
     * 
     * @return the lastModified value.
     */
    public OffsetDateTime lastModified() {
        return this.lastModified;
    }

    /**
     * Get the alternateId property: The alternate ID of the Asset.
     * 
     * @return the alternateId value.
     */
    public String alternateId() {
        return this.alternateId;
    }

    /**
     * Set the alternateId property: The alternate ID of the Asset.
     * 
     * @param alternateId the alternateId value to set.
     * @return the AssetProperties object itself.
     */
    public AssetProperties withAlternateId(String alternateId) {
        this.alternateId = alternateId;
        return this;
    }

    /**
     * Get the description property: The Asset description.
     * 
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: The Asset description.
     * 
     * @param description the description value to set.
     * @return the AssetProperties object itself.
     */
    public AssetProperties withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the container property: The name of the asset blob container.
     * 
     * @return the container value.
     */
    public String container() {
        return this.container;
    }

    /**
     * Set the container property: The name of the asset blob container.
     * 
     * @param container the container value to set.
     * @return the AssetProperties object itself.
     */
    public AssetProperties withContainer(String container) {
        this.container = container;
        return this;
    }

    /**
     * Get the storageAccountName property: The name of the storage account.
     * 
     * @return the storageAccountName value.
     */
    public String storageAccountName() {
        return this.storageAccountName;
    }

    /**
     * Set the storageAccountName property: The name of the storage account.
     * 
     * @param storageAccountName the storageAccountName value to set.
     * @return the AssetProperties object itself.
     */
    public AssetProperties withStorageAccountName(String storageAccountName) {
        this.storageAccountName = storageAccountName;
        return this;
    }

    /**
     * Get the storageEncryptionFormat property: The Asset encryption format. One of None or MediaStorageEncryption.
     * 
     * @return the storageEncryptionFormat value.
     */
    public AssetStorageEncryptionFormat storageEncryptionFormat() {
        return this.storageEncryptionFormat;
    }

    /**
     * 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("alternateId", this.alternateId);
        jsonWriter.writeStringField("description", this.description);
        jsonWriter.writeStringField("container", this.container);
        jsonWriter.writeStringField("storageAccountName", this.storageAccountName);
        return jsonWriter.writeEndObject();
    }

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

                if ("assetId".equals(fieldName)) {
                    deserializedAssetProperties.assetId
                        = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
                } else if ("created".equals(fieldName)) {
                    deserializedAssetProperties.created = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("lastModified".equals(fieldName)) {
                    deserializedAssetProperties.lastModified = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("alternateId".equals(fieldName)) {
                    deserializedAssetProperties.alternateId = reader.getString();
                } else if ("description".equals(fieldName)) {
                    deserializedAssetProperties.description = reader.getString();
                } else if ("container".equals(fieldName)) {
                    deserializedAssetProperties.container = reader.getString();
                } else if ("storageAccountName".equals(fieldName)) {
                    deserializedAssetProperties.storageAccountName = reader.getString();
                } else if ("storageEncryptionFormat".equals(fieldName)) {
                    deserializedAssetProperties.storageEncryptionFormat
                        = AssetStorageEncryptionFormat.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAssetProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy