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

com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceProperties 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.AccountEncryption;
import com.azure.resourcemanager.mediaservices.models.KeyDelivery;
import com.azure.resourcemanager.mediaservices.models.MinimumTlsVersion;
import com.azure.resourcemanager.mediaservices.models.ProvisioningState;
import com.azure.resourcemanager.mediaservices.models.PublicNetworkAccess;
import com.azure.resourcemanager.mediaservices.models.StorageAccount;
import com.azure.resourcemanager.mediaservices.models.StorageAuthentication;
import java.io.IOException;
import java.util.List;
import java.util.UUID;

/**
 * Properties of the Media Services account.
 */
@Fluent
public final class MediaServiceProperties implements JsonSerializable {
    /*
     * The Media Services account ID.
     */
    private UUID mediaServiceId;

    /*
     * The storage accounts for this resource.
     */
    private List storageAccounts;

    /*
     * The storageAuthentication property.
     */
    private StorageAuthentication storageAuthentication;

    /*
     * The account encryption properties.
     */
    private AccountEncryption encryption;

    /*
     * The Key Delivery properties for Media Services account.
     */
    private KeyDelivery keyDelivery;

    /*
     * Whether or not public network access is allowed for resources under the Media Services account.
     */
    private PublicNetworkAccess publicNetworkAccess;

    /*
     * Provisioning state of the Media Services account.
     */
    private ProvisioningState provisioningState;

    /*
     * The Private Endpoint Connections created for the Media Service account.
     */
    private List privateEndpointConnections;

    /*
     * The minimum TLS version allowed for this account's requests. This is an optional property. If unspecified, a
     * secure default value will be used.
     */
    private MinimumTlsVersion minimumTlsVersion;

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

    /**
     * Get the mediaServiceId property: The Media Services account ID.
     * 
     * @return the mediaServiceId value.
     */
    public UUID mediaServiceId() {
        return this.mediaServiceId;
    }

    /**
     * Get the storageAccounts property: The storage accounts for this resource.
     * 
     * @return the storageAccounts value.
     */
    public List storageAccounts() {
        return this.storageAccounts;
    }

    /**
     * Set the storageAccounts property: The storage accounts for this resource.
     * 
     * @param storageAccounts the storageAccounts value to set.
     * @return the MediaServiceProperties object itself.
     */
    public MediaServiceProperties withStorageAccounts(List storageAccounts) {
        this.storageAccounts = storageAccounts;
        return this;
    }

    /**
     * Get the storageAuthentication property: The storageAuthentication property.
     * 
     * @return the storageAuthentication value.
     */
    public StorageAuthentication storageAuthentication() {
        return this.storageAuthentication;
    }

    /**
     * Set the storageAuthentication property: The storageAuthentication property.
     * 
     * @param storageAuthentication the storageAuthentication value to set.
     * @return the MediaServiceProperties object itself.
     */
    public MediaServiceProperties withStorageAuthentication(StorageAuthentication storageAuthentication) {
        this.storageAuthentication = storageAuthentication;
        return this;
    }

    /**
     * Get the encryption property: The account encryption properties.
     * 
     * @return the encryption value.
     */
    public AccountEncryption encryption() {
        return this.encryption;
    }

    /**
     * Set the encryption property: The account encryption properties.
     * 
     * @param encryption the encryption value to set.
     * @return the MediaServiceProperties object itself.
     */
    public MediaServiceProperties withEncryption(AccountEncryption encryption) {
        this.encryption = encryption;
        return this;
    }

    /**
     * Get the keyDelivery property: The Key Delivery properties for Media Services account.
     * 
     * @return the keyDelivery value.
     */
    public KeyDelivery keyDelivery() {
        return this.keyDelivery;
    }

    /**
     * Set the keyDelivery property: The Key Delivery properties for Media Services account.
     * 
     * @param keyDelivery the keyDelivery value to set.
     * @return the MediaServiceProperties object itself.
     */
    public MediaServiceProperties withKeyDelivery(KeyDelivery keyDelivery) {
        this.keyDelivery = keyDelivery;
        return this;
    }

    /**
     * Get the publicNetworkAccess property: Whether or not public network access is allowed for resources under the
     * Media Services account.
     * 
     * @return the publicNetworkAccess value.
     */
    public PublicNetworkAccess publicNetworkAccess() {
        return this.publicNetworkAccess;
    }

    /**
     * Set the publicNetworkAccess property: Whether or not public network access is allowed for resources under the
     * Media Services account.
     * 
     * @param publicNetworkAccess the publicNetworkAccess value to set.
     * @return the MediaServiceProperties object itself.
     */
    public MediaServiceProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
        this.publicNetworkAccess = publicNetworkAccess;
        return this;
    }

    /**
     * Get the provisioningState property: Provisioning state of the Media Services account.
     * 
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the privateEndpointConnections property: The Private Endpoint Connections created for the Media Service
     * account.
     * 
     * @return the privateEndpointConnections value.
     */
    public List privateEndpointConnections() {
        return this.privateEndpointConnections;
    }

    /**
     * Get the minimumTlsVersion property: The minimum TLS version allowed for this account's requests. This is an
     * optional property. If unspecified, a secure default value will be used.
     * 
     * @return the minimumTlsVersion value.
     */
    public MinimumTlsVersion minimumTlsVersion() {
        return this.minimumTlsVersion;
    }

    /**
     * Set the minimumTlsVersion property: The minimum TLS version allowed for this account's requests. This is an
     * optional property. If unspecified, a secure default value will be used.
     * 
     * @param minimumTlsVersion the minimumTlsVersion value to set.
     * @return the MediaServiceProperties object itself.
     */
    public MediaServiceProperties withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) {
        this.minimumTlsVersion = minimumTlsVersion;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeArrayField("storageAccounts", this.storageAccounts,
            (writer, element) -> writer.writeJson(element));
        jsonWriter.writeStringField("storageAuthentication",
            this.storageAuthentication == null ? null : this.storageAuthentication.toString());
        jsonWriter.writeJsonField("encryption", this.encryption);
        jsonWriter.writeJsonField("keyDelivery", this.keyDelivery);
        jsonWriter.writeStringField("publicNetworkAccess",
            this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString());
        jsonWriter.writeStringField("minimumTlsVersion",
            this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString());
        return jsonWriter.writeEndObject();
    }

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

                if ("mediaServiceId".equals(fieldName)) {
                    deserializedMediaServiceProperties.mediaServiceId
                        = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
                } else if ("storageAccounts".equals(fieldName)) {
                    List storageAccounts
                        = reader.readArray(reader1 -> StorageAccount.fromJson(reader1));
                    deserializedMediaServiceProperties.storageAccounts = storageAccounts;
                } else if ("storageAuthentication".equals(fieldName)) {
                    deserializedMediaServiceProperties.storageAuthentication
                        = StorageAuthentication.fromString(reader.getString());
                } else if ("encryption".equals(fieldName)) {
                    deserializedMediaServiceProperties.encryption = AccountEncryption.fromJson(reader);
                } else if ("keyDelivery".equals(fieldName)) {
                    deserializedMediaServiceProperties.keyDelivery = KeyDelivery.fromJson(reader);
                } else if ("publicNetworkAccess".equals(fieldName)) {
                    deserializedMediaServiceProperties.publicNetworkAccess
                        = PublicNetworkAccess.fromString(reader.getString());
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedMediaServiceProperties.provisioningState
                        = ProvisioningState.fromString(reader.getString());
                } else if ("privateEndpointConnections".equals(fieldName)) {
                    List privateEndpointConnections
                        = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1));
                    deserializedMediaServiceProperties.privateEndpointConnections = privateEndpointConnections;
                } else if ("minimumTlsVersion".equals(fieldName)) {
                    deserializedMediaServiceProperties.minimumTlsVersion
                        = MinimumTlsVersion.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMediaServiceProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy