diff --git a/mediaservices/resource-manager/v2018_07_01/pom.xml b/mediaservices/resource-manager/v2018_07_01/pom.xml new file mode 100644 index 000000000000..830d2d74cb0b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.mediaservices.v2018_07_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-media + 1.0.0-beta + jar + Microsoft Azure SDK for Media Management + This package contains Microsoft Media Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudio.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudio.java new file mode 100644 index 000000000000..a49a3e4b0578 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudio.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes Advanced Audio Codec (AAC) audio encoding settings. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.AacAudio") +public class AacAudio extends Audio { + /** + * The encoding profile to be used when encoding audio with AAC. Possible + * values include: 'AacLc', 'HeAacV1', 'HeAacV2'. + */ + @JsonProperty(value = "profile") + private AacAudioProfile profile; + + /** + * Get the encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2'. + * + * @return the profile value + */ + public AacAudioProfile profile() { + return this.profile; + } + + /** + * Set the encoding profile to be used when encoding audio with AAC. Possible values include: 'AacLc', 'HeAacV1', 'HeAacV2'. + * + * @param profile the profile value to set + * @return the AacAudio object itself. + */ + public AacAudio withProfile(AacAudioProfile profile) { + this.profile = profile; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudioProfile.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudioProfile.java new file mode 100644 index 000000000000..f83145b882e0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AacAudioProfile.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AacAudioProfile. + */ +public enum AacAudioProfile { + /** Specifies that the output audio is to be encoded into AAC Low Complexity profile (AAC-LC). */ + AAC_LC("AacLc"), + + /** Specifies that the output audio is to be encoded into HE-AAC v1 profile. */ + HE_AAC_V1("HeAacV1"), + + /** Specifies that the output audio is to be encoded into HE-AAC v2 profile. */ + HE_AAC_V2("HeAacV2"); + + /** The actual serialized value for a AacAudioProfile instance. */ + private String value; + + AacAudioProfile(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AacAudioProfile instance. + * + * @param value the serialized value to parse. + * @return the parsed AacAudioProfile object, or null if unable to parse. + */ + @JsonCreator + public static AacAudioProfile fromString(String value) { + AacAudioProfile[] items = AacAudioProfile.values(); + for (AacAudioProfile item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilter.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilter.java new file mode 100644 index 000000000000..620d45458701 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilter.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AccountFilterInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.List; + +/** + * Type representing AccountFilter. + */ +public interface AccountFilter extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the firstQuality value. + */ + FirstQuality firstQuality(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the presentationTimeRange value. + */ + PresentationTimeRange presentationTimeRange(); + + /** + * @return the tracks value. + */ + List tracks(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the AccountFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { + } + + /** + * Grouping of AccountFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AccountFilter definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the accountfilter definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the accountfilter definition allowing to specify FirstQuality. + */ + interface WithFirstQuality { + /** + * Specifies firstQuality. + */ + WithCreate withFirstQuality(FirstQuality firstQuality); + } + + /** + * The stage of the accountfilter definition allowing to specify PresentationTimeRange. + */ + interface WithPresentationTimeRange { + /** + * Specifies presentationTimeRange. + */ + WithCreate withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + + /** + * The stage of the accountfilter definition allowing to specify Tracks. + */ + interface WithTracks { + /** + * Specifies tracks. + */ + WithCreate withTracks(List tracks); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithFirstQuality, DefinitionStages.WithPresentationTimeRange, DefinitionStages.WithTracks { + } + } + /** + * The template for a AccountFilter update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithFirstQuality, UpdateStages.WithPresentationTimeRange, UpdateStages.WithTracks { + } + + /** + * Grouping of AccountFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the accountfilter update allowing to specify FirstQuality. + */ + interface WithFirstQuality { + /** + * Specifies firstQuality. + */ + Update withFirstQuality(FirstQuality firstQuality); + } + + /** + * The stage of the accountfilter update allowing to specify PresentationTimeRange. + */ + interface WithPresentationTimeRange { + /** + * Specifies presentationTimeRange. + */ + Update withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + + /** + * The stage of the accountfilter update allowing to specify Tracks. + */ + interface WithTracks { + /** + * Specifies tracks. + */ + Update withTracks(List tracks); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilters.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilters.java new file mode 100644 index 000000000000..6b93c63646c2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AccountFilters.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AccountFiltersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AccountFilters. + */ +public interface AccountFilters extends SupportsCreating, HasInner { + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String filterName); + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String filterName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiAccessControl.java new file mode 100644 index 000000000000..b7e7ed230de5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiAccessControl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Akamai access control. + */ +public class AkamaiAccessControl { + /** + * authentication key list. + */ + @JsonProperty(value = "akamaiSignatureHeaderAuthenticationKeyList") + private List akamaiSignatureHeaderAuthenticationKeyList; + + /** + * Get authentication key list. + * + * @return the akamaiSignatureHeaderAuthenticationKeyList value + */ + public List akamaiSignatureHeaderAuthenticationKeyList() { + return this.akamaiSignatureHeaderAuthenticationKeyList; + } + + /** + * Set authentication key list. + * + * @param akamaiSignatureHeaderAuthenticationKeyList the akamaiSignatureHeaderAuthenticationKeyList value to set + * @return the AkamaiAccessControl object itself. + */ + public AkamaiAccessControl withAkamaiSignatureHeaderAuthenticationKeyList(List akamaiSignatureHeaderAuthenticationKeyList) { + this.akamaiSignatureHeaderAuthenticationKeyList = akamaiSignatureHeaderAuthenticationKeyList; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiSignatureHeaderAuthenticationKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiSignatureHeaderAuthenticationKey.java new file mode 100644 index 000000000000..9e290c776d11 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AkamaiSignatureHeaderAuthenticationKey.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Akamai Signature Header authentication key. + */ +public class AkamaiSignatureHeaderAuthenticationKey { + /** + * identifier of the key. + */ + @JsonProperty(value = "identifier") + private String identifier; + + /** + * authentication key. + */ + @JsonProperty(value = "base64Key") + private String base64Key; + + /** + * The expiration time of the authentication key. + */ + @JsonProperty(value = "expiration") + private DateTime expiration; + + /** + * Get identifier of the key. + * + * @return the identifier value + */ + public String identifier() { + return this.identifier; + } + + /** + * Set identifier of the key. + * + * @param identifier the identifier value to set + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get authentication key. + * + * @return the base64Key value + */ + public String base64Key() { + return this.base64Key; + } + + /** + * Set authentication key. + * + * @param base64Key the base64Key value to set + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withBase64Key(String base64Key) { + this.base64Key = base64Key; + return this; + } + + /** + * Get the expiration time of the authentication key. + * + * @return the expiration value + */ + public DateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration time of the authentication key. + * + * @param expiration the expiration value to set + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withExpiration(DateTime expiration) { + this.expiration = expiration; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiError.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiError.java new file mode 100644 index 000000000000..f86736836d38 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiError.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The API error. + */ +public class ApiError { + /** + * ApiError. + * The error properties. + */ + @JsonProperty(value = "error") + private ODataError error; + + /** + * Get the error properties. + * + * @return the error value + */ + public ODataError error() { + return this.error; + } + + /** + * Set the error properties. + * + * @param error the error value to set + * @return the ApiError object itself. + */ + public ApiError withError(ODataError error) { + this.error = error; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiErrorException.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiErrorException.java new file mode 100644 index 000000000000..115ee7ebb7ba --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ApiErrorException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ApiError information. + */ +public class ApiErrorException extends RestException { + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ApiErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ApiErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ApiErrorException(final String message, final Response response, final ApiError body) { + super(message, response, body); + } + + @Override + public ApiError body() { + return (ApiError) super.body(); + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Asset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Asset.java new file mode 100644 index 000000000000..670815660e81 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Asset.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.UUID; +import org.joda.time.DateTime; + +/** + * Type representing Asset. + */ +public interface Asset extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the alternateId value. + */ + String alternateId(); + + /** + * @return the assetId value. + */ + UUID assetId(); + + /** + * @return the container value. + */ + String container(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the storageAccountName value. + */ + String storageAccountName(); + + /** + * @return the storageEncryptionFormat value. + */ + AssetStorageEncryptionFormat storageEncryptionFormat(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Asset definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { + } + + /** + * Grouping of Asset definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Asset definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the asset definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the asset definition allowing to specify AlternateId. + */ + interface WithAlternateId { + /** + * Specifies alternateId. + */ + WithCreate withAlternateId(String alternateId); + } + + /** + * The stage of the asset definition allowing to specify Container. + */ + interface WithContainer { + /** + * Specifies container. + */ + WithCreate withContainer(String container); + } + + /** + * The stage of the asset definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the asset definition allowing to specify StorageAccountName. + */ + interface WithStorageAccountName { + /** + * Specifies storageAccountName. + */ + WithCreate withStorageAccountName(String storageAccountName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAlternateId, DefinitionStages.WithContainer, DefinitionStages.WithDescription, DefinitionStages.WithStorageAccountName { + } + } + /** + * The template for a Asset update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAlternateId, UpdateStages.WithContainer, UpdateStages.WithDescription, UpdateStages.WithStorageAccountName { + } + + /** + * Grouping of Asset update stages. + */ + interface UpdateStages { + /** + * The stage of the asset update allowing to specify AlternateId. + */ + interface WithAlternateId { + /** + * Specifies alternateId. + */ + Update withAlternateId(String alternateId); + } + + /** + * The stage of the asset update allowing to specify Container. + */ + interface WithContainer { + /** + * Specifies container. + */ + Update withContainer(String container); + } + + /** + * The stage of the asset update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + Update withDescription(String description); + } + + /** + * The stage of the asset update allowing to specify StorageAccountName. + */ + interface WithStorageAccountName { + /** + * Specifies storageAccountName. + */ + Update withStorageAccountName(String storageAccountName); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerPermission.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerPermission.java new file mode 100644 index 000000000000..eb64cdf793c8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerPermission.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AssetContainerPermission. + */ +public enum AssetContainerPermission { + /** The SAS URL will allow read access to the container. */ + READ("Read"), + + /** The SAS URL will allow read and write access to the container. */ + READ_WRITE("ReadWrite"), + + /** The SAS URL will allow read, write and delete access to the container. */ + READ_WRITE_DELETE("ReadWriteDelete"); + + /** The actual serialized value for a AssetContainerPermission instance. */ + private String value; + + AssetContainerPermission(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AssetContainerPermission instance. + * + * @param value the serialized value to parse. + * @return the parsed AssetContainerPermission object, or null if unable to parse. + */ + @JsonCreator + public static AssetContainerPermission fromString(String value) { + AssetContainerPermission[] items = AssetContainerPermission.values(); + for (AssetContainerPermission item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerSas.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerSas.java new file mode 100644 index 000000000000..420b002bca00 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetContainerSas.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetContainerSasInner; +import java.util.List; + +/** + * Type representing AssetContainerSas. + */ +public interface AssetContainerSas extends HasInner, HasManager { + /** + * @return the assetContainerSasUrls value. + */ + List assetContainerSasUrls(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFileEncryptionMetadata.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFileEncryptionMetadata.java new file mode 100644 index 000000000000..de9f56429b93 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFileEncryptionMetadata.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Asset File Storage encryption metadata. + */ +public class AssetFileEncryptionMetadata { + /** + * The Asset File initialization vector. + */ + @JsonProperty(value = "initializationVector") + private String initializationVector; + + /** + * The Asset File name. + */ + @JsonProperty(value = "assetFileName") + private String assetFileName; + + /** + * The Asset File Id. + */ + @JsonProperty(value = "assetFileId", required = true) + private UUID assetFileId; + + /** + * Get the Asset File initialization vector. + * + * @return the initializationVector value + */ + public String initializationVector() { + return this.initializationVector; + } + + /** + * Set the Asset File initialization vector. + * + * @param initializationVector the initializationVector value to set + * @return the AssetFileEncryptionMetadata object itself. + */ + public AssetFileEncryptionMetadata withInitializationVector(String initializationVector) { + this.initializationVector = initializationVector; + return this; + } + + /** + * Get the Asset File name. + * + * @return the assetFileName value + */ + public String assetFileName() { + return this.assetFileName; + } + + /** + * Set the Asset File name. + * + * @param assetFileName the assetFileName value to set + * @return the AssetFileEncryptionMetadata object itself. + */ + public AssetFileEncryptionMetadata withAssetFileName(String assetFileName) { + this.assetFileName = assetFileName; + return this; + } + + /** + * Get the Asset File Id. + * + * @return the assetFileId value + */ + public UUID assetFileId() { + return this.assetFileId; + } + + /** + * Set the Asset File Id. + * + * @param assetFileId the assetFileId value to set + * @return the AssetFileEncryptionMetadata object itself. + */ + public AssetFileEncryptionMetadata withAssetFileId(UUID assetFileId) { + this.assetFileId = assetFileId; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilter.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilter.java new file mode 100644 index 000000000000..c814d900208a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilter.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetFilterInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.List; + +/** + * Type representing AssetFilter. + */ +public interface AssetFilter extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the firstQuality value. + */ + FirstQuality firstQuality(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the presentationTimeRange value. + */ + PresentationTimeRange presentationTimeRange(); + + /** + * @return the tracks value. + */ + List tracks(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the AssetFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithAsset, DefinitionStages.WithCreate { + } + + /** + * Grouping of AssetFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AssetFilter definition. + */ + interface Blank extends WithAsset { + } + + /** + * The stage of the assetfilter definition allowing to specify Asset. + */ + interface WithAsset { + /** + * Specifies resourceGroupName, accountName, assetName. + */ + WithCreate withExistingAsset(String resourceGroupName, String accountName, String assetName); + } + + /** + * The stage of the assetfilter definition allowing to specify FirstQuality. + */ + interface WithFirstQuality { + /** + * Specifies firstQuality. + */ + WithCreate withFirstQuality(FirstQuality firstQuality); + } + + /** + * The stage of the assetfilter definition allowing to specify PresentationTimeRange. + */ + interface WithPresentationTimeRange { + /** + * Specifies presentationTimeRange. + */ + WithCreate withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + + /** + * The stage of the assetfilter definition allowing to specify Tracks. + */ + interface WithTracks { + /** + * Specifies tracks. + */ + WithCreate withTracks(List tracks); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithFirstQuality, DefinitionStages.WithPresentationTimeRange, DefinitionStages.WithTracks { + } + } + /** + * The template for a AssetFilter update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithFirstQuality, UpdateStages.WithPresentationTimeRange, UpdateStages.WithTracks { + } + + /** + * Grouping of AssetFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the assetfilter update allowing to specify FirstQuality. + */ + interface WithFirstQuality { + /** + * Specifies firstQuality. + */ + Update withFirstQuality(FirstQuality firstQuality); + } + + /** + * The stage of the assetfilter update allowing to specify PresentationTimeRange. + */ + interface WithPresentationTimeRange { + /** + * Specifies presentationTimeRange. + */ + Update withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + + /** + * The stage of the assetfilter update allowing to specify Tracks. + */ + interface WithTracks { + /** + * Specifies tracks. + */ + Update withTracks(List tracks); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilters.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilters.java new file mode 100644 index 000000000000..76ce8661bf86 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetFilters.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetFiltersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AssetFilters. + */ +public interface AssetFilters extends SupportsCreating, HasInner { + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String assetName, String filterName); + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName, final String assetName); + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String assetName, String filterName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStorageEncryptionFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStorageEncryptionFormat.java new file mode 100644 index 000000000000..2dee5fc05ab1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStorageEncryptionFormat.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AssetStorageEncryptionFormat. + */ +public enum AssetStorageEncryptionFormat { + /** The Asset does not use client-side storage encryption (this is the only allowed value for new Assets). */ + NONE("None"), + + /** The Asset is encrypted with Media Services client-side encryption. */ + MEDIA_STORAGE_CLIENT_ENCRYPTION("MediaStorageClientEncryption"); + + /** The actual serialized value for a AssetStorageEncryptionFormat instance. */ + private String value; + + AssetStorageEncryptionFormat(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AssetStorageEncryptionFormat instance. + * + * @param value the serialized value to parse. + * @return the parsed AssetStorageEncryptionFormat object, or null if unable to parse. + */ + @JsonCreator + public static AssetStorageEncryptionFormat fromString(String value) { + AssetStorageEncryptionFormat[] items = AssetStorageEncryptionFormat.values(); + for (AssetStorageEncryptionFormat item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStreamingLocator.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStreamingLocator.java new file mode 100644 index 000000000000..58774074213b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AssetStreamingLocator.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.DateTime; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the Streaming Locator. + */ +public class AssetStreamingLocator { + /** + * Streaming Locator name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Asset Name. + */ + @JsonProperty(value = "assetName", access = JsonProperty.Access.WRITE_ONLY) + private String assetName; + + /** + * The creation time of the Streaming Locator. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The start time of the Streaming Locator. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * The end time of the Streaming Locator. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * StreamingLocatorId of the Streaming Locator. + */ + @JsonProperty(value = "streamingLocatorId", access = JsonProperty.Access.WRITE_ONLY) + private UUID streamingLocatorId; + + /** + * Name of the Streaming Policy used by this Streaming Locator. + */ + @JsonProperty(value = "streamingPolicyName", access = JsonProperty.Access.WRITE_ONLY) + private String streamingPolicyName; + + /** + * Name of the default ContentKeyPolicy used by this Streaming Locator. + */ + @JsonProperty(value = "defaultContentKeyPolicyName", access = JsonProperty.Access.WRITE_ONLY) + private String defaultContentKeyPolicyName; + + /** + * Get streaming Locator name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get asset Name. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Get the creation time of the Streaming Locator. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the start time of the Streaming Locator. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get the end time of the Streaming Locator. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Get streamingLocatorId of the Streaming Locator. + * + * @return the streamingLocatorId value + */ + public UUID streamingLocatorId() { + return this.streamingLocatorId; + } + + /** + * Get name of the Streaming Policy used by this Streaming Locator. + * + * @return the streamingPolicyName value + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Get name of the default ContentKeyPolicy used by this Streaming Locator. + * + * @return the defaultContentKeyPolicyName value + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Assets.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Assets.java new file mode 100644 index 000000000000..a8765f4244cd --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Assets.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.AssetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Assets. + */ +public interface Assets extends SupportsCreating, HasInner { + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters); + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName); + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listStreamingLocatorsAsync(String resourceGroupName, String accountName, String assetName); + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String assetName); + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String assetName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Audio.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Audio.java new file mode 100644 index 000000000000..6def69e0c709 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Audio.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines the common properties for all audio codecs. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Audio") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AacAudio", value = AacAudio.class) +}) +public class Audio extends Codec { + /** + * The number of channels in the audio. + */ + @JsonProperty(value = "channels") + private Integer channels; + + /** + * The sampling rate to use for encoding in hertz. + */ + @JsonProperty(value = "samplingRate") + private Integer samplingRate; + + /** + * The bitrate, in bits per second, of the output encoded audio. + */ + @JsonProperty(value = "bitrate") + private Integer bitrate; + + /** + * Get the number of channels in the audio. + * + * @return the channels value + */ + public Integer channels() { + return this.channels; + } + + /** + * Set the number of channels in the audio. + * + * @param channels the channels value to set + * @return the Audio object itself. + */ + public Audio withChannels(Integer channels) { + this.channels = channels; + return this; + } + + /** + * Get the sampling rate to use for encoding in hertz. + * + * @return the samplingRate value + */ + public Integer samplingRate() { + return this.samplingRate; + } + + /** + * Set the sampling rate to use for encoding in hertz. + * + * @param samplingRate the samplingRate value to set + * @return the Audio object itself. + */ + public Audio withSamplingRate(Integer samplingRate) { + this.samplingRate = samplingRate; + return this; + } + + /** + * Get the bitrate, in bits per second, of the output encoded audio. + * + * @return the bitrate value + */ + public Integer bitrate() { + return this.bitrate; + } + + /** + * Set the bitrate, in bits per second, of the output encoded audio. + * + * @param bitrate the bitrate value to set + * @return the Audio object itself. + */ + public Audio withBitrate(Integer bitrate) { + this.bitrate = bitrate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioAnalyzerPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioAnalyzerPreset.java new file mode 100644 index 000000000000..c1da8da065d3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioAnalyzerPreset.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The Audio Analyzer preset applies a pre-defined set of AI-based analysis + * operations, including speech transcription. Currently, the preset supports + * processing of content with a single audio track. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.AudioAnalyzerPreset") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoAnalyzerPreset", value = VideoAnalyzerPreset.class) +}) +public class AudioAnalyzerPreset extends Preset { + /** + * The language for the audio payload in the input using the BCP-47 format + * of 'language tag-region' (e.g: 'en-US'). The list of supported languages + * are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', + * 'pt-BR', 'zh-CN', 'de-DE', 'ar-EG', 'ru-RU', 'hi-IN'. If not specified, + * automatic language detection would be employed. This feature currently + * supports English, Chinese, French, German, Italian, Japanese, Spanish, + * Russian, and Portuguese. The automatic detection works best with audio + * recordings with clearly discernable speech. If automatic detection fails + * to find the language, transcription would fallback to English. + */ + @JsonProperty(value = "audioLanguage") + private String audioLanguage; + + /** + * Get the language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN', 'de-DE', 'ar-EG', 'ru-RU', 'hi-IN'. If not specified, automatic language detection would be employed. This feature currently supports English, Chinese, French, German, Italian, Japanese, Spanish, Russian, and Portuguese. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to English. + * + * @return the audioLanguage value + */ + public String audioLanguage() { + return this.audioLanguage; + } + + /** + * Set the language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are, 'en-US', 'en-GB', 'es-ES', 'es-MX', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR', 'zh-CN', 'de-DE', 'ar-EG', 'ru-RU', 'hi-IN'. If not specified, automatic language detection would be employed. This feature currently supports English, Chinese, French, German, Italian, Japanese, Spanish, Russian, and Portuguese. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to English. + * + * @param audioLanguage the audioLanguage value to set + * @return the AudioAnalyzerPreset object itself. + */ + public AudioAnalyzerPreset withAudioLanguage(String audioLanguage) { + this.audioLanguage = audioLanguage; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioOverlay.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioOverlay.java new file mode 100644 index 000000000000..a886804ec19f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/AudioOverlay.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties of an audio overlay. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.AudioOverlay") +public class AudioOverlay extends Overlay { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/BuiltInStandardEncoderPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/BuiltInStandardEncoderPreset.java new file mode 100644 index 000000000000..7d77ef5c547f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/BuiltInStandardEncoderPreset.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a built-in preset for encoding the input video with the Standard + * Encoder. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.BuiltInStandardEncoderPreset") +public class BuiltInStandardEncoderPreset extends Preset { + /** + * The built-in preset to be used for encoding videos. Possible values + * include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', + * 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', + * 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', + * 'H264MultipleBitrateSD'. + */ + @JsonProperty(value = "presetName", required = true) + private EncoderNamedPreset presetName; + + /** + * Get the built-in preset to be used for encoding videos. Possible values include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD'. + * + * @return the presetName value + */ + public EncoderNamedPreset presetName() { + return this.presetName; + } + + /** + * Set the built-in preset to be used for encoding videos. Possible values include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD'. + * + * @param presetName the presetName value to set + * @return the BuiltInStandardEncoderPreset object itself. + */ + public BuiltInStandardEncoderPreset withPresetName(EncoderNamedPreset presetName) { + this.presetName = presetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CbcsDrmConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CbcsDrmConfiguration.java new file mode 100644 index 000000000000..4cad4b31f9fa --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CbcsDrmConfiguration.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify DRM configurations of CommonEncryptionCbcs scheme in + * Streaming Policy. + */ +public class CbcsDrmConfiguration { + /** + * FairPlay configurations. + */ + @JsonProperty(value = "fairPlay") + private StreamingPolicyFairPlayConfiguration fairPlay; + + /** + * PlayReady configurations. + */ + @JsonProperty(value = "playReady") + private StreamingPolicyPlayReadyConfiguration playReady; + + /** + * Widevine configurations. + */ + @JsonProperty(value = "widevine") + private StreamingPolicyWidevineConfiguration widevine; + + /** + * Get fairPlay configurations. + * + * @return the fairPlay value + */ + public StreamingPolicyFairPlayConfiguration fairPlay() { + return this.fairPlay; + } + + /** + * Set fairPlay configurations. + * + * @param fairPlay the fairPlay value to set + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withFairPlay(StreamingPolicyFairPlayConfiguration fairPlay) { + this.fairPlay = fairPlay; + return this; + } + + /** + * Get playReady configurations. + * + * @return the playReady value + */ + public StreamingPolicyPlayReadyConfiguration playReady() { + return this.playReady; + } + + /** + * Set playReady configurations. + * + * @param playReady the playReady value to set + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withPlayReady(StreamingPolicyPlayReadyConfiguration playReady) { + this.playReady = playReady; + return this; + } + + /** + * Get widevine configurations. + * + * @return the widevine value + */ + public StreamingPolicyWidevineConfiguration widevine() { + return this.widevine; + } + + /** + * Set widevine configurations. + * + * @param widevine the widevine value to set + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { + this.widevine = widevine; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CencDrmConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CencDrmConfiguration.java new file mode 100644 index 000000000000..d2f4c6d1aa34 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CencDrmConfiguration.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify DRM configurations of CommonEncryptionCenc scheme in + * Streaming Policy. + */ +public class CencDrmConfiguration { + /** + * PlayReady configurations. + */ + @JsonProperty(value = "playReady") + private StreamingPolicyPlayReadyConfiguration playReady; + + /** + * Widevine configurations. + */ + @JsonProperty(value = "widevine") + private StreamingPolicyWidevineConfiguration widevine; + + /** + * Get playReady configurations. + * + * @return the playReady value + */ + public StreamingPolicyPlayReadyConfiguration playReady() { + return this.playReady; + } + + /** + * Set playReady configurations. + * + * @param playReady the playReady value to set + * @return the CencDrmConfiguration object itself. + */ + public CencDrmConfiguration withPlayReady(StreamingPolicyPlayReadyConfiguration playReady) { + this.playReady = playReady; + return this; + } + + /** + * Get widevine configurations. + * + * @return the widevine value + */ + public StreamingPolicyWidevineConfiguration widevine() { + return this.widevine; + } + + /** + * Set widevine configurations. + * + * @param widevine the widevine value to set + * @return the CencDrmConfiguration object itself. + */ + public CencDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { + this.widevine = widevine; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CheckNameAvailabilityInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CheckNameAvailabilityInput.java new file mode 100644 index 000000000000..bfff683363fa --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CheckNameAvailabilityInput.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The input to the check name availability request. + */ +public class CheckNameAvailabilityInput { + /** + * The account name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The account type. For a Media Services account, this should be + * 'MediaServices'. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the account name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the account name. + * + * @param name the name value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the account type. For a Media Services account, this should be 'MediaServices'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the account type. For a Media Services account, this should be 'MediaServices'. + * + * @param type the type value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withType(String type) { + this.type = type; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Codec.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Codec.java new file mode 100644 index 000000000000..6d0ae5d293c5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Codec.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the basic properties of all codecs. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Codec") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Audio", value = Audio.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.CopyVideo", value = CopyVideo.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.Video", value = Video.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.CopyAudio", value = CopyAudio.class) +}) +public class Codec { + /** + * An optional label for the codec. The label can be used to control muxing + * behavior. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get an optional label for the codec. The label can be used to control muxing behavior. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set an optional label for the codec. The label can be used to control muxing behavior. + * + * @param label the label value to set + * @return the Codec object itself. + */ + public Codec withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCbcs.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCbcs.java new file mode 100644 index 000000000000..20f55a8b3fb2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCbcs.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for CommonEncryptionCbcs encryption scheme. + */ +public class CommonEncryptionCbcs { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Representing which tracks should not be encrypted. + */ + @JsonProperty(value = "clearTracks") + private List clearTracks; + + /** + * Representing default content key for each encryption scheme and separate + * content keys for specific tracks. + */ + @JsonProperty(value = "contentKeys") + private StreamingPolicyContentKeys contentKeys; + + /** + * Configuration of DRMs for current encryption scheme. + */ + @JsonProperty(value = "drm") + private CbcsDrmConfiguration drm; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get representing which tracks should not be encrypted. + * + * @return the clearTracks value + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set representing which tracks should not be encrypted. + * + * @param clearTracks the clearTracks value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withClearTracks(List clearTracks) { + this.clearTracks = clearTracks; + return this; + } + + /** + * Get representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @return the contentKeys value + */ + public StreamingPolicyContentKeys contentKeys() { + return this.contentKeys; + } + + /** + * Set representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @param contentKeys the contentKeys value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withContentKeys(StreamingPolicyContentKeys contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get configuration of DRMs for current encryption scheme. + * + * @return the drm value + */ + public CbcsDrmConfiguration drm() { + return this.drm; + } + + /** + * Set configuration of DRMs for current encryption scheme. + * + * @param drm the drm value to set + * @return the CommonEncryptionCbcs object itself. + */ + public CommonEncryptionCbcs withDrm(CbcsDrmConfiguration drm) { + this.drm = drm; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCenc.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCenc.java new file mode 100644 index 000000000000..95720f3a56b3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CommonEncryptionCenc.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for envelope encryption scheme. + */ +public class CommonEncryptionCenc { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Representing which tracks should not be encrypted. + */ + @JsonProperty(value = "clearTracks") + private List clearTracks; + + /** + * Representing default content key for each encryption scheme and separate + * content keys for specific tracks. + */ + @JsonProperty(value = "contentKeys") + private StreamingPolicyContentKeys contentKeys; + + /** + * Configuration of DRMs for CommonEncryptionCenc encryption scheme. + */ + @JsonProperty(value = "drm") + private CencDrmConfiguration drm; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get representing which tracks should not be encrypted. + * + * @return the clearTracks value + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set representing which tracks should not be encrypted. + * + * @param clearTracks the clearTracks value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withClearTracks(List clearTracks) { + this.clearTracks = clearTracks; + return this; + } + + /** + * Get representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @return the contentKeys value + */ + public StreamingPolicyContentKeys contentKeys() { + return this.contentKeys; + } + + /** + * Set representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @param contentKeys the contentKeys value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withContentKeys(StreamingPolicyContentKeys contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get configuration of DRMs for CommonEncryptionCenc encryption scheme. + * + * @return the drm value + */ + public CencDrmConfiguration drm() { + return this.drm; + } + + /** + * Set configuration of DRMs for CommonEncryptionCenc encryption scheme. + * + * @param drm the drm value to set + * @return the CommonEncryptionCenc object itself. + */ + public CommonEncryptionCenc withDrm(CencDrmConfiguration drm) { + this.drm = drm; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicies.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicies.java new file mode 100644 index 000000000000..abf2c7686b39 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicies.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ContentKeyPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContentKeyPolicies. + */ +public interface ContentKeyPolicies extends SupportsCreating, HasInner { + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicy.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicy.java new file mode 100644 index 000000000000..4192f980d71e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicy.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ContentKeyPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing ContentKeyPolicy. + */ +public interface ContentKeyPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the options value. + */ + List options(); + + /** + * @return the policyId value. + */ + UUID policyId(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ContentKeyPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithOptions, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContentKeyPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContentKeyPolicy definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the contentkeypolicy definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + */ + WithOptions withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the contentkeypolicy definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + */ + WithCreate withOptions(List options); + } + + /** + * The stage of the contentkeypolicy definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription { + } + } + /** + * The template for a ContentKeyPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription { + } + + /** + * Grouping of ContentKeyPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the contentkeypolicy update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + Update withDescription(String description); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyClearKeyConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyClearKeyConfiguration.java new file mode 100644 index 000000000000..fc9d9ea468b7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyClearKeyConfiguration.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a configuration for non-DRM keys. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration") +public class ContentKeyPolicyClearKeyConfiguration extends ContentKeyPolicyConfiguration { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyConfiguration.java new file mode 100644 index 000000000000..609588af127a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyConfiguration.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for Content Key Policy configuration. A derived class must be + * used to create a configuration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration", value = ContentKeyPolicyClearKeyConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration", value = ContentKeyPolicyUnknownConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration", value = ContentKeyPolicyWidevineConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration", value = ContentKeyPolicyPlayReadyConfiguration.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration", value = ContentKeyPolicyFairPlayConfiguration.class) +}) +public class ContentKeyPolicyConfiguration { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayConfiguration.java new file mode 100644 index 000000000000..2a15d7b724ed --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayConfiguration.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a configuration for FairPlay licenses. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration") +public class ContentKeyPolicyFairPlayConfiguration extends ContentKeyPolicyConfiguration { + /** + * The key that must be used as FairPlay Application Secret key. + */ + @JsonProperty(value = "ask", required = true) + private byte[] ask; + + /** + * The password encrypting FairPlay certificate in PKCS 12 (pfx) format. + */ + @JsonProperty(value = "fairPlayPfxPassword", required = true) + private String fairPlayPfxPassword; + + /** + * The Base64 representation of FairPlay certificate in PKCS 12 (pfx) + * format (including private key). + */ + @JsonProperty(value = "fairPlayPfx", required = true) + private String fairPlayPfx; + + /** + * The rental and lease key type. Possible values include: 'Unknown', + * 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. + */ + @JsonProperty(value = "rentalAndLeaseKeyType", required = true) + private ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType; + + /** + * The rental duration. Must be greater than or equal to 0. + */ + @JsonProperty(value = "rentalDuration", required = true) + private long rentalDuration; + + /** + * Get the key that must be used as FairPlay Application Secret key. + * + * @return the ask value + */ + public byte[] ask() { + return this.ask; + } + + /** + * Set the key that must be used as FairPlay Application Secret key. + * + * @param ask the ask value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withAsk(byte[] ask) { + this.ask = ask; + return this; + } + + /** + * Get the password encrypting FairPlay certificate in PKCS 12 (pfx) format. + * + * @return the fairPlayPfxPassword value + */ + public String fairPlayPfxPassword() { + return this.fairPlayPfxPassword; + } + + /** + * Set the password encrypting FairPlay certificate in PKCS 12 (pfx) format. + * + * @param fairPlayPfxPassword the fairPlayPfxPassword value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withFairPlayPfxPassword(String fairPlayPfxPassword) { + this.fairPlayPfxPassword = fairPlayPfxPassword; + return this; + } + + /** + * Get the Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). + * + * @return the fairPlayPfx value + */ + public String fairPlayPfx() { + return this.fairPlayPfx; + } + + /** + * Set the Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). + * + * @param fairPlayPfx the fairPlayPfx value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withFairPlayPfx(String fairPlayPfx) { + this.fairPlayPfx = fairPlayPfx; + return this; + } + + /** + * Get the rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. + * + * @return the rentalAndLeaseKeyType value + */ + public ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType() { + return this.rentalAndLeaseKeyType; + } + + /** + * Set the rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited'. + * + * @param rentalAndLeaseKeyType the rentalAndLeaseKeyType value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withRentalAndLeaseKeyType(ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType) { + this.rentalAndLeaseKeyType = rentalAndLeaseKeyType; + return this; + } + + /** + * Get the rental duration. Must be greater than or equal to 0. + * + * @return the rentalDuration value + */ + public long rentalDuration() { + return this.rentalDuration; + } + + /** + * Set the rental duration. Must be greater than or equal to 0. + * + * @param rentalDuration the rentalDuration value to set + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withRentalDuration(long rentalDuration) { + this.rentalDuration = rentalDuration; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java new file mode 100644 index 000000000000..51a342ae0afc --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. + */ +public enum ContentKeyPolicyFairPlayRentalAndLeaseKeyType { + /** Represents a ContentKeyPolicyFairPlayRentalAndLeaseKeyType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Key duration is not specified. */ + UNDEFINED("Undefined"), + + /** Content key can be persisted with an unlimited duration. */ + PERSISTENT_UNLIMITED("PersistentUnlimited"), + + /** Content key can be persisted and the valid duration is limited by the Rental Duration value. */ + PERSISTENT_LIMITED("PersistentLimited"); + + /** The actual serialized value for a ContentKeyPolicyFairPlayRentalAndLeaseKeyType instance. */ + private String value; + + ContentKeyPolicyFairPlayRentalAndLeaseKeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyFairPlayRentalAndLeaseKeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyFairPlayRentalAndLeaseKeyType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyFairPlayRentalAndLeaseKeyType fromString(String value) { + ContentKeyPolicyFairPlayRentalAndLeaseKeyType[] items = ContentKeyPolicyFairPlayRentalAndLeaseKeyType.values(); + for (ContentKeyPolicyFairPlayRentalAndLeaseKeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOpenRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOpenRestriction.java new file mode 100644 index 000000000000..44620732dc5d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOpenRestriction.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an open restriction. License or key will be delivered on every + * request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyOpenRestriction") +public class ContentKeyPolicyOpenRestriction extends ContentKeyPolicyRestriction { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOption.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOption.java new file mode 100644 index 000000000000..58d8fba5a07e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyOption.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a policy option. + */ +public class ContentKeyPolicyOption { + /** + * The legacy Policy Option ID. + */ + @JsonProperty(value = "policyOptionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID policyOptionId; + + /** + * The Policy Option description. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The key delivery configuration. + */ + @JsonProperty(value = "configuration", required = true) + private ContentKeyPolicyConfiguration configuration; + + /** + * The requirements that must be met to deliver keys with this + * configuration. + */ + @JsonProperty(value = "restriction", required = true) + private ContentKeyPolicyRestriction restriction; + + /** + * Get the legacy Policy Option ID. + * + * @return the policyOptionId value + */ + public UUID policyOptionId() { + return this.policyOptionId; + } + + /** + * Get the Policy Option description. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the Policy Option description. + * + * @param name the name value to set + * @return the ContentKeyPolicyOption object itself. + */ + public ContentKeyPolicyOption withName(String name) { + this.name = name; + return this; + } + + /** + * Get the key delivery configuration. + * + * @return the configuration value + */ + public ContentKeyPolicyConfiguration configuration() { + return this.configuration; + } + + /** + * Set the key delivery configuration. + * + * @param configuration the configuration value to set + * @return the ContentKeyPolicyOption object itself. + */ + public ContentKeyPolicyOption withConfiguration(ContentKeyPolicyConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the requirements that must be met to deliver keys with this configuration. + * + * @return the restriction value + */ + public ContentKeyPolicyRestriction restriction() { + return this.restriction; + } + + /** + * Set the requirements that must be met to deliver keys with this configuration. + * + * @param restriction the restriction value to set + * @return the ContentKeyPolicyOption object itself. + */ + public ContentKeyPolicyOption withRestriction(ContentKeyPolicyRestriction restriction) { + this.restriction = restriction; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyConfiguration.java new file mode 100644 index 000000000000..c312fe329700 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyConfiguration.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a configuration for PlayReady licenses. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration") +public class ContentKeyPolicyPlayReadyConfiguration extends ContentKeyPolicyConfiguration { + /** + * The PlayReady licenses. + */ + @JsonProperty(value = "licenses", required = true) + private List licenses; + + /** + * The custom response data. + */ + @JsonProperty(value = "responseCustomData") + private String responseCustomData; + + /** + * Get the PlayReady licenses. + * + * @return the licenses value + */ + public List licenses() { + return this.licenses; + } + + /** + * Set the PlayReady licenses. + * + * @param licenses the licenses value to set + * @return the ContentKeyPolicyPlayReadyConfiguration object itself. + */ + public ContentKeyPolicyPlayReadyConfiguration withLicenses(List licenses) { + this.licenses = licenses; + return this; + } + + /** + * Get the custom response data. + * + * @return the responseCustomData value + */ + public String responseCustomData() { + return this.responseCustomData; + } + + /** + * Set the custom response data. + * + * @param responseCustomData the responseCustomData value to set + * @return the ContentKeyPolicyPlayReadyConfiguration object itself. + */ + public ContentKeyPolicyPlayReadyConfiguration withResponseCustomData(String responseCustomData) { + this.responseCustomData = responseCustomData; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java new file mode 100644 index 000000000000..674a7245b830 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies that the content key ID is in the PlayReady header. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader") +public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader extends ContentKeyPolicyPlayReadyContentKeyLocation { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java new file mode 100644 index 000000000000..0f3e6f638e16 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies that the content key ID is specified in the PlayReady + * configuration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier") +public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier extends ContentKeyPolicyPlayReadyContentKeyLocation { + /** + * The content key ID. + */ + @JsonProperty(value = "keyId", required = true) + private UUID keyId; + + /** + * Get the content key ID. + * + * @return the keyId value + */ + public UUID keyId() { + return this.keyId; + } + + /** + * Set the content key ID. + * + * @param keyId the keyId value to set + * @return the ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier object itself. + */ + public ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier withKeyId(UUID keyId) { + this.keyId = keyId; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentKeyLocation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentKeyLocation.java new file mode 100644 index 000000000000..04bb5d8e89c6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentKeyLocation.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for content key ID location. A derived class must be used to + * represent the location. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyPlayReadyContentKeyLocation") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader", value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier", value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.class) +}) +public class ContentKeyPolicyPlayReadyContentKeyLocation { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentType.java new file mode 100644 index 000000000000..fc40894ab01b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyContentType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyPlayReadyContentType. + */ +public enum ContentKeyPolicyPlayReadyContentType { + /** Represents a ContentKeyPolicyPlayReadyContentType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Unspecified content type. */ + UNSPECIFIED("Unspecified"), + + /** Ultraviolet download content type. */ + ULTRA_VIOLET_DOWNLOAD("UltraVioletDownload"), + + /** Ultraviolet streaming content type. */ + ULTRA_VIOLET_STREAMING("UltraVioletStreaming"); + + /** The actual serialized value for a ContentKeyPolicyPlayReadyContentType instance. */ + private String value; + + ContentKeyPolicyPlayReadyContentType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyPlayReadyContentType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyPlayReadyContentType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyContentType fromString(String value) { + ContentKeyPolicyPlayReadyContentType[] items = ContentKeyPolicyPlayReadyContentType.values(); + for (ContentKeyPolicyPlayReadyContentType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java new file mode 100644 index 000000000000..ba1b7e978c7d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configures the Explicit Analog Television Output Restriction control bits. + * For further details see the PlayReady Compliance Rules. + */ +public class ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { + /** + * Indicates whether this restriction is enforced on a Best Effort basis. + */ + @JsonProperty(value = "bestEffort", required = true) + private boolean bestEffort; + + /** + * Configures the restriction control bits. Must be between 0 and 3 + * inclusive. + */ + @JsonProperty(value = "configurationData", required = true) + private int configurationData; + + /** + * Get indicates whether this restriction is enforced on a Best Effort basis. + * + * @return the bestEffort value + */ + public boolean bestEffort() { + return this.bestEffort; + } + + /** + * Set indicates whether this restriction is enforced on a Best Effort basis. + * + * @param bestEffort the bestEffort value to set + * @return the ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction object itself. + */ + public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction withBestEffort(boolean bestEffort) { + this.bestEffort = bestEffort; + return this; + } + + /** + * Get configures the restriction control bits. Must be between 0 and 3 inclusive. + * + * @return the configurationData value + */ + public int configurationData() { + return this.configurationData; + } + + /** + * Set configures the restriction control bits. Must be between 0 and 3 inclusive. + * + * @param configurationData the configurationData value to set + * @return the ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction object itself. + */ + public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction withConfigurationData(int configurationData) { + this.configurationData = configurationData; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicense.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicense.java new file mode 100644 index 000000000000..6b00b103d08e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicense.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.DateTime; +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PlayReady license. + */ +public class ContentKeyPolicyPlayReadyLicense { + /** + * A flag indicating whether test devices can use the license. + */ + @JsonProperty(value = "allowTestDevices", required = true) + private boolean allowTestDevices; + + /** + * The begin date of license. + */ + @JsonProperty(value = "beginDate") + private DateTime beginDate; + + /** + * The expiration date of license. + */ + @JsonProperty(value = "expirationDate") + private DateTime expirationDate; + + /** + * The relative begin date of license. + */ + @JsonProperty(value = "relativeBeginDate") + private Period relativeBeginDate; + + /** + * The relative expiration date of license. + */ + @JsonProperty(value = "relativeExpirationDate") + private Period relativeExpirationDate; + + /** + * The grace period of license. + */ + @JsonProperty(value = "gracePeriod") + private Period gracePeriod; + + /** + * The license PlayRight. + */ + @JsonProperty(value = "playRight") + private ContentKeyPolicyPlayReadyPlayRight playRight; + + /** + * The license type. Possible values include: 'Unknown', 'NonPersistent', + * 'Persistent'. + */ + @JsonProperty(value = "licenseType", required = true) + private ContentKeyPolicyPlayReadyLicenseType licenseType; + + /** + * The content key location. + */ + @JsonProperty(value = "contentKeyLocation", required = true) + private ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation; + + /** + * The PlayReady content type. Possible values include: 'Unknown', + * 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. + */ + @JsonProperty(value = "contentType", required = true) + private ContentKeyPolicyPlayReadyContentType contentType; + + /** + * Get a flag indicating whether test devices can use the license. + * + * @return the allowTestDevices value + */ + public boolean allowTestDevices() { + return this.allowTestDevices; + } + + /** + * Set a flag indicating whether test devices can use the license. + * + * @param allowTestDevices the allowTestDevices value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withAllowTestDevices(boolean allowTestDevices) { + this.allowTestDevices = allowTestDevices; + return this; + } + + /** + * Get the begin date of license. + * + * @return the beginDate value + */ + public DateTime beginDate() { + return this.beginDate; + } + + /** + * Set the begin date of license. + * + * @param beginDate the beginDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withBeginDate(DateTime beginDate) { + this.beginDate = beginDate; + return this; + } + + /** + * Get the expiration date of license. + * + * @return the expirationDate value + */ + public DateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expiration date of license. + * + * @param expirationDate the expirationDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withExpirationDate(DateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the relative begin date of license. + * + * @return the relativeBeginDate value + */ + public Period relativeBeginDate() { + return this.relativeBeginDate; + } + + /** + * Set the relative begin date of license. + * + * @param relativeBeginDate the relativeBeginDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withRelativeBeginDate(Period relativeBeginDate) { + this.relativeBeginDate = relativeBeginDate; + return this; + } + + /** + * Get the relative expiration date of license. + * + * @return the relativeExpirationDate value + */ + public Period relativeExpirationDate() { + return this.relativeExpirationDate; + } + + /** + * Set the relative expiration date of license. + * + * @param relativeExpirationDate the relativeExpirationDate value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withRelativeExpirationDate(Period relativeExpirationDate) { + this.relativeExpirationDate = relativeExpirationDate; + return this; + } + + /** + * Get the grace period of license. + * + * @return the gracePeriod value + */ + public Period gracePeriod() { + return this.gracePeriod; + } + + /** + * Set the grace period of license. + * + * @param gracePeriod the gracePeriod value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withGracePeriod(Period gracePeriod) { + this.gracePeriod = gracePeriod; + return this; + } + + /** + * Get the license PlayRight. + * + * @return the playRight value + */ + public ContentKeyPolicyPlayReadyPlayRight playRight() { + return this.playRight; + } + + /** + * Set the license PlayRight. + * + * @param playRight the playRight value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withPlayRight(ContentKeyPolicyPlayReadyPlayRight playRight) { + this.playRight = playRight; + return this; + } + + /** + * Get the license type. Possible values include: 'Unknown', 'NonPersistent', 'Persistent'. + * + * @return the licenseType value + */ + public ContentKeyPolicyPlayReadyLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the license type. Possible values include: 'Unknown', 'NonPersistent', 'Persistent'. + * + * @param licenseType the licenseType value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withLicenseType(ContentKeyPolicyPlayReadyLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the content key location. + * + * @return the contentKeyLocation value + */ + public ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation() { + return this.contentKeyLocation; + } + + /** + * Set the content key location. + * + * @param contentKeyLocation the contentKeyLocation value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withContentKeyLocation(ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation) { + this.contentKeyLocation = contentKeyLocation; + return this; + } + + /** + * Get the PlayReady content type. Possible values include: 'Unknown', 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. + * + * @return the contentType value + */ + public ContentKeyPolicyPlayReadyContentType contentType() { + return this.contentType; + } + + /** + * Set the PlayReady content type. Possible values include: 'Unknown', 'Unspecified', 'UltraVioletDownload', 'UltraVioletStreaming'. + * + * @param contentType the contentType value to set + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withContentType(ContentKeyPolicyPlayReadyContentType contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicenseType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicenseType.java new file mode 100644 index 000000000000..d781d03b75f1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyLicenseType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyPlayReadyLicenseType. + */ +public enum ContentKeyPolicyPlayReadyLicenseType { + /** Represents a ContentKeyPolicyPlayReadyLicenseType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Non persistent license. */ + NON_PERSISTENT("NonPersistent"), + + /** Persistent license. Allows offline playback. */ + PERSISTENT("Persistent"); + + /** The actual serialized value for a ContentKeyPolicyPlayReadyLicenseType instance. */ + private String value; + + ContentKeyPolicyPlayReadyLicenseType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyPlayReadyLicenseType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyPlayReadyLicenseType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyLicenseType fromString(String value) { + ContentKeyPolicyPlayReadyLicenseType[] items = ContentKeyPolicyPlayReadyLicenseType.values(); + for (ContentKeyPolicyPlayReadyLicenseType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyPlayRight.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyPlayRight.java new file mode 100644 index 000000000000..748f989bcc67 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyPlayRight.java @@ -0,0 +1,365 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configures the Play Right in the PlayReady license. + */ +public class ContentKeyPolicyPlayReadyPlayRight { + /** + * The amount of time that the license is valid after the license is first + * used to play content. + */ + @JsonProperty(value = "firstPlayExpiration") + private Period firstPlayExpiration; + + /** + * Configures the Serial Copy Management System (SCMS) in the license. Must + * be between 0 and 3 inclusive. + */ + @JsonProperty(value = "scmsRestriction") + private Integer scmsRestriction; + + /** + * Configures Automatic Gain Control (AGC) and Color Stripe in the license. + * Must be between 0 and 3 inclusive. + */ + @JsonProperty(value = "agcAndColorStripeRestriction") + private Integer agcAndColorStripeRestriction; + + /** + * Configures the Explicit Analog Television Output Restriction in the + * license. Configuration data must be between 0 and 3 inclusive. + */ + @JsonProperty(value = "explicitAnalogTelevisionOutputRestriction") + private ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction; + + /** + * Enables the Image Constraint For Analog Component Video Restriction in + * the license. + */ + @JsonProperty(value = "digitalVideoOnlyContentRestriction", required = true) + private boolean digitalVideoOnlyContentRestriction; + + /** + * Enables the Image Constraint For Analog Component Video Restriction in + * the license. + */ + @JsonProperty(value = "imageConstraintForAnalogComponentVideoRestriction", required = true) + private boolean imageConstraintForAnalogComponentVideoRestriction; + + /** + * Enables the Image Constraint For Analog Component Video Restriction in + * the license. + */ + @JsonProperty(value = "imageConstraintForAnalogComputerMonitorRestriction", required = true) + private boolean imageConstraintForAnalogComputerMonitorRestriction; + + /** + * Configures Unknown output handling settings of the license. Possible + * values include: 'Unknown', 'NotAllowed', 'Allowed', + * 'AllowedWithVideoConstriction'. + */ + @JsonProperty(value = "allowPassingVideoContentToUnknownOutput", required = true) + private ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput; + + /** + * Specifies the output protection level for uncompressed digital video. + */ + @JsonProperty(value = "uncompressedDigitalVideoOpl") + private Integer uncompressedDigitalVideoOpl; + + /** + * Specifies the output protection level for compressed digital video. + */ + @JsonProperty(value = "compressedDigitalVideoOpl") + private Integer compressedDigitalVideoOpl; + + /** + * Specifies the output protection level for compressed digital audio. + */ + @JsonProperty(value = "analogVideoOpl") + private Integer analogVideoOpl; + + /** + * Specifies the output protection level for compressed digital audio. + */ + @JsonProperty(value = "compressedDigitalAudioOpl") + private Integer compressedDigitalAudioOpl; + + /** + * Specifies the output protection level for uncompressed digital audio. + */ + @JsonProperty(value = "uncompressedDigitalAudioOpl") + private Integer uncompressedDigitalAudioOpl; + + /** + * Get the amount of time that the license is valid after the license is first used to play content. + * + * @return the firstPlayExpiration value + */ + public Period firstPlayExpiration() { + return this.firstPlayExpiration; + } + + /** + * Set the amount of time that the license is valid after the license is first used to play content. + * + * @param firstPlayExpiration the firstPlayExpiration value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withFirstPlayExpiration(Period firstPlayExpiration) { + this.firstPlayExpiration = firstPlayExpiration; + return this; + } + + /** + * Get configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. + * + * @return the scmsRestriction value + */ + public Integer scmsRestriction() { + return this.scmsRestriction; + } + + /** + * Set configures the Serial Copy Management System (SCMS) in the license. Must be between 0 and 3 inclusive. + * + * @param scmsRestriction the scmsRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withScmsRestriction(Integer scmsRestriction) { + this.scmsRestriction = scmsRestriction; + return this; + } + + /** + * Get configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. + * + * @return the agcAndColorStripeRestriction value + */ + public Integer agcAndColorStripeRestriction() { + return this.agcAndColorStripeRestriction; + } + + /** + * Set configures Automatic Gain Control (AGC) and Color Stripe in the license. Must be between 0 and 3 inclusive. + * + * @param agcAndColorStripeRestriction the agcAndColorStripeRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAgcAndColorStripeRestriction(Integer agcAndColorStripeRestriction) { + this.agcAndColorStripeRestriction = agcAndColorStripeRestriction; + return this; + } + + /** + * Get configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. + * + * @return the explicitAnalogTelevisionOutputRestriction value + */ + public ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction() { + return this.explicitAnalogTelevisionOutputRestriction; + } + + /** + * Set configures the Explicit Analog Television Output Restriction in the license. Configuration data must be between 0 and 3 inclusive. + * + * @param explicitAnalogTelevisionOutputRestriction the explicitAnalogTelevisionOutputRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withExplicitAnalogTelevisionOutputRestriction(ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction explicitAnalogTelevisionOutputRestriction) { + this.explicitAnalogTelevisionOutputRestriction = explicitAnalogTelevisionOutputRestriction; + return this; + } + + /** + * Get enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @return the digitalVideoOnlyContentRestriction value + */ + public boolean digitalVideoOnlyContentRestriction() { + return this.digitalVideoOnlyContentRestriction; + } + + /** + * Set enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @param digitalVideoOnlyContentRestriction the digitalVideoOnlyContentRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withDigitalVideoOnlyContentRestriction(boolean digitalVideoOnlyContentRestriction) { + this.digitalVideoOnlyContentRestriction = digitalVideoOnlyContentRestriction; + return this; + } + + /** + * Get enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @return the imageConstraintForAnalogComponentVideoRestriction value + */ + public boolean imageConstraintForAnalogComponentVideoRestriction() { + return this.imageConstraintForAnalogComponentVideoRestriction; + } + + /** + * Set enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @param imageConstraintForAnalogComponentVideoRestriction the imageConstraintForAnalogComponentVideoRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withImageConstraintForAnalogComponentVideoRestriction(boolean imageConstraintForAnalogComponentVideoRestriction) { + this.imageConstraintForAnalogComponentVideoRestriction = imageConstraintForAnalogComponentVideoRestriction; + return this; + } + + /** + * Get enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @return the imageConstraintForAnalogComputerMonitorRestriction value + */ + public boolean imageConstraintForAnalogComputerMonitorRestriction() { + return this.imageConstraintForAnalogComputerMonitorRestriction; + } + + /** + * Set enables the Image Constraint For Analog Component Video Restriction in the license. + * + * @param imageConstraintForAnalogComputerMonitorRestriction the imageConstraintForAnalogComputerMonitorRestriction value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withImageConstraintForAnalogComputerMonitorRestriction(boolean imageConstraintForAnalogComputerMonitorRestriction) { + this.imageConstraintForAnalogComputerMonitorRestriction = imageConstraintForAnalogComputerMonitorRestriction; + return this; + } + + /** + * Get configures Unknown output handling settings of the license. Possible values include: 'Unknown', 'NotAllowed', 'Allowed', 'AllowedWithVideoConstriction'. + * + * @return the allowPassingVideoContentToUnknownOutput value + */ + public ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput() { + return this.allowPassingVideoContentToUnknownOutput; + } + + /** + * Set configures Unknown output handling settings of the license. Possible values include: 'Unknown', 'NotAllowed', 'Allowed', 'AllowedWithVideoConstriction'. + * + * @param allowPassingVideoContentToUnknownOutput the allowPassingVideoContentToUnknownOutput value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAllowPassingVideoContentToUnknownOutput(ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput) { + this.allowPassingVideoContentToUnknownOutput = allowPassingVideoContentToUnknownOutput; + return this; + } + + /** + * Get specifies the output protection level for uncompressed digital video. + * + * @return the uncompressedDigitalVideoOpl value + */ + public Integer uncompressedDigitalVideoOpl() { + return this.uncompressedDigitalVideoOpl; + } + + /** + * Set specifies the output protection level for uncompressed digital video. + * + * @param uncompressedDigitalVideoOpl the uncompressedDigitalVideoOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withUncompressedDigitalVideoOpl(Integer uncompressedDigitalVideoOpl) { + this.uncompressedDigitalVideoOpl = uncompressedDigitalVideoOpl; + return this; + } + + /** + * Get specifies the output protection level for compressed digital video. + * + * @return the compressedDigitalVideoOpl value + */ + public Integer compressedDigitalVideoOpl() { + return this.compressedDigitalVideoOpl; + } + + /** + * Set specifies the output protection level for compressed digital video. + * + * @param compressedDigitalVideoOpl the compressedDigitalVideoOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withCompressedDigitalVideoOpl(Integer compressedDigitalVideoOpl) { + this.compressedDigitalVideoOpl = compressedDigitalVideoOpl; + return this; + } + + /** + * Get specifies the output protection level for compressed digital audio. + * + * @return the analogVideoOpl value + */ + public Integer analogVideoOpl() { + return this.analogVideoOpl; + } + + /** + * Set specifies the output protection level for compressed digital audio. + * + * @param analogVideoOpl the analogVideoOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAnalogVideoOpl(Integer analogVideoOpl) { + this.analogVideoOpl = analogVideoOpl; + return this; + } + + /** + * Get specifies the output protection level for compressed digital audio. + * + * @return the compressedDigitalAudioOpl value + */ + public Integer compressedDigitalAudioOpl() { + return this.compressedDigitalAudioOpl; + } + + /** + * Set specifies the output protection level for compressed digital audio. + * + * @param compressedDigitalAudioOpl the compressedDigitalAudioOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withCompressedDigitalAudioOpl(Integer compressedDigitalAudioOpl) { + this.compressedDigitalAudioOpl = compressedDigitalAudioOpl; + return this; + } + + /** + * Get specifies the output protection level for uncompressed digital audio. + * + * @return the uncompressedDigitalAudioOpl value + */ + public Integer uncompressedDigitalAudioOpl() { + return this.uncompressedDigitalAudioOpl; + } + + /** + * Set specifies the output protection level for uncompressed digital audio. + * + * @param uncompressedDigitalAudioOpl the uncompressedDigitalAudioOpl value to set + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withUncompressedDigitalAudioOpl(Integer uncompressedDigitalAudioOpl) { + this.uncompressedDigitalAudioOpl = uncompressedDigitalAudioOpl; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java new file mode 100644 index 000000000000..51485d465ee0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyPlayReadyUnknownOutputPassingOption. + */ +public enum ContentKeyPolicyPlayReadyUnknownOutputPassingOption { + /** Represents a ContentKeyPolicyPlayReadyUnknownOutputPassingOption that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Passing the video portion of protected content to an Unknown Output is not allowed. */ + NOT_ALLOWED("NotAllowed"), + + /** Passing the video portion of protected content to an Unknown Output is allowed. */ + ALLOWED("Allowed"), + + /** Passing the video portion of protected content to an Unknown Output is allowed but with constrained resolution. */ + ALLOWED_WITH_VIDEO_CONSTRICTION("AllowedWithVideoConstriction"); + + /** The actual serialized value for a ContentKeyPolicyPlayReadyUnknownOutputPassingOption instance. */ + private String value; + + ContentKeyPolicyPlayReadyUnknownOutputPassingOption(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyPlayReadyUnknownOutputPassingOption instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyPlayReadyUnknownOutputPassingOption object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyUnknownOutputPassingOption fromString(String value) { + ContentKeyPolicyPlayReadyUnknownOutputPassingOption[] items = ContentKeyPolicyPlayReadyUnknownOutputPassingOption.values(); + for (ContentKeyPolicyPlayReadyUnknownOutputPassingOption item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyProperties.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyProperties.java new file mode 100644 index 000000000000..c38dee8fc852 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyProperties.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ContentKeyPolicyPropertiesInner; +import org.joda.time.DateTime; +import java.util.List; +import java.util.UUID; + +/** + * Type representing ContentKeyPolicyProperties. + */ +public interface ContentKeyPolicyProperties extends HasInner, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the options value. + */ + List options(); + + /** + * @return the policyId value. + */ + UUID policyId(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestriction.java new file mode 100644 index 000000000000..08344b5085c2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestriction.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for Content Key Policy restrictions. A derived class must be used + * to create a restriction. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyRestriction") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyOpenRestriction", value = ContentKeyPolicyOpenRestriction.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction", value = ContentKeyPolicyUnknownRestriction.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyTokenRestriction", value = ContentKeyPolicyTokenRestriction.class) +}) +public class ContentKeyPolicyRestriction { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenKey.java new file mode 100644 index 000000000000..7787544ebea3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenKey.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for Content Key Policy key for token validation. A derived class + * must be used to create a token key. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("ContentKeyPolicyRestrictionTokenKey") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey", value = ContentKeyPolicySymmetricTokenKey.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey", value = ContentKeyPolicyRsaTokenKey.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey", value = ContentKeyPolicyX509CertificateTokenKey.class) +}) +public class ContentKeyPolicyRestrictionTokenKey { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenType.java new file mode 100644 index 000000000000..47db389c970f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRestrictionTokenType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ContentKeyPolicyRestrictionTokenType. + */ +public enum ContentKeyPolicyRestrictionTokenType { + /** Represents a ContentKeyPolicyRestrictionTokenType that is unavailable in current API version. */ + UNKNOWN("Unknown"), + + /** Simple Web Token. */ + SWT("Swt"), + + /** JSON Web Token. */ + JWT("Jwt"); + + /** The actual serialized value for a ContentKeyPolicyRestrictionTokenType instance. */ + private String value; + + ContentKeyPolicyRestrictionTokenType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContentKeyPolicyRestrictionTokenType instance. + * + * @param value the serialized value to parse. + * @return the parsed ContentKeyPolicyRestrictionTokenType object, or null if unable to parse. + */ + @JsonCreator + public static ContentKeyPolicyRestrictionTokenType fromString(String value) { + ContentKeyPolicyRestrictionTokenType[] items = ContentKeyPolicyRestrictionTokenType.values(); + for (ContentKeyPolicyRestrictionTokenType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRsaTokenKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRsaTokenKey.java new file mode 100644 index 000000000000..17351317bf75 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyRsaTokenKey.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a RSA key for token validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyRsaTokenKey") +public class ContentKeyPolicyRsaTokenKey extends ContentKeyPolicyRestrictionTokenKey { + /** + * The RSA Parameter exponent. + */ + @JsonProperty(value = "exponent", required = true) + private byte[] exponent; + + /** + * The RSA Parameter modulus. + */ + @JsonProperty(value = "modulus", required = true) + private byte[] modulus; + + /** + * Get the RSA Parameter exponent. + * + * @return the exponent value + */ + public byte[] exponent() { + return this.exponent; + } + + /** + * Set the RSA Parameter exponent. + * + * @param exponent the exponent value to set + * @return the ContentKeyPolicyRsaTokenKey object itself. + */ + public ContentKeyPolicyRsaTokenKey withExponent(byte[] exponent) { + this.exponent = exponent; + return this; + } + + /** + * Get the RSA Parameter modulus. + * + * @return the modulus value + */ + public byte[] modulus() { + return this.modulus; + } + + /** + * Set the RSA Parameter modulus. + * + * @param modulus the modulus value to set + * @return the ContentKeyPolicyRsaTokenKey object itself. + */ + public ContentKeyPolicyRsaTokenKey withModulus(byte[] modulus) { + this.modulus = modulus; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicySymmetricTokenKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicySymmetricTokenKey.java new file mode 100644 index 000000000000..a59fef8bb0dd --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicySymmetricTokenKey.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a symmetric key for token validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey") +public class ContentKeyPolicySymmetricTokenKey extends ContentKeyPolicyRestrictionTokenKey { + /** + * The key value of the key. + */ + @JsonProperty(value = "keyValue", required = true) + private byte[] keyValue; + + /** + * Get the key value of the key. + * + * @return the keyValue value + */ + public byte[] keyValue() { + return this.keyValue; + } + + /** + * Set the key value of the key. + * + * @param keyValue the keyValue value to set + * @return the ContentKeyPolicySymmetricTokenKey object itself. + */ + public ContentKeyPolicySymmetricTokenKey withKeyValue(byte[] keyValue) { + this.keyValue = keyValue; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenClaim.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenClaim.java new file mode 100644 index 000000000000..05e76c4db778 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenClaim.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a token claim. + */ +public class ContentKeyPolicyTokenClaim { + /** + * Token claim type. + */ + @JsonProperty(value = "claimType") + private String claimType; + + /** + * Token claim value. + */ + @JsonProperty(value = "claimValue") + private String claimValue; + + /** + * Get token claim type. + * + * @return the claimType value + */ + public String claimType() { + return this.claimType; + } + + /** + * Set token claim type. + * + * @param claimType the claimType value to set + * @return the ContentKeyPolicyTokenClaim object itself. + */ + public ContentKeyPolicyTokenClaim withClaimType(String claimType) { + this.claimType = claimType; + return this; + } + + /** + * Get token claim value. + * + * @return the claimValue value + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Set token claim value. + * + * @param claimValue the claimValue value to set + * @return the ContentKeyPolicyTokenClaim object itself. + */ + public ContentKeyPolicyTokenClaim withClaimValue(String claimValue) { + this.claimValue = claimValue; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenRestriction.java new file mode 100644 index 000000000000..0ff78798f609 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyTokenRestriction.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a token restriction. Provided token must match these requirements + * for successful license or key delivery. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyTokenRestriction") +public class ContentKeyPolicyTokenRestriction extends ContentKeyPolicyRestriction { + /** + * The token issuer. + */ + @JsonProperty(value = "issuer", required = true) + private String issuer; + + /** + * The audience for the token. + */ + @JsonProperty(value = "audience", required = true) + private String audience; + + /** + * The primary verification key. + */ + @JsonProperty(value = "primaryVerificationKey", required = true) + private ContentKeyPolicyRestrictionTokenKey primaryVerificationKey; + + /** + * A list of alternative verification keys. + */ + @JsonProperty(value = "alternateVerificationKeys") + private List alternateVerificationKeys; + + /** + * A list of required token claims. + */ + @JsonProperty(value = "requiredClaims") + private List requiredClaims; + + /** + * The type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. + */ + @JsonProperty(value = "restrictionTokenType", required = true) + private ContentKeyPolicyRestrictionTokenType restrictionTokenType; + + /** + * The OpenID connect discovery document. + */ + @JsonProperty(value = "openIdConnectDiscoveryDocument") + private String openIdConnectDiscoveryDocument; + + /** + * Get the token issuer. + * + * @return the issuer value + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the token issuer. + * + * @param issuer the issuer value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get the audience for the token. + * + * @return the audience value + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience for the token. + * + * @param audience the audience value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the primary verification key. + * + * @return the primaryVerificationKey value + */ + public ContentKeyPolicyRestrictionTokenKey primaryVerificationKey() { + return this.primaryVerificationKey; + } + + /** + * Set the primary verification key. + * + * @param primaryVerificationKey the primaryVerificationKey value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withPrimaryVerificationKey(ContentKeyPolicyRestrictionTokenKey primaryVerificationKey) { + this.primaryVerificationKey = primaryVerificationKey; + return this; + } + + /** + * Get a list of alternative verification keys. + * + * @return the alternateVerificationKeys value + */ + public List alternateVerificationKeys() { + return this.alternateVerificationKeys; + } + + /** + * Set a list of alternative verification keys. + * + * @param alternateVerificationKeys the alternateVerificationKeys value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withAlternateVerificationKeys(List alternateVerificationKeys) { + this.alternateVerificationKeys = alternateVerificationKeys; + return this; + } + + /** + * Get a list of required token claims. + * + * @return the requiredClaims value + */ + public List requiredClaims() { + return this.requiredClaims; + } + + /** + * Set a list of required token claims. + * + * @param requiredClaims the requiredClaims value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withRequiredClaims(List requiredClaims) { + this.requiredClaims = requiredClaims; + return this; + } + + /** + * Get the type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. + * + * @return the restrictionTokenType value + */ + public ContentKeyPolicyRestrictionTokenType restrictionTokenType() { + return this.restrictionTokenType; + } + + /** + * Set the type of token. Possible values include: 'Unknown', 'Swt', 'Jwt'. + * + * @param restrictionTokenType the restrictionTokenType value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withRestrictionTokenType(ContentKeyPolicyRestrictionTokenType restrictionTokenType) { + this.restrictionTokenType = restrictionTokenType; + return this; + } + + /** + * Get the OpenID connect discovery document. + * + * @return the openIdConnectDiscoveryDocument value + */ + public String openIdConnectDiscoveryDocument() { + return this.openIdConnectDiscoveryDocument; + } + + /** + * Set the OpenID connect discovery document. + * + * @param openIdConnectDiscoveryDocument the openIdConnectDiscoveryDocument value to set + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withOpenIdConnectDiscoveryDocument(String openIdConnectDiscoveryDocument) { + this.openIdConnectDiscoveryDocument = openIdConnectDiscoveryDocument; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownConfiguration.java new file mode 100644 index 000000000000..789867eb0cbd --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownConfiguration.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a ContentKeyPolicyConfiguration that is unavailable in the + * current API version. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyUnknownConfiguration") +public class ContentKeyPolicyUnknownConfiguration extends ContentKeyPolicyConfiguration { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownRestriction.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownRestriction.java new file mode 100644 index 000000000000..380053ec7074 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyUnknownRestriction.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents a ContentKeyPolicyRestriction that is unavailable in the current + * API version. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyUnknownRestriction") +public class ContentKeyPolicyUnknownRestriction extends ContentKeyPolicyRestriction { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyWidevineConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyWidevineConfiguration.java new file mode 100644 index 000000000000..71ab8635eefa --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyWidevineConfiguration.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a configuration for Widevine licenses. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration") +public class ContentKeyPolicyWidevineConfiguration extends ContentKeyPolicyConfiguration { + /** + * The Widevine template. + */ + @JsonProperty(value = "widevineTemplate", required = true) + private String widevineTemplate; + + /** + * Get the Widevine template. + * + * @return the widevineTemplate value + */ + public String widevineTemplate() { + return this.widevineTemplate; + } + + /** + * Set the Widevine template. + * + * @param widevineTemplate the widevineTemplate value to set + * @return the ContentKeyPolicyWidevineConfiguration object itself. + */ + public ContentKeyPolicyWidevineConfiguration withWidevineTemplate(String widevineTemplate) { + this.widevineTemplate = widevineTemplate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyX509CertificateTokenKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyX509CertificateTokenKey.java new file mode 100644 index 000000000000..297df2d5f798 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ContentKeyPolicyX509CertificateTokenKey.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies a certificate for token validation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey") +public class ContentKeyPolicyX509CertificateTokenKey extends ContentKeyPolicyRestrictionTokenKey { + /** + * The raw data field of a certificate in PKCS 12 format (X509Certificate2 + * in .NET). + */ + @JsonProperty(value = "rawBody", required = true) + private byte[] rawBody; + + /** + * Get the raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET). + * + * @return the rawBody value + */ + public byte[] rawBody() { + return this.rawBody; + } + + /** + * Set the raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET). + * + * @param rawBody the rawBody value to set + * @return the ContentKeyPolicyX509CertificateTokenKey object itself. + */ + public ContentKeyPolicyX509CertificateTokenKey withRawBody(byte[] rawBody) { + this.rawBody = rawBody; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyAudio.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyAudio.java new file mode 100644 index 000000000000..2408271aca29 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyAudio.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A codec flag, which tells the encoder to copy the input audio bitstream. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.CopyAudio") +public class CopyAudio extends Codec { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyVideo.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyVideo.java new file mode 100644 index 000000000000..87fd4c4758df --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CopyVideo.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A codec flag, which tells the encoder to copy the input video bitstream + * without re-encoding. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.CopyVideo") +public class CopyVideo extends Codec { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CrossSiteAccessPolicies.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CrossSiteAccessPolicies.java new file mode 100644 index 000000000000..f5a4633fa5c2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/CrossSiteAccessPolicies.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The client access policy. + */ +public class CrossSiteAccessPolicies { + /** + * The content of clientaccesspolicy.xml used by Silverlight. + */ + @JsonProperty(value = "clientAccessPolicy") + private String clientAccessPolicy; + + /** + * The content of crossdomain.xml used by Silverlight. + */ + @JsonProperty(value = "crossDomainPolicy") + private String crossDomainPolicy; + + /** + * Get the content of clientaccesspolicy.xml used by Silverlight. + * + * @return the clientAccessPolicy value + */ + public String clientAccessPolicy() { + return this.clientAccessPolicy; + } + + /** + * Set the content of clientaccesspolicy.xml used by Silverlight. + * + * @param clientAccessPolicy the clientAccessPolicy value to set + * @return the CrossSiteAccessPolicies object itself. + */ + public CrossSiteAccessPolicies withClientAccessPolicy(String clientAccessPolicy) { + this.clientAccessPolicy = clientAccessPolicy; + return this; + } + + /** + * Get the content of crossdomain.xml used by Silverlight. + * + * @return the crossDomainPolicy value + */ + public String crossDomainPolicy() { + return this.crossDomainPolicy; + } + + /** + * Set the content of crossdomain.xml used by Silverlight. + * + * @param crossDomainPolicy the crossDomainPolicy value to set + * @return the CrossSiteAccessPolicies object itself. + */ + public CrossSiteAccessPolicies withCrossDomainPolicy(String crossDomainPolicy) { + this.crossDomainPolicy = crossDomainPolicy; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DefaultKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DefaultKey.java new file mode 100644 index 000000000000..5ad5ac32cd5d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DefaultKey.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify properties of default content key for each encryption + * scheme. + */ +public class DefaultKey { + /** + * Label can be used to specify Content Key when creating a Streaming + * Locator. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Policy used by Default Key. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Get label can be used to specify Content Key when creating a Streaming Locator. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label can be used to specify Content Key when creating a Streaming Locator. + * + * @param label the label value to set + * @return the DefaultKey object itself. + */ + public DefaultKey withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get policy used by Default Key. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set policy used by Default Key. + * + * @param policyName the policyName value to set + * @return the DefaultKey object itself. + */ + public DefaultKey withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Deinterlace.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Deinterlace.java new file mode 100644 index 000000000000..dce6fcd89df6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Deinterlace.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the de-interlacing settings. + */ +public class Deinterlace { + /** + * The field parity for de-interlacing, defaults to Auto. Possible values + * include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. + */ + @JsonProperty(value = "parity") + private DeinterlaceParity parity; + + /** + * The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values + * include: 'Off', 'AutoPixelAdaptive'. + */ + @JsonProperty(value = "mode") + private DeinterlaceMode mode; + + /** + * Get the field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. + * + * @return the parity value + */ + public DeinterlaceParity parity() { + return this.parity; + } + + /** + * Set the field parity for de-interlacing, defaults to Auto. Possible values include: 'Auto', 'TopFieldFirst', 'BottomFieldFirst'. + * + * @param parity the parity value to set + * @return the Deinterlace object itself. + */ + public Deinterlace withParity(DeinterlaceParity parity) { + this.parity = parity; + return this; + } + + /** + * Get the deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive'. + * + * @return the mode value + */ + public DeinterlaceMode mode() { + return this.mode; + } + + /** + * Set the deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: 'Off', 'AutoPixelAdaptive'. + * + * @param mode the mode value to set + * @return the Deinterlace object itself. + */ + public Deinterlace withMode(DeinterlaceMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceMode.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceMode.java new file mode 100644 index 000000000000..5a1ef00070a6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceMode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DeinterlaceMode. + */ +public enum DeinterlaceMode { + /** Disables de-interlacing of the source video. */ + OFF("Off"), + + /** Apply automatic pixel adaptive de-interlacing on each frame in the input video. */ + AUTO_PIXEL_ADAPTIVE("AutoPixelAdaptive"); + + /** The actual serialized value for a DeinterlaceMode instance. */ + private String value; + + DeinterlaceMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeinterlaceMode instance. + * + * @param value the serialized value to parse. + * @return the parsed DeinterlaceMode object, or null if unable to parse. + */ + @JsonCreator + public static DeinterlaceMode fromString(String value) { + DeinterlaceMode[] items = DeinterlaceMode.values(); + for (DeinterlaceMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceParity.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceParity.java new file mode 100644 index 000000000000..60e6c71eb91d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/DeinterlaceParity.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DeinterlaceParity. + */ +public enum DeinterlaceParity { + /** Automatically detect the order of fields. */ + AUTO("Auto"), + + /** Apply top field first processing of input video. */ + TOP_FIELD_FIRST("TopFieldFirst"), + + /** Apply bottom field first processing of input video. */ + BOTTOM_FIELD_FIRST("BottomFieldFirst"); + + /** The actual serialized value for a DeinterlaceParity instance. */ + private String value; + + DeinterlaceParity(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeinterlaceParity instance. + * + * @param value the serialized value to parse. + * @return the parsed DeinterlaceParity object, or null if unable to parse. + */ + @JsonCreator + public static DeinterlaceParity fromString(String value) { + DeinterlaceParity[] items = DeinterlaceParity.values(); + for (DeinterlaceParity item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnabledProtocols.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnabledProtocols.java new file mode 100644 index 000000000000..def04c72f0bb --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnabledProtocols.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify which protocols are enabled. + */ +public class EnabledProtocols { + /** + * Enable Download protocol or not. + */ + @JsonProperty(value = "download", required = true) + private boolean download; + + /** + * Enable DASH protocol or not. + */ + @JsonProperty(value = "dash", required = true) + private boolean dash; + + /** + * Enable HLS protocol or not. + */ + @JsonProperty(value = "hls", required = true) + private boolean hls; + + /** + * Enable SmoothStreaming protocol or not. + */ + @JsonProperty(value = "smoothStreaming", required = true) + private boolean smoothStreaming; + + /** + * Get enable Download protocol or not. + * + * @return the download value + */ + public boolean download() { + return this.download; + } + + /** + * Set 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 enable DASH protocol or not. + * + * @return the dash value + */ + public boolean dash() { + return this.dash; + } + + /** + * Set 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 enable HLS protocol or not. + * + * @return the hls value + */ + public boolean hls() { + return this.hls; + } + + /** + * Set 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 enable SmoothStreaming protocol or not. + * + * @return the smoothStreaming value + */ + public boolean smoothStreaming() { + return this.smoothStreaming; + } + + /** + * Set 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; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncoderNamedPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncoderNamedPreset.java new file mode 100644 index 000000000000..a6612f689694 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncoderNamedPreset.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncoderNamedPreset. + */ +public enum EncoderNamedPreset { + /** Produces an MP4 file where the video is encoded with H.264 codec at 2200 kbps and a picture height of 480 pixels, and the stereo audio is encoded with AAC-LC codec at 64 kbps. */ + H264SINGLE_BITRATE_SD("H264SingleBitrateSD"), + + /** Produces an MP4 file where the video is encoded with H.264 codec at 4500 kbps and a picture height of 720 pixels, and the stereo audio is encoded with AAC-LC codec at 64 kbps. */ + H264SINGLE_BITRATE720P("H264SingleBitrate720p"), + + /** Produces an MP4 file where the video is encoded with H.264 codec at 6750 kbps and a picture height of 1080 pixels, and the stereo audio is encoded with AAC-LC codec at 64 kbps. */ + H264SINGLE_BITRATE1080P("H264SingleBitrate1080p"), + + /** Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. Auto-generates a bitrate ladder based on the input resolution and bitrate. The auto-generated preset will never exceed the input resolution and bitrate. For example, if the input is 720p at 3 Mbps, output will remain 720p at best, and will start at rates lower than 3 Mbps. The output will will have video and audio in separate MP4 files, which is optimal for adaptive streaming. */ + ADAPTIVE_STREAMING("AdaptiveStreaming"), + + /** Produces a single MP4 file containing only stereo audio encoded at 192 kbps. */ + AACGOOD_QUALITY_AUDIO("AACGoodQualityAudio"), + + /** Produces a set of 8 GOP-aligned MP4 files, ranging from 6000 kbps to 400 kbps, and stereo AAC audio. Resolution starts at 1080p and goes down to 360p. */ + H264MULTIPLE_BITRATE1080P("H264MultipleBitrate1080p"), + + /** Produces a set of 6 GOP-aligned MP4 files, ranging from 3400 kbps to 400 kbps, and stereo AAC audio. Resolution starts at 720p and goes down to 360p. */ + H264MULTIPLE_BITRATE720P("H264MultipleBitrate720p"), + + /** Produces a set of 5 GOP-aligned MP4 files, ranging from 1600kbps to 400 kbps, and stereo AAC audio. Resolution starts at 480p and goes down to 360p. */ + H264MULTIPLE_BITRATE_SD("H264MultipleBitrateSD"); + + /** The actual serialized value for a EncoderNamedPreset instance. */ + private String value; + + EncoderNamedPreset(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncoderNamedPreset instance. + * + * @param value the serialized value to parse. + * @return the parsed EncoderNamedPreset object, or null if unable to parse. + */ + @JsonCreator + public static EncoderNamedPreset fromString(String value) { + EncoderNamedPreset[] items = EncoderNamedPreset.values(); + for (EncoderNamedPreset item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncryptionScheme.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncryptionScheme.java new file mode 100644 index 000000000000..098dfe82f958 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EncryptionScheme.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EncryptionScheme. + */ +public enum EncryptionScheme { + /** NoEncryption scheme. */ + NO_ENCRYPTION("NoEncryption"), + + /** EnvelopeEncryption scheme. */ + ENVELOPE_ENCRYPTION("EnvelopeEncryption"), + + /** CommonEncryptionCenc scheme. */ + COMMON_ENCRYPTION_CENC("CommonEncryptionCenc"), + + /** CommonEncryptionCbcs scheme. */ + COMMON_ENCRYPTION_CBCS("CommonEncryptionCbcs"); + + /** The actual serialized value for a EncryptionScheme instance. */ + private String value; + + EncryptionScheme(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EncryptionScheme instance. + * + * @param value the serialized value to parse. + * @return the parsed EncryptionScheme object, or null if unable to parse. + */ + @JsonCreator + public static EncryptionScheme fromString(String value) { + EncryptionScheme[] items = EncryptionScheme.values(); + for (EncryptionScheme item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntityNameAvailabilityCheckOutput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntityNameAvailabilityCheckOutput.java new file mode 100644 index 000000000000..8c096ad42aa9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntityNameAvailabilityCheckOutput.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.EntityNameAvailabilityCheckOutputInner; + +/** + * Type representing EntityNameAvailabilityCheckOutput. + */ +public interface EntityNameAvailabilityCheckOutput extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntropyMode.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntropyMode.java new file mode 100644 index 000000000000..bc6c28e73a82 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EntropyMode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EntropyMode. + */ +public enum EntropyMode { + /** Context Adaptive Binary Arithmetic Coder (CABAC) entropy encoding. */ + CABAC("Cabac"), + + /** Context Adaptive Variable Length Coder (CAVLC) entropy encoding. */ + CAVLC("Cavlc"); + + /** The actual serialized value for a EntropyMode instance. */ + private String value; + + EntropyMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EntropyMode instance. + * + * @param value the serialized value to parse. + * @return the parsed EntropyMode object, or null if unable to parse. + */ + @JsonCreator + public static EntropyMode fromString(String value) { + EntropyMode[] items = EntropyMode.values(); + for (EntropyMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnvelopeEncryption.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnvelopeEncryption.java new file mode 100644 index 000000000000..df5a9118ee2a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/EnvelopeEncryption.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for EnvelopeEncryption encryption scheme. + */ +public class EnvelopeEncryption { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Representing which tracks should not be encrypted. + */ + @JsonProperty(value = "clearTracks") + private List clearTracks; + + /** + * Representing default content key for each encryption scheme and separate + * content keys for specific tracks. + */ + @JsonProperty(value = "contentKeys") + private StreamingPolicyContentKeys contentKeys; + + /** + * KeyAcquistionUrlTemplate is used to point to user specified service to + * delivery content keys. + */ + @JsonProperty(value = "customKeyAcquisitionUrlTemplate") + private String customKeyAcquisitionUrlTemplate; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get representing which tracks should not be encrypted. + * + * @return the clearTracks value + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set representing which tracks should not be encrypted. + * + * @param clearTracks the clearTracks value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withClearTracks(List clearTracks) { + this.clearTracks = clearTracks; + return this; + } + + /** + * Get representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @return the contentKeys value + */ + public StreamingPolicyContentKeys contentKeys() { + return this.contentKeys; + } + + /** + * Set representing default content key for each encryption scheme and separate content keys for specific tracks. + * + * @param contentKeys the contentKeys value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withContentKeys(StreamingPolicyContentKeys contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get keyAcquistionUrlTemplate is used to point to user specified service to delivery content keys. + * + * @return the customKeyAcquisitionUrlTemplate value + */ + public String customKeyAcquisitionUrlTemplate() { + return this.customKeyAcquisitionUrlTemplate; + } + + /** + * Set keyAcquistionUrlTemplate is used to point to user specified service to delivery content keys. + * + * @param customKeyAcquisitionUrlTemplate the customKeyAcquisitionUrlTemplate value to set + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withCustomKeyAcquisitionUrlTemplate(String customKeyAcquisitionUrlTemplate) { + this.customKeyAcquisitionUrlTemplate = customKeyAcquisitionUrlTemplate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCompareOperation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCompareOperation.java new file mode 100644 index 000000000000..a4bcf8b0cbd7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCompareOperation.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FilterTrackPropertyCompareOperation. + */ +public enum FilterTrackPropertyCompareOperation { + /** The equal operation. */ + EQUAL("Equal"), + + /** The not equal operation. */ + NOT_EQUAL("NotEqual"); + + /** The actual serialized value for a FilterTrackPropertyCompareOperation instance. */ + private String value; + + FilterTrackPropertyCompareOperation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FilterTrackPropertyCompareOperation instance. + * + * @param value the serialized value to parse. + * @return the parsed FilterTrackPropertyCompareOperation object, or null if unable to parse. + */ + @JsonCreator + public static FilterTrackPropertyCompareOperation fromString(String value) { + FilterTrackPropertyCompareOperation[] items = FilterTrackPropertyCompareOperation.values(); + for (FilterTrackPropertyCompareOperation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCondition.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCondition.java new file mode 100644 index 000000000000..1e0b4b315e76 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyCondition.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The class to specify one track property condition. + */ +public class FilterTrackPropertyCondition { + /** + * The track property type. Possible values include: 'Unknown', 'Type', + * 'Name', 'Language', 'FourCC', 'Bitrate'. + */ + @JsonProperty(value = "property", required = true) + private FilterTrackPropertyType property; + + /** + * The track proprty value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * The track property condition operation. Possible values include: + * 'Equal', 'NotEqual'. + */ + @JsonProperty(value = "operation", required = true) + private FilterTrackPropertyCompareOperation operation; + + /** + * Get the track property type. Possible values include: 'Unknown', 'Type', 'Name', 'Language', 'FourCC', 'Bitrate'. + * + * @return the property value + */ + public FilterTrackPropertyType property() { + return this.property; + } + + /** + * Set the track property type. Possible values include: 'Unknown', 'Type', 'Name', 'Language', 'FourCC', 'Bitrate'. + * + * @param property the property value to set + * @return the FilterTrackPropertyCondition object itself. + */ + public FilterTrackPropertyCondition withProperty(FilterTrackPropertyType property) { + this.property = property; + return this; + } + + /** + * Get the track proprty value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the track proprty value. + * + * @param value the value value to set + * @return the FilterTrackPropertyCondition object itself. + */ + public FilterTrackPropertyCondition withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the track property condition operation. Possible values include: 'Equal', 'NotEqual'. + * + * @return the operation value + */ + public FilterTrackPropertyCompareOperation operation() { + return this.operation; + } + + /** + * Set the track property condition operation. Possible values include: 'Equal', 'NotEqual'. + * + * @param operation the operation value to set + * @return the FilterTrackPropertyCondition object itself. + */ + public FilterTrackPropertyCondition withOperation(FilterTrackPropertyCompareOperation operation) { + this.operation = operation; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyType.java new file mode 100644 index 000000000000..1684ff394bd4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackPropertyType.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for FilterTrackPropertyType. + */ +public enum FilterTrackPropertyType { + /** The unknown track property type. */ + UNKNOWN("Unknown"), + + /** The type. */ + TYPE("Type"), + + /** The name. */ + NAME("Name"), + + /** The language. */ + LANGUAGE("Language"), + + /** The fourCC. */ + FOUR_CC("FourCC"), + + /** The bitrate. */ + BITRATE("Bitrate"); + + /** The actual serialized value for a FilterTrackPropertyType instance. */ + private String value; + + FilterTrackPropertyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FilterTrackPropertyType instance. + * + * @param value the serialized value to parse. + * @return the parsed FilterTrackPropertyType object, or null if unable to parse. + */ + @JsonCreator + public static FilterTrackPropertyType fromString(String value) { + FilterTrackPropertyType[] items = FilterTrackPropertyType.values(); + for (FilterTrackPropertyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackSelection.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackSelection.java new file mode 100644 index 000000000000..8f01d125d797 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FilterTrackSelection.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Representing a list of FilterTrackPropertyConditions to select a track. The + * filters are combined using a logical AND operation. + */ +public class FilterTrackSelection { + /** + * The track selections. + */ + @JsonProperty(value = "trackSelections", required = true) + private List trackSelections; + + /** + * Get the track selections. + * + * @return the trackSelections value + */ + public List trackSelections() { + return this.trackSelections; + } + + /** + * Set the track selections. + * + * @param trackSelections the trackSelections value to set + * @return the FilterTrackSelection object itself. + */ + public FilterTrackSelection withTrackSelections(List trackSelections) { + this.trackSelections = trackSelections; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Filters.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Filters.java new file mode 100644 index 000000000000..741b644eb11c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Filters.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes all the filtering operations, such as de-interlacing, rotation + * etc. that are to be applied to the input media before encoding. + */ +public class Filters { + /** + * The de-interlacing settings. + */ + @JsonProperty(value = "deinterlace") + private Deinterlace deinterlace; + + /** + * The rotation, if any, to be applied to the input video, before it is + * encoded. Default is Auto. Possible values include: 'Auto', 'None', + * 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. + */ + @JsonProperty(value = "rotation") + private Rotation rotation; + + /** + * The parameters for the rectangular window with which to crop the input + * video. + */ + @JsonProperty(value = "crop") + private Rectangle crop; + + /** + * The properties of overlays to be applied to the input video. These could + * be audio, image or video overlays. + */ + @JsonProperty(value = "overlays") + private List overlays; + + /** + * Get the de-interlacing settings. + * + * @return the deinterlace value + */ + public Deinterlace deinterlace() { + return this.deinterlace; + } + + /** + * Set the de-interlacing settings. + * + * @param deinterlace the deinterlace value to set + * @return the Filters object itself. + */ + public Filters withDeinterlace(Deinterlace deinterlace) { + this.deinterlace = deinterlace; + return this; + } + + /** + * Get the rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'Auto', 'None', 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. + * + * @return the rotation value + */ + public Rotation rotation() { + return this.rotation; + } + + /** + * Set the rotation, if any, to be applied to the input video, before it is encoded. Default is Auto. Possible values include: 'Auto', 'None', 'Rotate0', 'Rotate90', 'Rotate180', 'Rotate270'. + * + * @param rotation the rotation value to set + * @return the Filters object itself. + */ + public Filters withRotation(Rotation rotation) { + this.rotation = rotation; + return this; + } + + /** + * Get the parameters for the rectangular window with which to crop the input video. + * + * @return the crop value + */ + public Rectangle crop() { + return this.crop; + } + + /** + * Set the parameters for the rectangular window with which to crop the input video. + * + * @param crop the crop value to set + * @return the Filters object itself. + */ + public Filters withCrop(Rectangle crop) { + this.crop = crop; + return this; + } + + /** + * Get the properties of overlays to be applied to the input video. These could be audio, image or video overlays. + * + * @return the overlays value + */ + public List overlays() { + return this.overlays; + } + + /** + * Set the properties of overlays to be applied to the input video. These could be audio, image or video overlays. + * + * @param overlays the overlays value to set + * @return the Filters object itself. + */ + public Filters withOverlays(List overlays) { + this.overlays = overlays; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FirstQuality.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FirstQuality.java new file mode 100644 index 000000000000..381834909641 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/FirstQuality.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filter First Quality. + */ +public class FirstQuality { + /** + * The first quality bitrate. + */ + @JsonProperty(value = "bitrate", required = true) + private int bitrate; + + /** + * Get the first quality bitrate. + * + * @return the bitrate value + */ + public int bitrate() { + return this.bitrate; + } + + /** + * Set the first quality bitrate. + * + * @param bitrate the bitrate value to set + * @return the FirstQuality object itself. + */ + public FirstQuality withBitrate(int bitrate) { + this.bitrate = bitrate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Format.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Format.java new file mode 100644 index 000000000000..79563db7ba57 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Format.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for output. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Format") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ImageFormat", value = ImageFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.MultiBitrateFormat", value = MultiBitrateFormat.class) +}) +public class Format { + /** + * The pattern of the file names for the generated output files. The + * following macros are supported in the file name: {Basename} - The base + * name of the input video {Extension} - The appropriate extension for this + * format. {Label} - The label assigned to the codec/layer. {Index} - A + * unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - + * The audio/video bitrate. Not applicable to thumbnails. {Codec} - The + * type of the audio/video codec. Any unsubstituted macros will be + * collapsed and removed from the filename. + */ + @JsonProperty(value = "filenamePattern") + private String filenamePattern; + + /** + * Get the pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + * + * @return the filenamePattern value + */ + public String filenamePattern() { + return this.filenamePattern; + } + + /** + * Set the pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - The base name of the input video {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. Any unsubstituted macros will be collapsed and removed from the filename. + * + * @param filenamePattern the filenamePattern value to set + * @return the Format object itself. + */ + public Format withFilenamePattern(String filenamePattern) { + this.filenamePattern = filenamePattern; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Complexity.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Complexity.java new file mode 100644 index 000000000000..e11f78b3dc9b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Complexity.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for H264Complexity. + */ +public enum H264Complexity { + /** Tells the encoder to use settings that are optimized for faster encoding. Quality is sacrificed to decrease encoding time. */ + SPEED("Speed"), + + /** Tells the encoder to use settings that achieve a balance between speed and quality. */ + BALANCED("Balanced"), + + /** Tells the encoder to use settings that are optimized to produce higher quality output at the expense of slower overall encode time. */ + QUALITY("Quality"); + + /** The actual serialized value for a H264Complexity instance. */ + private String value; + + H264Complexity(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a H264Complexity instance. + * + * @param value the serialized value to parse. + * @return the parsed H264Complexity object, or null if unable to parse. + */ + @JsonCreator + public static H264Complexity fromString(String value) { + H264Complexity[] items = H264Complexity.values(); + for (H264Complexity item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Layer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Layer.java new file mode 100644 index 000000000000..6ccbf112cb02 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Layer.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings to be used when encoding the input video into a + * desired output bitrate layer with the H.264 video codec. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.H264Layer") +public class H264Layer extends VideoLayer { + /** + * Which profile of the H.264 standard should be used when encoding this + * layer. Default is Auto. Possible values include: 'Auto', 'Baseline', + * 'Main', 'High', 'High422', 'High444'. + */ + @JsonProperty(value = "profile") + private H264VideoProfile profile; + + /** + * Which level of the H.264 standard should be used when encoding this + * layer. The value can be Auto, or a number that matches the H.264 + * profile. If not specified, the default is Auto, which lets the encoder + * choose the Level that is appropriate for this layer. + */ + @JsonProperty(value = "level") + private String level; + + /** + * The VBV buffer window length. The value should be in ISO 8601 format. + * The value should be in the range [0.1-100] seconds. The default is 5 + * seconds (for example, PT5S). + */ + @JsonProperty(value = "bufferWindow") + private Period bufferWindow; + + /** + * The number of reference frames to be used when encoding this layer. If + * not specified, the encoder determines an appropriate number based on the + * encoder complexity setting. + */ + @JsonProperty(value = "referenceFrames") + private Integer referenceFrames; + + /** + * The entropy mode to be used for this layer. If not specified, the + * encoder chooses the mode that is appropriate for the profile and level. + * Possible values include: 'Cabac', 'Cavlc'. + */ + @JsonProperty(value = "entropyMode") + private EntropyMode entropyMode; + + /** + * Get which profile of the H.264 standard should be used when encoding this layer. Default is Auto. Possible values include: 'Auto', 'Baseline', 'Main', 'High', 'High422', 'High444'. + * + * @return the profile value + */ + public H264VideoProfile profile() { + return this.profile; + } + + /** + * Set which profile of the H.264 standard should be used when encoding this layer. Default is Auto. Possible values include: 'Auto', 'Baseline', 'Main', 'High', 'High422', 'High444'. + * + * @param profile the profile value to set + * @return the H264Layer object itself. + */ + public H264Layer withProfile(H264VideoProfile profile) { + this.profile = profile; + return this; + } + + /** + * Get which level of the H.264 standard should be used when encoding this layer. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. + * + * @return the level value + */ + public String level() { + return this.level; + } + + /** + * Set which level of the H.264 standard should be used when encoding this layer. The value can be Auto, or a number that matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose the Level that is appropriate for this layer. + * + * @param level the level value to set + * @return the H264Layer object itself. + */ + public H264Layer withLevel(String level) { + this.level = level; + return this; + } + + /** + * Get the VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). + * + * @return the bufferWindow value + */ + public Period bufferWindow() { + return this.bufferWindow; + } + + /** + * Set the VBV buffer window length. The value should be in ISO 8601 format. The value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). + * + * @param bufferWindow the bufferWindow value to set + * @return the H264Layer object itself. + */ + public H264Layer withBufferWindow(Period bufferWindow) { + this.bufferWindow = bufferWindow; + return this; + } + + /** + * Get the number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. + * + * @return the referenceFrames value + */ + public Integer referenceFrames() { + return this.referenceFrames; + } + + /** + * Set the number of reference frames to be used when encoding this layer. If not specified, the encoder determines an appropriate number based on the encoder complexity setting. + * + * @param referenceFrames the referenceFrames value to set + * @return the H264Layer object itself. + */ + public H264Layer withReferenceFrames(Integer referenceFrames) { + this.referenceFrames = referenceFrames; + return this; + } + + /** + * Get the entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc'. + * + * @return the entropyMode value + */ + public EntropyMode entropyMode() { + return this.entropyMode; + } + + /** + * Set the entropy mode to be used for this layer. If not specified, the encoder chooses the mode that is appropriate for the profile and level. Possible values include: 'Cabac', 'Cavlc'. + * + * @param entropyMode the entropyMode value to set + * @return the H264Layer object itself. + */ + public H264Layer withEntropyMode(EntropyMode entropyMode) { + this.entropyMode = entropyMode; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Video.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Video.java new file mode 100644 index 000000000000..372c142ebc3d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264Video.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes all the properties for encoding a video with the H.264 codec. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.H264Video") +public class H264Video extends Video { + /** + * Whether or not the encoder should insert key frames at scene changes. If + * not specified, the default is false. This flag should be set to true + * only when the encoder is being configured to produce a single output + * video. + */ + @JsonProperty(value = "sceneChangeDetection") + private Boolean sceneChangeDetection; + + /** + * Tells the encoder how to choose its encoding settings. The default value + * is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. + */ + @JsonProperty(value = "complexity") + private H264Complexity complexity; + + /** + * The collection of output H.264 layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. + * + * @return the sceneChangeDetection value + */ + public Boolean sceneChangeDetection() { + return this.sceneChangeDetection; + } + + /** + * Set whether or not the encoder should insert key frames at scene changes. If not specified, the default is false. This flag should be set to true only when the encoder is being configured to produce a single output video. + * + * @param sceneChangeDetection the sceneChangeDetection value to set + * @return the H264Video object itself. + */ + public H264Video withSceneChangeDetection(Boolean sceneChangeDetection) { + this.sceneChangeDetection = sceneChangeDetection; + return this; + } + + /** + * Get tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. + * + * @return the complexity value + */ + public H264Complexity complexity() { + return this.complexity; + } + + /** + * Set tells the encoder how to choose its encoding settings. The default value is Balanced. Possible values include: 'Speed', 'Balanced', 'Quality'. + * + * @param complexity the complexity value to set + * @return the H264Video object itself. + */ + public H264Video withComplexity(H264Complexity complexity) { + this.complexity = complexity; + return this; + } + + /** + * Get the collection of output H.264 layers to be produced by the encoder. + * + * @return the layers value + */ + public List layers() { + return this.layers; + } + + /** + * Set the collection of output H.264 layers to be produced by the encoder. + * + * @param layers the layers value to set + * @return the H264Video object itself. + */ + public H264Video withLayers(List layers) { + this.layers = layers; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264VideoProfile.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264VideoProfile.java new file mode 100644 index 000000000000..5f3178cb92a0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/H264VideoProfile.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for H264VideoProfile. + */ +public enum H264VideoProfile { + /** Tells the encoder to automatically determine the appropriate H.264 profile. */ + AUTO("Auto"), + + /** Baseline profile. */ + BASELINE("Baseline"), + + /** Main profile. */ + MAIN("Main"), + + /** High profile. */ + HIGH("High"), + + /** High 4:2:2 profile. */ + HIGH422("High422"), + + /** High 4:4:4 predictive profile. */ + HIGH444("High444"); + + /** The actual serialized value for a H264VideoProfile instance. */ + private String value; + + H264VideoProfile(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a H264VideoProfile instance. + * + * @param value the serialized value to parse. + * @return the parsed H264VideoProfile object, or null if unable to parse. + */ + @JsonCreator + public static H264VideoProfile fromString(String value) { + H264VideoProfile[] items = H264VideoProfile.values(); + for (H264VideoProfile item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Hls.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Hls.java new file mode 100644 index 000000000000..84b7e8b40dde --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Hls.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HLS configuration. + */ +public class Hls { + /** + * The amount of fragments per HTTP Live Streaming (HLS) segment. + */ + @JsonProperty(value = "fragmentsPerTsSegment") + private Integer fragmentsPerTsSegment; + + /** + * Get the amount of fragments per HTTP Live Streaming (HLS) segment. + * + * @return the fragmentsPerTsSegment value + */ + public Integer fragmentsPerTsSegment() { + return this.fragmentsPerTsSegment; + } + + /** + * Set the amount of fragments per HTTP Live Streaming (HLS) segment. + * + * @param fragmentsPerTsSegment the fragmentsPerTsSegment value to set + * @return the Hls object itself. + */ + public Hls withFragmentsPerTsSegment(Integer fragmentsPerTsSegment) { + this.fragmentsPerTsSegment = fragmentsPerTsSegment; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPAccessControl.java new file mode 100644 index 000000000000..768d2a875d2c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPAccessControl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP access control. + */ +public class IPAccessControl { + /** + * The IP allow list. + */ + @JsonProperty(value = "allow") + private List allow; + + /** + * Get the IP allow list. + * + * @return the allow value + */ + public List allow() { + return this.allow; + } + + /** + * Set the IP allow list. + * + * @param allow the allow value to set + * @return the IPAccessControl object itself. + */ + public IPAccessControl withAllow(List allow) { + this.allow = allow; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPRange.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPRange.java new file mode 100644 index 000000000000..ce7c522c3392 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/IPRange.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP address range in the CIDR scheme. + */ +public class IPRange { + /** + * The friendly name for the IP address range. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The IP address. + */ + @JsonProperty(value = "address") + private String address; + + /** + * The subnet mask prefix length (see CIDR notation). + */ + @JsonProperty(value = "subnetPrefixLength") + private Integer subnetPrefixLength; + + /** + * Get the friendly name for the IP address range. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the friendly name for the IP address range. + * + * @param name the name value to set + * @return the IPRange object itself. + */ + public IPRange withName(String name) { + this.name = name; + return this; + } + + /** + * Get the IP address. + * + * @return the address value + */ + public String address() { + return this.address; + } + + /** + * Set the IP address. + * + * @param address the address value to set + * @return the IPRange object itself. + */ + public IPRange withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the subnet mask prefix length (see CIDR notation). + * + * @return the subnetPrefixLength value + */ + public Integer subnetPrefixLength() { + return this.subnetPrefixLength; + } + + /** + * Set the subnet mask prefix length (see CIDR notation). + * + * @param subnetPrefixLength the subnetPrefixLength value to set + * @return the IPRange object itself. + */ + public IPRange withSubnetPrefixLength(Integer subnetPrefixLength) { + this.subnetPrefixLength = subnetPrefixLength; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Image.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Image.java new file mode 100644 index 000000000000..da31483ebb56 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Image.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the basic properties for generating thumbnails from the input + * video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Image") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgImage", value = JpgImage.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngImage", value = PngImage.class) +}) +public class Image extends Video { + /** + * The position in the input video from where to start generating + * thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: + * PT05S), or a frame count (For example, 10 for the 10th frame), or a + * relative value (For example, 1%). Also supports a macro {Best}, which + * tells the encoder to select the best thumbnail from the first few + * seconds of the video. + */ + @JsonProperty(value = "start") + private String start; + + /** + * The intervals at which thumbnails are generated. The value can be in + * absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), + * or a frame count (For example, 30 for every 30 frames), or a relative + * value (For example, 1%). + */ + @JsonProperty(value = "step") + private String step; + + /** + * The position in the input video at which to stop generating thumbnails. + * The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop + * at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop + * at the 300th frame), or a relative value (For example, 100%). + */ + @JsonProperty(value = "range") + private String range; + + /** + * Get the position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. + * + * @return the start value + */ + public String start() { + return this.start; + } + + /** + * Set the position in the input video from where to start generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT05S), or a frame count (For example, 10 for the 10th frame), or a relative value (For example, 1%). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video. + * + * @param start the start value to set + * @return the Image object itself. + */ + public Image withStart(String start) { + this.start = start; + return this; + } + + /** + * Get the intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). + * + * @return the step value + */ + public String step() { + return this.step; + } + + /** + * Set the intervals at which thumbnails are generated. The value can be in absolute timestamp (ISO 8601, e.g: PT05S for one image every 5 seconds), or a frame count (For example, 30 for every 30 frames), or a relative value (For example, 1%). + * + * @param step the step value to set + * @return the Image object itself. + */ + public Image withStep(String step) { + this.step = step; + return this; + } + + /** + * Get the position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). + * + * @return the range value + */ + public String range() { + return this.range; + } + + /** + * Set the position in the input video at which to stop generating thumbnails. The value can be in absolute timestamp (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a frame count (For example, 300 to stop at the 300th frame), or a relative value (For example, 100%). + * + * @param range the range value to set + * @return the Image object itself. + */ + public Image withRange(String range) { + this.range = range; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ImageFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ImageFormat.java new file mode 100644 index 000000000000..a76ba06d071e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ImageFormat.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the properties for an output image file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.ImageFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgFormat", value = JpgFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngFormat", value = PngFormat.class) +}) +public class ImageFormat extends Format { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/InsightsType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/InsightsType.java new file mode 100644 index 000000000000..9cab233c0e33 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/InsightsType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for InsightsType. + */ +public enum InsightsType { + /** Generate audio only insights. Ignore video even if present. Fails if no audio is present. */ + AUDIO_INSIGHTS_ONLY("AudioInsightsOnly"), + + /** Generate video only insights. Ignore audio if present. Fails if no video is present. */ + VIDEO_INSIGHTS_ONLY("VideoInsightsOnly"), + + /** Generate both audio and video insights. Fails if either audio or video Insights fail. */ + ALL_INSIGHTS("AllInsights"); + + /** The actual serialized value for a InsightsType instance. */ + private String value; + + InsightsType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a InsightsType instance. + * + * @param value the serialized value to parse. + * @return the parsed InsightsType object, or null if unable to parse. + */ + @JsonCreator + public static InsightsType fromString(String value) { + InsightsType[] items = InsightsType.values(); + for (InsightsType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Job.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Job.java new file mode 100644 index 000000000000..cf3032c073fb --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Job.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.JobInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.DateTime; +import java.util.List; +import java.util.Map; + +/** + * Type representing Job. + */ +public interface Job extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the correlationData value. + */ + Map correlationData(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the input value. + */ + JobInput input(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputs value. + */ + List outputs(); + + /** + * @return the priority value. + */ + Priority priority(); + + /** + * @return the state value. + */ + JobState state(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Job definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithTransform, DefinitionStages.WithInput, DefinitionStages.WithOutputs, DefinitionStages.WithCreate { + } + + /** + * Grouping of Job definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Job definition. + */ + interface Blank extends WithTransform { + } + + /** + * The stage of the job definition allowing to specify Transform. + */ + interface WithTransform { + /** + * Specifies resourceGroupName, accountName, transformName. + */ + WithInput withExistingTransform(String resourceGroupName, String accountName, String transformName); + } + + /** + * The stage of the job definition allowing to specify Input. + */ + interface WithInput { + /** + * Specifies input. + */ + WithOutputs withInput(JobInput input); + } + + /** + * The stage of the job definition allowing to specify Outputs. + */ + interface WithOutputs { + /** + * Specifies outputs. + */ + WithCreate withOutputs(List outputs); + } + + /** + * The stage of the job definition allowing to specify CorrelationData. + */ + interface WithCorrelationData { + /** + * Specifies correlationData. + */ + WithCreate withCorrelationData(Map correlationData); + } + + /** + * The stage of the job definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the job definition allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + */ + WithCreate withPriority(Priority priority); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCorrelationData, DefinitionStages.WithDescription, DefinitionStages.WithPriority { + } + } + /** + * The template for a Job update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCorrelationData, UpdateStages.WithDescription, UpdateStages.WithPriority { + } + + /** + * Grouping of Job update stages. + */ + interface UpdateStages { + /** + * The stage of the job update allowing to specify CorrelationData. + */ + interface WithCorrelationData { + /** + * Specifies correlationData. + */ + Update withCorrelationData(Map correlationData); + } + + /** + * The stage of the job update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + Update withDescription(String description); + } + + /** + * The stage of the job update allowing to specify Priority. + */ + interface WithPriority { + /** + * Specifies priority. + */ + Update withPriority(Priority priority); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobError.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobError.java new file mode 100644 index 000000000000..61754e01728f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobError.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of JobOutput errors. + */ +public class JobError { + /** + * Error code describing the error. Possible values include: + * 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', + * 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', + * 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported'. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private JobErrorCode code; + + /** + * A human-readable language-dependent representation of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Helps with categorization of errors. Possible values include: 'Service', + * 'Download', 'Upload', 'Configuration', 'Content'. + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private JobErrorCategory category; + + /** + * Indicates that it may be possible to retry the Job. If retry is + * unsuccessful, please contact Azure support via Azure Portal. Possible + * values include: 'DoNotRetry', 'MayRetry'. + */ + @JsonProperty(value = "retry", access = JsonProperty.Access.WRITE_ONLY) + private JobRetry retry; + + /** + * An array of details about specific errors that led to this reported + * error. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Get error code describing the error. Possible values include: 'ServiceError', 'ServiceTransientError', 'DownloadNotAccessible', 'DownloadTransientError', 'UploadNotAccessible', 'UploadTransientError', 'ConfigurationUnsupported', 'ContentMalformed', 'ContentUnsupported'. + * + * @return the code value + */ + public JobErrorCode code() { + return this.code; + } + + /** + * Get a human-readable language-dependent representation of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get helps with categorization of errors. Possible values include: 'Service', 'Download', 'Upload', 'Configuration', 'Content'. + * + * @return the category value + */ + public JobErrorCategory category() { + return this.category; + } + + /** + * Get indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. Possible values include: 'DoNotRetry', 'MayRetry'. + * + * @return the retry value + */ + public JobRetry retry() { + return this.retry; + } + + /** + * Get an array of details about specific errors that led to this reported error. + * + * @return the details value + */ + public List details() { + return this.details; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCategory.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCategory.java new file mode 100644 index 000000000000..80ed5a269a78 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCategory.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobErrorCategory. + */ +public enum JobErrorCategory { + /** The error is service related. */ + SERVICE("Service"), + + /** The error is download related. */ + DOWNLOAD("Download"), + + /** The error is upload related. */ + UPLOAD("Upload"), + + /** The error is configuration related. */ + CONFIGURATION("Configuration"), + + /** The error is related to data in the input files. */ + CONTENT("Content"); + + /** The actual serialized value for a JobErrorCategory instance. */ + private String value; + + JobErrorCategory(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobErrorCategory instance. + * + * @param value the serialized value to parse. + * @return the parsed JobErrorCategory object, or null if unable to parse. + */ + @JsonCreator + public static JobErrorCategory fromString(String value) { + JobErrorCategory[] items = JobErrorCategory.values(); + for (JobErrorCategory item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCode.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCode.java new file mode 100644 index 000000000000..f98c797beb5f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorCode.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobErrorCode. + */ +public enum JobErrorCode { + /** Fatal service error, please contact support. */ + SERVICE_ERROR("ServiceError"), + + /** Transient error, please retry, if retry is unsuccessful, please contact support. */ + SERVICE_TRANSIENT_ERROR("ServiceTransientError"), + + /** While trying to download the input files, the files were not accessible, please check the availability of the source. */ + DOWNLOAD_NOT_ACCESSIBLE("DownloadNotAccessible"), + + /** While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source. */ + DOWNLOAD_TRANSIENT_ERROR("DownloadTransientError"), + + /** While trying to upload the output files, the destination was not reachable, please check the availability of the destination. */ + UPLOAD_NOT_ACCESSIBLE("UploadNotAccessible"), + + /** While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination. */ + UPLOAD_TRANSIENT_ERROR("UploadTransientError"), + + /** There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration. */ + CONFIGURATION_UNSUPPORTED("ConfigurationUnsupported"), + + /** There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files. */ + CONTENT_MALFORMED("ContentMalformed"), + + /** There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files. */ + CONTENT_UNSUPPORTED("ContentUnsupported"); + + /** The actual serialized value for a JobErrorCode instance. */ + private String value; + + JobErrorCode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobErrorCode instance. + * + * @param value the serialized value to parse. + * @return the parsed JobErrorCode object, or null if unable to parse. + */ + @JsonCreator + public static JobErrorCode fromString(String value) { + JobErrorCode[] items = JobErrorCode.values(); + for (JobErrorCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorDetail.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorDetail.java new file mode 100644 index 000000000000..1994c85e775f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobErrorDetail.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of JobOutput errors. + */ +public class JobErrorDetail { + /** + * Code describing the error detail. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * A human-readable representation of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get code describing the error detail. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get a human-readable representation of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInput.java new file mode 100644 index 000000000000..87d6d424a6e7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInput.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base class for inputs to a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("JobInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputClip", value = JobInputClip.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputs", value = JobInputs.class) +}) +public class JobInput { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputAsset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputAsset.java new file mode 100644 index 000000000000..471f36a5f141 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputAsset.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an Asset for input into a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputAsset") +public class JobInputAsset extends JobInputClip { + /** + * The name of the input Asset. + */ + @JsonProperty(value = "assetName", required = true) + private String assetName; + + /** + * Get the name of the input Asset. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the name of the input Asset. + * + * @param assetName the assetName value to set + * @return the JobInputAsset object itself. + */ + public JobInputAsset withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputClip.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputClip.java new file mode 100644 index 000000000000..5d487948ee56 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputClip.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Represents input files for a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputClip") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputAsset", value = JobInputAsset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputHttp", value = JobInputHttp.class) +}) +public class JobInputClip extends JobInput { + /** + * List of files. Required for JobInputHttp. + */ + @JsonProperty(value = "files") + private List files; + + /** + * A label that is assigned to a JobInputClip, that is used to satisfy a + * reference used in the Transform. For example, a Transform can be + * authored so as to take an image file with the label 'xyz' and apply it + * as an overlay onto the input video before it is encoded. When submitting + * a Job, exactly one of the JobInputs should be the image file, and it + * should have the label 'xyz'. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get list of files. Required for JobInputHttp. + * + * @return the files value + */ + public List files() { + return this.files; + } + + /** + * Set list of files. Required for JobInputHttp. + * + * @param files the files value to set + * @return the JobInputClip object itself. + */ + public JobInputClip withFiles(List files) { + this.files = files; + return this; + } + + /** + * Get a label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set a label that is assigned to a JobInputClip, that is used to satisfy a reference used in the Transform. For example, a Transform can be authored so as to take an image file with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When submitting a Job, exactly one of the JobInputs should be the image file, and it should have the label 'xyz'. + * + * @param label the label value to set + * @return the JobInputClip object itself. + */ + public JobInputClip withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputHttp.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputHttp.java new file mode 100644 index 000000000000..71d04fd88fe4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputHttp.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents HTTPS job input. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputHttp") +public class JobInputHttp extends JobInputClip { + /** + * Base URI for HTTPS job input. It will be concatenated with provided file + * names. If no base uri is given, then the provided file list is assumed + * to be fully qualified uris. + */ + @JsonProperty(value = "baseUri") + private String baseUri; + + /** + * Get base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. + * + * @return the baseUri value + */ + public String baseUri() { + return this.baseUri; + } + + /** + * Set base URI for HTTPS job input. It will be concatenated with provided file names. If no base uri is given, then the provided file list is assumed to be fully qualified uris. + * + * @param baseUri the baseUri value to set + * @return the JobInputHttp object itself. + */ + public JobInputHttp withBaseUri(String baseUri) { + this.baseUri = baseUri; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputs.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputs.java new file mode 100644 index 000000000000..881f802e5318 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobInputs.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a list of of inputs to a Job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobInputs") +public class JobInputs extends JobInput { + /** + * List of inputs to a Job. + */ + @JsonProperty(value = "inputs") + private List inputs; + + /** + * Get list of inputs to a Job. + * + * @return the inputs value + */ + public List inputs() { + return this.inputs; + } + + /** + * Set list of inputs to a Job. + * + * @param inputs the inputs value to set + * @return the JobInputs object itself. + */ + public JobInputs withInputs(List inputs) { + this.inputs = inputs; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutput.java new file mode 100644 index 000000000000..335c8559a91a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutput.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes all the properties of a JobOutput. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("JobOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobOutputAsset", value = JobOutputAsset.class) +}) +public class JobOutput { + /** + * If the JobOutput is in the Error state, it contains the details of the + * error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private JobError error; + + /** + * Describes the state of the JobOutput. Possible values include: + * 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', + * 'Scheduled'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private JobState state; + + /** + * If the JobOutput is in a Processing state, this contains the Job + * completion percentage. The value is an estimate and not intended to be + * used to predict Job completion times. To determine if the JobOutput is + * complete, use the State property. + */ + @JsonProperty(value = "progress", access = JsonProperty.Access.WRITE_ONLY) + private int progress; + + /** + * A label that is assigned to a JobOutput in order to help uniquely + * identify it. This is useful when your Transform has more than one + * TransformOutput, whereby your Job has more than one JobOutput. In such + * cases, when you submit the Job, you will add two or more JobOutputs, in + * the same order as TransformOutputs in the Transform. Subsequently, when + * you retrieve the Job, either through events or on a GET request, you can + * use the label to easily identify the JobOutput. If a label is not + * provided, a default value of '{presetName}_{outputIndex}' will be used, + * where the preset name is the name of the preset in the corresponding + * TransformOutput and the output index is the relative index of the this + * JobOutput within the Job. Note that this index is the same as the + * relative index of the corresponding TransformOutput within its + * Transform. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get if the JobOutput is in the Error state, it contains the details of the error. + * + * @return the error value + */ + public JobError error() { + return this.error; + } + + /** + * Get describes the state of the JobOutput. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + * + * @return the state value + */ + public JobState state() { + return this.state; + } + + /** + * Get if the JobOutput is in a Processing state, this contains the Job completion percentage. The value is an estimate and not intended to be used to predict Job completion times. To determine if the JobOutput is complete, use the State property. + * + * @return the progress value + */ + public int progress() { + return this.progress; + } + + /** + * Get a label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set a label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform. + * + * @param label the label value to set + * @return the JobOutput object itself. + */ + public JobOutput withLabel(String label) { + this.label = label; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutputAsset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutputAsset.java new file mode 100644 index 000000000000..1d07b4c86f7e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobOutputAsset.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Represents an Asset used as a JobOutput. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JobOutputAsset") +public class JobOutputAsset extends JobOutput { + /** + * The name of the output Asset. + */ + @JsonProperty(value = "assetName", required = true) + private String assetName; + + /** + * Get the name of the output Asset. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the name of the output Asset. + * + * @param assetName the assetName value to set + * @return the JobOutputAsset object itself. + */ + public JobOutputAsset withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobRetry.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobRetry.java new file mode 100644 index 000000000000..ee7995f3eb33 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobRetry.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobRetry. + */ +public enum JobRetry { + /** Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected. */ + DO_NOT_RETRY("DoNotRetry"), + + /** Issue may be resolved after waiting for a period of time and resubmitting the same Job. */ + MAY_RETRY("MayRetry"); + + /** The actual serialized value for a JobRetry instance. */ + private String value; + + JobRetry(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobRetry instance. + * + * @param value the serialized value to parse. + * @return the parsed JobRetry object, or null if unable to parse. + */ + @JsonCreator + public static JobRetry fromString(String value) { + JobRetry[] items = JobRetry.values(); + for (JobRetry item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobState.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobState.java new file mode 100644 index 000000000000..57f686d3a3b3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JobState.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobState. + */ +public enum JobState { + /** The job was canceled. This is a final state for the job. */ + CANCELED("Canceled"), + + /** The job is in the process of being canceled. This is a transient state for the job. */ + CANCELING("Canceling"), + + /** The job has encountered an error. This is a final state for the job. */ + ERROR("Error"), + + /** The job is finished. This is a final state for the job. */ + FINISHED("Finished"), + + /** The job is processing. This is a transient state for the job. */ + PROCESSING("Processing"), + + /** The job is in a queued state, waiting for resources to become available. This is a transient state. */ + QUEUED("Queued"), + + /** The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states. */ + SCHEDULED("Scheduled"); + + /** The actual serialized value for a JobState instance. */ + private String value; + + JobState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobState instance. + * + * @param value the serialized value to parse. + * @return the parsed JobState object, or null if unable to parse. + */ + @JsonCreator + public static JobState fromString(String value) { + JobState[] items = JobState.values(); + for (JobState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Jobs.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Jobs.java new file mode 100644 index 000000000000..a2ee4f7aa0f7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Jobs.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.JobsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Jobs. + */ +public interface Jobs extends SupportsCreating, HasInner { + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName, final String transformName); + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgFormat.java new file mode 100644 index 000000000000..28dc9bcdf32e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgFormat.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings for producing JPEG thumbnails. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JpgFormat") +public class JpgFormat extends ImageFormat { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgImage.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgImage.java new file mode 100644 index 000000000000..118f7868cbe3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgImage.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for producing a series of JPEG images from the + * input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JpgImage") +public class JpgImage extends Image { + /** + * A collection of output JPEG image layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get a collection of output JPEG image layers to be produced by the encoder. + * + * @return the layers value + */ + public List layers() { + return this.layers; + } + + /** + * Set a collection of output JPEG image layers to be produced by the encoder. + * + * @param layers the layers value to set + * @return the JpgImage object itself. + */ + public JpgImage withLayers(List layers) { + this.layers = layers; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgLayer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgLayer.java new file mode 100644 index 000000000000..7da9a93faa6d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/JpgLayer.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings to produce a JPEG image from the input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.JpgLayer") +public class JpgLayer extends Layer { + /** + * The compression quality of the JPEG output. Range is from 0-100 and the + * default is 70. + */ + @JsonProperty(value = "quality") + private Integer quality; + + /** + * Get the compression quality of the JPEG output. Range is from 0-100 and the default is 70. + * + * @return the quality value + */ + public Integer quality() { + return this.quality; + } + + /** + * Set the compression quality of the JPEG output. Range is from 0-100 and the default is 70. + * + * @param quality the quality value to set + * @return the JpgLayer object itself. + */ + public JpgLayer withQuality(Integer quality) { + this.quality = quality; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Layer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Layer.java new file mode 100644 index 000000000000..5a623bdd496c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Layer.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * 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. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Layer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoLayer", value = VideoLayer.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgLayer", value = JpgLayer.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngLayer", value = PngLayer.class) +}) +public class Layer { + /** + * 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. + */ + @JsonProperty(value = "width") + 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. + */ + @JsonProperty(value = "height") + 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. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get 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 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 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 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 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 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; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContainerSasInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContainerSasInput.java new file mode 100644 index 000000000000..6464abeb16f3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContainerSasInput.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to the list SAS request. + */ +public class ListContainerSasInput { + /** + * The permissions to set on the SAS URL. Possible values include: 'Read', + * 'ReadWrite', 'ReadWriteDelete'. + */ + @JsonProperty(value = "permissions") + private AssetContainerPermission permissions; + + /** + * The SAS URL expiration time. This must be less than 24 hours from the + * current time. + */ + @JsonProperty(value = "expiryTime") + private DateTime expiryTime; + + /** + * Get the permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete'. + * + * @return the permissions value + */ + public AssetContainerPermission permissions() { + return this.permissions; + } + + /** + * Set the permissions to set on the SAS URL. Possible values include: 'Read', 'ReadWrite', 'ReadWriteDelete'. + * + * @param permissions the permissions value to set + * @return the ListContainerSasInput object itself. + */ + public ListContainerSasInput withPermissions(AssetContainerPermission permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the SAS URL expiration time. This must be less than 24 hours from the current time. + * + * @return the expiryTime value + */ + public DateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the SAS URL expiration time. This must be less than 24 hours from the current time. + * + * @param expiryTime the expiryTime value to set + * @return the ListContainerSasInput object itself. + */ + public ListContainerSasInput withExpiryTime(DateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContentKeysResponse.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContentKeysResponse.java new file mode 100644 index 000000000000..d8859c213b16 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListContentKeysResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ListContentKeysResponseInner; +import java.util.List; + +/** + * Type representing ListContentKeysResponse. + */ +public interface ListContentKeysResponse extends HasInner, HasManager { + /** + * @return the contentKeys value. + */ + List contentKeys(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListPathsResponse.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListPathsResponse.java new file mode 100644 index 000000000000..add01e3e9e0f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListPathsResponse.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ListPathsResponseInner; +import java.util.List; + +/** + * Type representing ListPathsResponse. + */ +public interface ListPathsResponse extends HasInner, HasManager { + /** + * @return the downloadPaths value. + */ + List downloadPaths(); + + /** + * @return the streamingPaths value. + */ + List streamingPaths(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListStreamingLocatorsResponse.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListStreamingLocatorsResponse.java new file mode 100644 index 000000000000..6ecec1cbb6b7 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ListStreamingLocatorsResponse.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.ListStreamingLocatorsResponseInner; +import java.util.List; + +/** + * Type representing ListStreamingLocatorsResponse. + */ +public interface ListStreamingLocatorsResponse extends HasInner, HasManager { + /** + * @return the streamingLocators value. + */ + List streamingLocators(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvent.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvent.java new file mode 100644 index 000000000000..a3cc21930557 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvent.java @@ -0,0 +1,323 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LiveEventInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.Map; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing LiveEvent. + */ +public interface LiveEvent extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the crossSiteAccessPolicies value. + */ + CrossSiteAccessPolicies crossSiteAccessPolicies(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the encoding value. + */ + LiveEventEncoding encoding(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the input value. + */ + LiveEventInput input(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the preview value. + */ + LiveEventPreview preview(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + LiveEventResourceState resourceState(); + + /** + * @return the streamOptions value. + */ + List streamOptions(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the vanityUrl value. + */ + Boolean vanityUrl(); + + /** + * The entirety of the LiveEvent definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithInput, DefinitionStages.WithCreate { + } + + /** + * Grouping of LiveEvent definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LiveEvent definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the liveevent definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + */ + WithInput withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the liveevent definition allowing to specify Input. + */ + interface WithInput { + /** + * Specifies input. + */ + WithCreate withInput(LiveEventInput input); + } + + /** + * The stage of the liveevent definition allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + */ + WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the liveevent definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the liveevent definition allowing to specify Encoding. + */ + interface WithEncoding { + /** + * Specifies encoding. + */ + WithCreate withEncoding(LiveEventEncoding encoding); + } + + /** + * The stage of the liveevent definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the liveevent definition allowing to specify Preview. + */ + interface WithPreview { + /** + * Specifies preview. + */ + WithCreate withPreview(LiveEventPreview preview); + } + + /** + * The stage of the liveevent definition allowing to specify StreamOptions. + */ + interface WithStreamOptions { + /** + * Specifies streamOptions. + */ + WithCreate withStreamOptions(List streamOptions); + } + + /** + * The stage of the liveevent definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the liveevent definition allowing to specify VanityUrl. + */ + interface WithVanityUrl { + /** + * Specifies vanityUrl. + */ + WithCreate withVanityUrl(Boolean vanityUrl); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCrossSiteAccessPolicies, DefinitionStages.WithDescription, DefinitionStages.WithEncoding, DefinitionStages.WithLocation, DefinitionStages.WithPreview, DefinitionStages.WithStreamOptions, DefinitionStages.WithTags, DefinitionStages.WithVanityUrl { + } + } + /** + * The template for a LiveEvent update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCrossSiteAccessPolicies, UpdateStages.WithDescription, UpdateStages.WithEncoding, UpdateStages.WithLocation, UpdateStages.WithPreview, UpdateStages.WithStreamOptions, UpdateStages.WithTags, UpdateStages.WithVanityUrl { + } + + /** + * Grouping of LiveEvent update stages. + */ + interface UpdateStages { + /** + * The stage of the liveevent update allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + */ + Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the liveevent update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + Update withDescription(String description); + } + + /** + * The stage of the liveevent update allowing to specify Encoding. + */ + interface WithEncoding { + /** + * Specifies encoding. + */ + Update withEncoding(LiveEventEncoding encoding); + } + + /** + * The stage of the liveevent update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + Update withLocation(String location); + } + + /** + * The stage of the liveevent update allowing to specify Preview. + */ + interface WithPreview { + /** + * Specifies preview. + */ + Update withPreview(LiveEventPreview preview); + } + + /** + * The stage of the liveevent update allowing to specify StreamOptions. + */ + interface WithStreamOptions { + /** + * Specifies streamOptions. + */ + Update withStreamOptions(List streamOptions); + } + + /** + * The stage of the liveevent update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + /** + * The stage of the liveevent update allowing to specify VanityUrl. + */ + interface WithVanityUrl { + /** + * Specifies vanityUrl. + */ + Update withVanityUrl(Boolean vanityUrl); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventActionInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventActionInput.java new file mode 100644 index 000000000000..06e11a34a4e4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventActionInput.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LiveEvent action input parameter definition. + */ +public class LiveEventActionInput { + /** + * The flag indicates if remove LiveOutputs on Stop. + */ + @JsonProperty(value = "removeOutputsOnStop") + private Boolean removeOutputsOnStop; + + /** + * Get the flag indicates if remove LiveOutputs on Stop. + * + * @return the removeOutputsOnStop value + */ + public Boolean removeOutputsOnStop() { + return this.removeOutputsOnStop; + } + + /** + * Set the flag indicates if remove LiveOutputs on Stop. + * + * @param removeOutputsOnStop the removeOutputsOnStop value to set + * @return the LiveEventActionInput object itself. + */ + public LiveEventActionInput withRemoveOutputsOnStop(Boolean removeOutputsOnStop) { + this.removeOutputsOnStop = removeOutputsOnStop; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncoding.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncoding.java new file mode 100644 index 000000000000..a97cbad89462 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncoding.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event encoding. + */ +public class LiveEventEncoding { + /** + * The encoding type for Live Event. This value is specified at creation + * time and cannot be updated. Possible values include: 'None', 'Basic'. + */ + @JsonProperty(value = "encodingType") + private LiveEventEncodingType encodingType; + + /** + * The encoding preset name. This value is specified at creation time and + * cannot be updated. + */ + @JsonProperty(value = "presetName") + private String presetName; + + /** + * Get the encoding type for Live Event. This value is specified at creation time and cannot be updated. Possible values include: 'None', 'Basic'. + * + * @return the encodingType value + */ + public LiveEventEncodingType encodingType() { + return this.encodingType; + } + + /** + * Set the encoding type for Live Event. This value is specified at creation time and cannot be updated. Possible values include: 'None', 'Basic'. + * + * @param encodingType the encodingType value to set + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withEncodingType(LiveEventEncodingType encodingType) { + this.encodingType = encodingType; + return this; + } + + /** + * Get the encoding preset name. This value is specified at creation time and cannot be updated. + * + * @return the presetName value + */ + public String presetName() { + return this.presetName; + } + + /** + * Set the encoding preset name. This value is specified at creation time and cannot be updated. + * + * @param presetName the presetName value to set + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withPresetName(String presetName) { + this.presetName = presetName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncodingType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncodingType.java new file mode 100644 index 000000000000..a3d42eeede63 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEncodingType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveEventEncodingType. + */ +public enum LiveEventEncodingType { + /** Enum value None. */ + NONE("None"), + + /** Enum value Basic. */ + BASIC("Basic"); + + /** The actual serialized value for a LiveEventEncodingType instance. */ + private String value; + + LiveEventEncodingType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveEventEncodingType instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveEventEncodingType object, or null if unable to parse. + */ + @JsonCreator + public static LiveEventEncodingType fromString(String value) { + LiveEventEncodingType[] items = LiveEventEncodingType.values(); + for (LiveEventEncodingType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEndpoint.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEndpoint.java new file mode 100644 index 000000000000..df202c3215c4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventEndpoint.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event endpoint. + */ +public class LiveEventEndpoint { + /** + * The endpoint protocol. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * The endpoint URL. + */ + @JsonProperty(value = "url") + private String url; + + /** + * Get the endpoint protocol. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the endpoint protocol. + * + * @param protocol the protocol value to set + * @return the LiveEventEndpoint object itself. + */ + public LiveEventEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the endpoint URL. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the endpoint URL. + * + * @param url the url value to set + * @return the LiveEventEndpoint object itself. + */ + public LiveEventEndpoint withUrl(String url) { + this.url = url; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInput.java new file mode 100644 index 000000000000..89963cd75e8a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInput.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event input. + */ +public class LiveEventInput { + /** + * The streaming protocol for the Live Event. This is specified at + * creation time and cannot be updated. Possible values include: + * 'FragmentedMP4', 'RTMP'. + */ + @JsonProperty(value = "streamingProtocol", required = true) + private LiveEventInputProtocol streamingProtocol; + + /** + * The access control for LiveEvent Input. + */ + @JsonProperty(value = "accessControl") + private LiveEventInputAccessControl accessControl; + + /** + * ISO 8601 timespan duration of the key frame interval duration. + */ + @JsonProperty(value = "keyFrameIntervalDuration") + private String keyFrameIntervalDuration; + + /** + * A unique identifier for a stream. This can be specified at creation + * time but cannot be updated. If omitted, the service will generate a + * unique value. + */ + @JsonProperty(value = "accessToken") + private String accessToken; + + /** + * The input endpoints for the Live Event. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * Get the streaming protocol for the Live Event. This is specified at creation time and cannot be updated. Possible values include: 'FragmentedMP4', 'RTMP'. + * + * @return the streamingProtocol value + */ + public LiveEventInputProtocol streamingProtocol() { + return this.streamingProtocol; + } + + /** + * Set the streaming protocol for the Live Event. This is specified at creation time and cannot be updated. Possible values include: 'FragmentedMP4', 'RTMP'. + * + * @param streamingProtocol the streamingProtocol value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withStreamingProtocol(LiveEventInputProtocol streamingProtocol) { + this.streamingProtocol = streamingProtocol; + return this; + } + + /** + * Get the access control for LiveEvent Input. + * + * @return the accessControl value + */ + public LiveEventInputAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the access control for LiveEvent Input. + * + * @param accessControl the accessControl value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withAccessControl(LiveEventInputAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get iSO 8601 timespan duration of the key frame interval duration. + * + * @return the keyFrameIntervalDuration value + */ + public String keyFrameIntervalDuration() { + return this.keyFrameIntervalDuration; + } + + /** + * Set iSO 8601 timespan duration of the key frame interval duration. + * + * @param keyFrameIntervalDuration the keyFrameIntervalDuration value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withKeyFrameIntervalDuration(String keyFrameIntervalDuration) { + this.keyFrameIntervalDuration = keyFrameIntervalDuration; + return this; + } + + /** + * Get a unique identifier for a stream. This can be specified at creation time but cannot be updated. If omitted, the service will generate a unique value. + * + * @return the accessToken value + */ + public String accessToken() { + return this.accessToken; + } + + /** + * Set a unique identifier for a stream. This can be specified at creation time but cannot be updated. If omitted, the service will generate a unique value. + * + * @param accessToken the accessToken value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withAccessToken(String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get the input endpoints for the Live Event. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the input endpoints for the Live Event. + * + * @param endpoints the endpoints value to set + * @return the LiveEventInput object itself. + */ + public LiveEventInput withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputAccessControl.java new file mode 100644 index 000000000000..a2eb0847a5d5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputAccessControl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP access control for Live Event Input. + */ +public class LiveEventInputAccessControl { + /** + * The IP access control properties. + */ + @JsonProperty(value = "ip") + private IPAccessControl ip; + + /** + * Get the IP access control properties. + * + * @return the ip value + */ + public IPAccessControl ip() { + return this.ip; + } + + /** + * Set the IP access control properties. + * + * @param ip the ip value to set + * @return the LiveEventInputAccessControl object itself. + */ + public LiveEventInputAccessControl withIp(IPAccessControl ip) { + this.ip = ip; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputProtocol.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputProtocol.java new file mode 100644 index 000000000000..7beb4d75c648 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventInputProtocol.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveEventInputProtocol. + */ +public enum LiveEventInputProtocol { + /** Enum value FragmentedMP4. */ + FRAGMENTED_MP4("FragmentedMP4"), + + /** Enum value RTMP. */ + RTMP("RTMP"); + + /** The actual serialized value for a LiveEventInputProtocol instance. */ + private String value; + + LiveEventInputProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveEventInputProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveEventInputProtocol object, or null if unable to parse. + */ + @JsonCreator + public static LiveEventInputProtocol fromString(String value) { + LiveEventInputProtocol[] items = LiveEventInputProtocol.values(); + for (LiveEventInputProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreview.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreview.java new file mode 100644 index 000000000000..a44c01d19e50 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreview.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Live Event preview. + */ +public class LiveEventPreview { + /** + * The endpoints for preview. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * The access control for LiveEvent preview. + */ + @JsonProperty(value = "accessControl") + private LiveEventPreviewAccessControl accessControl; + + /** + * The identifier of the preview locator in Guid format. Specifying this + * at creation time allows the caller to know the preview locator url + * before the event is created. If omitted, the service will generate a + * random identifier. This value cannot be updated once the live event is + * created. + */ + @JsonProperty(value = "previewLocator") + private String previewLocator; + + /** + * The name of streaming policy used for the LiveEvent preview. This value + * is specified at creation time and cannot be updated. + */ + @JsonProperty(value = "streamingPolicyName") + private String streamingPolicyName; + + /** + * An Alternative Media Identifier associated with the StreamingLocator + * created for the preview. This value is specified at creation time and + * cannot be updated. The identifier can be used in the + * CustomLicenseAcquisitionUrlTemplate or the + * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the + * StreamingPolicyName field. + */ + @JsonProperty(value = "alternativeMediaId") + private String alternativeMediaId; + + /** + * Get the endpoints for preview. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints for preview. + * + * @param endpoints the endpoints value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the access control for LiveEvent preview. + * + * @return the accessControl value + */ + public LiveEventPreviewAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the access control for LiveEvent preview. + * + * @param accessControl the accessControl value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withAccessControl(LiveEventPreviewAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get the identifier of the preview locator in Guid format. Specifying this at creation time allows the caller to know the preview locator url before the event is created. If omitted, the service will generate a random identifier. This value cannot be updated once the live event is created. + * + * @return the previewLocator value + */ + public String previewLocator() { + return this.previewLocator; + } + + /** + * Set the identifier of the preview locator in Guid format. Specifying this at creation time allows the caller to know the preview locator url before the event is created. If omitted, the service will generate a random identifier. This value cannot be updated once the live event is created. + * + * @param previewLocator the previewLocator value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withPreviewLocator(String previewLocator) { + this.previewLocator = previewLocator; + return this; + } + + /** + * Get the name of streaming policy used for the LiveEvent preview. This value is specified at creation time and cannot be updated. + * + * @return the streamingPolicyName value + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Set the name of streaming policy used for the LiveEvent preview. This value is specified at creation time and cannot be updated. + * + * @param streamingPolicyName the streamingPolicyName value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withStreamingPolicyName(String streamingPolicyName) { + this.streamingPolicyName = streamingPolicyName; + return this; + } + + /** + * Get an Alternative Media Identifier associated with the StreamingLocator created for the preview. This value is specified at creation time and cannot be updated. The identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field. + * + * @return the alternativeMediaId value + */ + public String alternativeMediaId() { + return this.alternativeMediaId; + } + + /** + * Set an Alternative Media Identifier associated with the StreamingLocator created for the preview. This value is specified at creation time and cannot be updated. The identifier can be used in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field. + * + * @param alternativeMediaId the alternativeMediaId value to set + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withAlternativeMediaId(String alternativeMediaId) { + this.alternativeMediaId = alternativeMediaId; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreviewAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreviewAccessControl.java new file mode 100644 index 000000000000..cfea5dd674ea --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventPreviewAccessControl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IP access control for Live Event preview. + */ +public class LiveEventPreviewAccessControl { + /** + * The IP access control properties. + */ + @JsonProperty(value = "ip") + private IPAccessControl ip; + + /** + * Get the IP access control properties. + * + * @return the ip value + */ + public IPAccessControl ip() { + return this.ip; + } + + /** + * Set the IP access control properties. + * + * @param ip the ip value to set + * @return the LiveEventPreviewAccessControl object itself. + */ + public LiveEventPreviewAccessControl withIp(IPAccessControl ip) { + this.ip = ip; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventResourceState.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventResourceState.java new file mode 100644 index 000000000000..8e0f75fb89e3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEventResourceState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveEventResourceState. + */ +public enum LiveEventResourceState { + /** Enum value Stopped. */ + STOPPED("Stopped"), + + /** Enum value Starting. */ + STARTING("Starting"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Stopping. */ + STOPPING("Stopping"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a LiveEventResourceState instance. */ + private String value; + + LiveEventResourceState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveEventResourceState instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveEventResourceState object, or null if unable to parse. + */ + @JsonCreator + public static LiveEventResourceState fromString(String value) { + LiveEventResourceState[] items = LiveEventResourceState.values(); + for (LiveEventResourceState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvents.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvents.java new file mode 100644 index 000000000000..7133b972a395 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveEvents.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LiveEventsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LiveEvents. + */ +public interface LiveEvents extends SupportsCreating, HasInner { + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resetAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String liveEventName); + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutput.java new file mode 100644 index 000000000000..42d6861e9527 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutput.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LiveOutputInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.Period; +import org.joda.time.DateTime; + +/** + * Type representing LiveOutput. + */ +public interface LiveOutput extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the archiveWindowLength value. + */ + Period archiveWindowLength(); + + /** + * @return the assetName value. + */ + String assetName(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the hls value. + */ + Hls hls(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the manifestName value. + */ + String manifestName(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputSnapTime value. + */ + Long outputSnapTime(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + LiveOutputResourceState resourceState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the LiveOutput definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLiveEvent, DefinitionStages.WithArchiveWindowLength, DefinitionStages.WithAssetName, DefinitionStages.WithCreate { + } + + /** + * Grouping of LiveOutput definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LiveOutput definition. + */ + interface Blank extends WithLiveEvent { + } + + /** + * The stage of the liveoutput definition allowing to specify LiveEvent. + */ + interface WithLiveEvent { + /** + * Specifies resourceGroupName, accountName, liveEventName. + */ + WithArchiveWindowLength withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName); + } + + /** + * The stage of the liveoutput definition allowing to specify ArchiveWindowLength. + */ + interface WithArchiveWindowLength { + /** + * Specifies archiveWindowLength. + */ + WithAssetName withArchiveWindowLength(Period archiveWindowLength); + } + + /** + * The stage of the liveoutput definition allowing to specify AssetName. + */ + interface WithAssetName { + /** + * Specifies assetName. + */ + WithCreate withAssetName(String assetName); + } + + /** + * The stage of the liveoutput definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the liveoutput definition allowing to specify Hls. + */ + interface WithHls { + /** + * Specifies hls. + */ + WithCreate withHls(Hls hls); + } + + /** + * The stage of the liveoutput definition allowing to specify ManifestName. + */ + interface WithManifestName { + /** + * Specifies manifestName. + */ + WithCreate withManifestName(String manifestName); + } + + /** + * The stage of the liveoutput definition allowing to specify OutputSnapTime. + */ + interface WithOutputSnapTime { + /** + * Specifies outputSnapTime. + */ + WithCreate withOutputSnapTime(Long outputSnapTime); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription, DefinitionStages.WithHls, DefinitionStages.WithManifestName, DefinitionStages.WithOutputSnapTime { + } + } + /** + * The template for a LiveOutput update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription, UpdateStages.WithHls, UpdateStages.WithManifestName, UpdateStages.WithOutputSnapTime { + } + + /** + * Grouping of LiveOutput update stages. + */ + interface UpdateStages { + /** + * The stage of the liveoutput update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + Update withDescription(String description); + } + + /** + * The stage of the liveoutput update allowing to specify Hls. + */ + interface WithHls { + /** + * Specifies hls. + */ + Update withHls(Hls hls); + } + + /** + * The stage of the liveoutput update allowing to specify ManifestName. + */ + interface WithManifestName { + /** + * Specifies manifestName. + */ + Update withManifestName(String manifestName); + } + + /** + * The stage of the liveoutput update allowing to specify OutputSnapTime. + */ + interface WithOutputSnapTime { + /** + * Specifies outputSnapTime. + */ + Update withOutputSnapTime(Long outputSnapTime); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputResourceState.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputResourceState.java new file mode 100644 index 000000000000..8a3b4e2b6580 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputResourceState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for LiveOutputResourceState. + */ +public enum LiveOutputResourceState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a LiveOutputResourceState instance. */ + private String value; + + LiveOutputResourceState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LiveOutputResourceState instance. + * + * @param value the serialized value to parse. + * @return the parsed LiveOutputResourceState object, or null if unable to parse. + */ + @JsonCreator + public static LiveOutputResourceState fromString(String value) { + LiveOutputResourceState[] items = LiveOutputResourceState.values(); + for (LiveOutputResourceState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputs.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputs.java new file mode 100644 index 000000000000..4c06ce4b560e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/LiveOutputs.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LiveOutputsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LiveOutputs. + */ +public interface LiveOutputs extends SupportsCreating, HasInner { + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName, final String liveEventName); + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Locations.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Locations.java new file mode 100644 index 000000000000..370c6da70231 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Locations.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.LocationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Locations. + */ +public interface Locations extends HasInner { + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MediaService.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MediaService.java new file mode 100644 index 000000000000..bf5b73d16ad1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MediaService.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaServiceInner; + +/** + * Type representing MediaService. + */ +public interface MediaService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the mediaServiceId value. + */ + UUID mediaServiceId(); + + /** + * @return the storageAccounts value. + */ + List storageAccounts(); + + /** + * The entirety of the MediaService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of MediaService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MediaService definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the MediaService definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the mediaservice update allowing to specify StorageAccounts. + */ + interface WithStorageAccounts { + /** + * Specifies storageAccounts. + */ + WithCreate withStorageAccounts(List storageAccounts); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithStorageAccounts { + } + } + /** + * The template for a MediaService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithStorageAccounts { + } + + /** + * Grouping of MediaService update stages. + */ + interface UpdateStages { + /** + * The stage of the mediaservice {0} allowing to specify StorageAccounts. + */ + interface WithStorageAccounts { + /** + * Specifies storageAccounts. + */ + Update withStorageAccounts(List storageAccounts); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mediaservices.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mediaservices.java new file mode 100644 index 000000000000..b7fef66a027a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mediaservices.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaservicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Mediaservices. + */ +public interface Mediaservices extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable syncStorageKeysAsync(String resourceGroupName, String accountName); + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBySubscriptionAsync(String accountName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Metric.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Metric.java new file mode 100644 index 000000000000..4ea532380ced --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Metric.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric emitted by service. + */ +public class Metric { + /** + * The metric name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The metric display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * The metric display description. + */ + @JsonProperty(value = "displayDescription", access = JsonProperty.Access.WRITE_ONLY) + private String displayDescription; + + /** + * The metric unit. Possible values include: 'Bytes', 'Count', + * 'Milliseconds'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private MetricUnit unit; + + /** + * The metric aggregation type. Possible values include: 'Average', + * 'Count', 'Total'. + */ + @JsonProperty(value = "aggregationType", access = JsonProperty.Access.WRITE_ONLY) + private MetricAggregationType aggregationType; + + /** + * The metric dimensions. + */ + @JsonProperty(value = "dimensions", access = JsonProperty.Access.WRITE_ONLY) + private List dimensions; + + /** + * Get the metric name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the metric display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the metric display description. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Get the metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + * + * @return the unit value + */ + public MetricUnit unit() { + return this.unit; + } + + /** + * Get the metric aggregation type. Possible values include: 'Average', 'Count', 'Total'. + * + * @return the aggregationType value + */ + public MetricAggregationType aggregationType() { + return this.aggregationType; + } + + /** + * Get the metric dimensions. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricAggregationType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricAggregationType.java new file mode 100644 index 000000000000..46af6201497f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricAggregationType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MetricAggregationType. + */ +public enum MetricAggregationType { + /** The average. */ + AVERAGE("Average"), + + /** The count of a number of items, usually requests. */ + COUNT("Count"), + + /** The sum. */ + TOTAL("Total"); + + /** The actual serialized value for a MetricAggregationType instance. */ + private String value; + + MetricAggregationType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MetricAggregationType instance. + * + * @param value the serialized value to parse. + * @return the parsed MetricAggregationType object, or null if unable to parse. + */ + @JsonCreator + public static MetricAggregationType fromString(String value) { + MetricAggregationType[] items = MetricAggregationType.values(); + for (MetricAggregationType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricDimension.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricDimension.java new file mode 100644 index 000000000000..309c07a84ea4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricDimension.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric dimension. + */ +public class MetricDimension { + /** + * The metric dimension name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display name for the dimension. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Whether to export metric to shoebox. + */ + @JsonProperty(value = "toBeExportedForShoebox", access = JsonProperty.Access.WRITE_ONLY) + private boolean toBeExportedForShoebox; + + /** + * Get the metric dimension name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display name for the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get whether to export metric to shoebox. + * + * @return the toBeExportedForShoebox value + */ + public boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricProperties.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricProperties.java new file mode 100644 index 000000000000..a4f5f2442e91 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricProperties.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric properties. + */ +public class MetricProperties { + /** + * The service specifications. + */ + @JsonProperty(value = "serviceSpecification", access = JsonProperty.Access.WRITE_ONLY) + private ServiceSpecification serviceSpecification; + + /** + * Get the service specifications. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricUnit.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricUnit.java new file mode 100644 index 000000000000..02d2259f4c3b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MetricUnit.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MetricUnit. + */ +public enum MetricUnit { + /** The number of bytes. */ + BYTES("Bytes"), + + /** The count. */ + COUNT("Count"), + + /** The number of milliseconds. */ + MILLISECONDS("Milliseconds"); + + /** The actual serialized value for a MetricUnit instance. */ + private String value; + + MetricUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MetricUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed MetricUnit object, or null if unable to parse. + */ + @JsonCreator + public static MetricUnit fromString(String value) { + MetricUnit[] items = MetricUnit.values(); + for (MetricUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mp4Format.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mp4Format.java new file mode 100644 index 000000000000..09015d97b5a2 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Mp4Format.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for an output ISO MP4 file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Mp4Format") +public class Mp4Format extends MultiBitrateFormat { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MultiBitrateFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MultiBitrateFormat.java new file mode 100644 index 000000000000..923d1935e660 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/MultiBitrateFormat.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the properties for producing a collection of GOP aligned + * multi-bitrate files. The default behavior is to produce one output file for + * each video layer which is muxed together with all the audios. The exact + * output files produced can be controlled by specifying the outputFiles + * collection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.MultiBitrateFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Mp4Format", value = Mp4Format.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.TransportStreamFormat", value = TransportStreamFormat.class) +}) +public class MultiBitrateFormat extends Format { + /** + * The list of output files to produce. Each entry in the list is a set of + * audio and video layer labels to be muxed together . + */ + @JsonProperty(value = "outputFiles") + private List outputFiles; + + /** + * Get the list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . + * + * @return the outputFiles value + */ + public List outputFiles() { + return this.outputFiles; + } + + /** + * Set the list of output files to produce. Each entry in the list is a set of audio and video layer labels to be muxed together . + * + * @param outputFiles the outputFiles value to set + * @return the MultiBitrateFormat object itself. + */ + public MultiBitrateFormat withOutputFiles(List outputFiles) { + this.outputFiles = outputFiles; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/NoEncryption.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/NoEncryption.java new file mode 100644 index 000000000000..841179ab89b4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/NoEncryption.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for NoEncryption scheme. + */ +public class NoEncryption { + /** + * Representing supported protocols. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Get representing supported protocols. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set representing supported protocols. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the NoEncryption object itself. + */ + public NoEncryption withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ODataError.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ODataError.java new file mode 100644 index 000000000000..89dd1b158601 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ODataError.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about an error. + */ +public class ODataError { + /** + * A language-independent error name. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target of the error (for example, the name of the property in + * error). + */ + @JsonProperty(value = "target") + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get a language-independent error name. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set a language-independent error name. + * + * @param code the code value to set + * @return the ODataError object itself. + */ + public ODataError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the ODataError object itself. + */ + public ODataError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target of the error (for example, the name of the property in error). + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target of the error (for example, the name of the property in error). + * + * @param target the target value to set + * @return the ODataError object itself. + */ + public ODataError withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the error details. + * + * @param details the details value to set + * @return the ODataError object itself. + */ + public ODataError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OnErrorType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OnErrorType.java new file mode 100644 index 000000000000..e1a82fea5109 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OnErrorType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OnErrorType. + */ +public enum OnErrorType { + /** Tells the service that if this TransformOutput fails, then any other incomplete TransformOutputs can be stopped. */ + STOP_PROCESSING_JOB("StopProcessingJob"), + + /** Tells the service that if this TransformOutput fails, then allow any other TransformOutput to continue. */ + CONTINUE_JOB("ContinueJob"); + + /** The actual serialized value for a OnErrorType instance. */ + private String value; + + OnErrorType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OnErrorType instance. + * + * @param value the serialized value to parse. + * @return the parsed OnErrorType object, or null if unable to parse. + */ + @JsonCreator + public static OnErrorType fromString(String value) { + OnErrorType[] items = OnErrorType.values(); + for (OnErrorType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operation.java new file mode 100644 index 000000000000..225fd4e8de14 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + MetricProperties properties(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OperationDisplay.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OperationDisplay.java new file mode 100644 index 000000000000..88347d582927 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation details. + */ +public class OperationDisplay { + /** + * The service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation type. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the service provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the service provider. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation type. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation type. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the operation description. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operations.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operations.java new file mode 100644 index 000000000000..0205807425e3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Operations.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OutputFile.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OutputFile.java new file mode 100644 index 000000000000..3f9f7e34556d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/OutputFile.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents an output file produced. + */ +public class OutputFile { + /** + * The list of labels that describe how the encoder should multiplex video + * and audio into an output file. For example, if the encoder is producing + * two video layers with labels v1 and v2, and one audio layer with label + * a1, then an array like '[v1, a1]' tells the encoder to produce an output + * file with the video track represented by v1 and the audio track + * represented by a1. + */ + @JsonProperty(value = "labels") + private List labels; + + /** + * Get the list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set the list of labels that describe how the encoder should multiplex video and audio into an output file. For example, if the encoder is producing two video layers with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells the encoder to produce an output file with the video track represented by v1 and the audio track represented by a1. + * + * @param labels the labels value to set + * @return the OutputFile object itself. + */ + public OutputFile withLabels(List labels) { + this.labels = labels; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Overlay.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Overlay.java new file mode 100644 index 000000000000..6926b28bb211 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Overlay.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base type for all overlays - image, audio or video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Overlay") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AudioOverlay", value = AudioOverlay.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoOverlay", value = VideoOverlay.class) +}) +public class Overlay { + /** + * The label of the job input which is to be used as an overlay. The Input + * must specify exactly one file. You can specify an image file in JPG or + * PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or + * a video file. See https://aka.ms/mesformats for the complete list of + * supported audio and video file formats. + */ + @JsonProperty(value = "inputLabel") + private String inputLabel; + + /** + * The start position, with reference to the input video, at which the + * overlay starts. The value should be in ISO 8601 format. For example, + * PT05S to start the overlay at 5 seconds in to the input video. If not + * specified the overlay starts from the beginning of the input video. + */ + @JsonProperty(value = "start") + private Period start; + + /** + * The position in the input video at which the overlay ends. The value + * should be in ISO 8601 duration format. For example, PT30S to end the + * overlay at 30 seconds in to the input video. If not specified the + * overlay will be applied until the end of the input video if inputLoop is + * true. Else, if inputLoop is false, then overlay will last as long as the + * duration of the overlay media. + */ + @JsonProperty(value = "end") + private Period end; + + /** + * The duration over which the overlay fades in onto the input video. The + * value should be in ISO 8601 duration format. If not specified the + * default behavior is to have no fade in (same as PT0S). + */ + @JsonProperty(value = "fadeInDuration") + private Period fadeInDuration; + + /** + * The duration over which the overlay fades out of the input video. The + * value should be in ISO 8601 duration format. If not specified the + * default behavior is to have no fade out (same as PT0S). + */ + @JsonProperty(value = "fadeOutDuration") + private Period fadeOutDuration; + + /** + * The gain level of audio in the overlay. The value should be in the range + * [0, 1.0]. The default is 1.0. + */ + @JsonProperty(value = "audioGainLevel") + private Double audioGainLevel; + + /** + * Get the label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. + * + * @return the inputLabel value + */ + public String inputLabel() { + return this.inputLabel; + } + + /** + * Set the label of the job input which is to be used as an overlay. The Input must specify exactly one file. You can specify an image file in JPG or PNG formats, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See https://aka.ms/mesformats for the complete list of supported audio and video file formats. + * + * @param inputLabel the inputLabel value to set + * @return the Overlay object itself. + */ + public Overlay withInputLabel(String inputLabel) { + this.inputLabel = inputLabel; + return this; + } + + /** + * Get the start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. + * + * @return the start value + */ + public Period start() { + return this.start; + } + + /** + * Set the start position, with reference to the input video, at which the overlay starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 seconds in to the input video. If not specified the overlay starts from the beginning of the input video. + * + * @param start the start value to set + * @return the Overlay object itself. + */ + public Overlay withStart(Period start) { + this.start = start; + return this; + } + + /** + * Get the position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. + * + * @return the end value + */ + public Period end() { + return this.end; + } + + /** + * Set the position in the input video at which the overlay ends. The value should be in ISO 8601 duration format. For example, PT30S to end the overlay at 30 seconds in to the input video. If not specified the overlay will be applied until the end of the input video if inputLoop is true. Else, if inputLoop is false, then overlay will last as long as the duration of the overlay media. + * + * @param end the end value to set + * @return the Overlay object itself. + */ + public Overlay withEnd(Period end) { + this.end = end; + return this; + } + + /** + * Get the duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). + * + * @return the fadeInDuration value + */ + public Period fadeInDuration() { + return this.fadeInDuration; + } + + /** + * Set the duration over which the overlay fades in onto the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade in (same as PT0S). + * + * @param fadeInDuration the fadeInDuration value to set + * @return the Overlay object itself. + */ + public Overlay withFadeInDuration(Period fadeInDuration) { + this.fadeInDuration = fadeInDuration; + return this; + } + + /** + * Get the duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). + * + * @return the fadeOutDuration value + */ + public Period fadeOutDuration() { + return this.fadeOutDuration; + } + + /** + * Set the duration over which the overlay fades out of the input video. The value should be in ISO 8601 duration format. If not specified the default behavior is to have no fade out (same as PT0S). + * + * @param fadeOutDuration the fadeOutDuration value to set + * @return the Overlay object itself. + */ + public Overlay withFadeOutDuration(Period fadeOutDuration) { + this.fadeOutDuration = fadeOutDuration; + return this; + } + + /** + * Get the gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. + * + * @return the audioGainLevel value + */ + public Double audioGainLevel() { + return this.audioGainLevel; + } + + /** + * Set the gain level of audio in the overlay. The value should be in the range [0, 1.0]. The default is 1.0. + * + * @param audioGainLevel the audioGainLevel value to set + * @return the Overlay object itself. + */ + public Overlay withAudioGainLevel(Double audioGainLevel) { + this.audioGainLevel = audioGainLevel; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngFormat.java new file mode 100644 index 000000000000..467f8c1488c5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngFormat.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings for producing PNG thumbnails. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.PngFormat") +public class PngFormat extends ImageFormat { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngImage.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngImage.java new file mode 100644 index 000000000000..a52a249ed643 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngImage.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for producing a series of PNG images from the input + * video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.PngImage") +public class PngImage extends Image { + /** + * A collection of output PNG image layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get a collection of output PNG image layers to be produced by the encoder. + * + * @return the layers value + */ + public List layers() { + return this.layers; + } + + /** + * Set a collection of output PNG image layers to be produced by the encoder. + * + * @param layers the layers value to set + * @return the PngImage object itself. + */ + public PngImage withLayers(List layers) { + this.layers = layers; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngLayer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngLayer.java new file mode 100644 index 000000000000..74a73599294a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PngLayer.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the settings to produce a PNG image from the input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.PngLayer") +public class PngLayer extends Layer { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PresentationTimeRange.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PresentationTimeRange.java new file mode 100644 index 000000000000..f2e34d8c91cf --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/PresentationTimeRange.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The presentation time range, this is asset related and not recommended for + * Account Filter. + */ +public class PresentationTimeRange { + /** + * The absolute start time boundary. + */ + @JsonProperty(value = "startTimestamp", required = true) + private long startTimestamp; + + /** + * The absolute end time boundary. + */ + @JsonProperty(value = "endTimestamp", required = true) + private long endTimestamp; + + /** + * The relative to end sliding window. + */ + @JsonProperty(value = "presentationWindowDuration", required = true) + private long presentationWindowDuration; + + /** + * The relative to end right edge. + */ + @JsonProperty(value = "liveBackoffDuration", required = true) + private long liveBackoffDuration; + + /** + * The time scale of time stamps. + */ + @JsonProperty(value = "timescale", required = true) + private long timescale; + + /** + * The indicator of forcing exsiting of end time stamp. + */ + @JsonProperty(value = "forceEndTimestamp", required = true) + private boolean forceEndTimestamp; + + /** + * Get the absolute start time boundary. + * + * @return the startTimestamp value + */ + public long startTimestamp() { + return this.startTimestamp; + } + + /** + * Set the absolute start time boundary. + * + * @param startTimestamp the startTimestamp value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withStartTimestamp(long startTimestamp) { + this.startTimestamp = startTimestamp; + return this; + } + + /** + * Get the absolute end time boundary. + * + * @return the endTimestamp value + */ + public long endTimestamp() { + return this.endTimestamp; + } + + /** + * Set the absolute end time boundary. + * + * @param endTimestamp the endTimestamp value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withEndTimestamp(long endTimestamp) { + this.endTimestamp = endTimestamp; + return this; + } + + /** + * Get the relative to end sliding window. + * + * @return the presentationWindowDuration value + */ + public long presentationWindowDuration() { + return this.presentationWindowDuration; + } + + /** + * Set the relative to end sliding window. + * + * @param presentationWindowDuration the presentationWindowDuration value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withPresentationWindowDuration(long presentationWindowDuration) { + this.presentationWindowDuration = presentationWindowDuration; + return this; + } + + /** + * Get the relative to end right edge. + * + * @return the liveBackoffDuration value + */ + public long liveBackoffDuration() { + return this.liveBackoffDuration; + } + + /** + * Set the relative to end right edge. + * + * @param liveBackoffDuration the liveBackoffDuration value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withLiveBackoffDuration(long liveBackoffDuration) { + this.liveBackoffDuration = liveBackoffDuration; + return this; + } + + /** + * Get the time scale of time stamps. + * + * @return the timescale value + */ + public long timescale() { + return this.timescale; + } + + /** + * Set the time scale of time stamps. + * + * @param timescale the timescale value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withTimescale(long timescale) { + this.timescale = timescale; + return this; + } + + /** + * Get the indicator of forcing exsiting of end time stamp. + * + * @return the forceEndTimestamp value + */ + public boolean forceEndTimestamp() { + return this.forceEndTimestamp; + } + + /** + * Set the indicator of forcing exsiting of end time stamp. + * + * @param forceEndTimestamp the forceEndTimestamp value to set + * @return the PresentationTimeRange object itself. + */ + public PresentationTimeRange withForceEndTimestamp(boolean forceEndTimestamp) { + this.forceEndTimestamp = forceEndTimestamp; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Preset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Preset.java new file mode 100644 index 000000000000..f377ef73d793 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Preset.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base type for all Presets, which define the recipe or instructions on how + * the input media files should be processed. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("Preset") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AudioAnalyzerPreset", value = AudioAnalyzerPreset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.BuiltInStandardEncoderPreset", value = BuiltInStandardEncoderPreset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.StandardEncoderPreset", value = StandardEncoderPreset.class) +}) +public class Preset { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Priority.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Priority.java new file mode 100644 index 000000000000..773e3b884b5c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Priority.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Priority. + */ +public enum Priority { + /** Used for TransformOutputs that can be generated after Normal and High priority TransformOutputs. */ + LOW("Low"), + + /** Used for TransformOutputs that can be generated at Normal priority. */ + NORMAL("Normal"), + + /** Used for TransformOutputs that should take precedence over others. */ + HIGH("High"); + + /** The actual serialized value for a Priority instance. */ + private String value; + + Priority(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Priority instance. + * + * @param value the serialized value to parse. + * @return the parsed Priority object, or null if unable to parse. + */ + @JsonCreator + public static Priority fromString(String value) { + Priority[] items = Priority.values(); + for (Priority item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Provider.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Provider.java new file mode 100644 index 000000000000..2ceb10e75707 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Provider.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A resource provider. + */ +public class Provider { + /** + * The provider name. + */ + @JsonProperty(value = "providerName", required = true) + private String providerName; + + /** + * Get the provider name. + * + * @return the providerName value + */ + public String providerName() { + return this.providerName; + } + + /** + * Set the provider name. + * + * @param providerName the providerName value to set + * @return the Provider object itself. + */ + public Provider withProviderName(String providerName) { + this.providerName = providerName; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rectangle.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rectangle.java new file mode 100644 index 000000000000..b6f231f8920d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rectangle.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a rectangular window applied to the input media + * before processing it. + */ +public class Rectangle { + /** + * The number of pixels from the left-margin. This can be absolute pixel + * value (e.g 100), or relative to the size of the video (For example, + * 50%). + */ + @JsonProperty(value = "left") + private String left; + + /** + * The number of pixels from the top-margin. This can be absolute pixel + * value (e.g 100), or relative to the size of the video (For example, + * 50%). + */ + @JsonProperty(value = "top") + private String top; + + /** + * The width of the rectangular region in pixels. This can be absolute + * pixel value (e.g 100), or relative to the size of the video (For + * example, 50%). + */ + @JsonProperty(value = "width") + private String width; + + /** + * The height of the rectangular region in pixels. This can be absolute + * pixel value (e.g 100), or relative to the size of the video (For + * example, 50%). + */ + @JsonProperty(value = "height") + private String height; + + /** + * Get the number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the left value + */ + public String left() { + return this.left; + } + + /** + * Set the number of pixels from the left-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param left the left value to set + * @return the Rectangle object itself. + */ + public Rectangle withLeft(String left) { + this.left = left; + return this; + } + + /** + * Get the number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the top value + */ + public String top() { + return this.top; + } + + /** + * Set the number of pixels from the top-margin. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param top the top value to set + * @return the Rectangle object itself. + */ + public Rectangle withTop(String top) { + this.top = top; + return this; + } + + /** + * Get the width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the width value + */ + public String width() { + return this.width; + } + + /** + * Set the width of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param width the width value to set + * @return the Rectangle object itself. + */ + public Rectangle withWidth(String width) { + this.width = width; + return this; + } + + /** + * Get the height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @return the height value + */ + public String height() { + return this.height; + } + + /** + * Set the height of the rectangular region in pixels. This can be absolute pixel value (e.g 100), or relative to the size of the video (For example, 50%). + * + * @param height the height value to set + * @return the Rectangle object itself. + */ + public Rectangle withHeight(String height) { + this.height = height; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rotation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rotation.java new file mode 100644 index 000000000000..c48903fb6bb8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Rotation.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Rotation. + */ +public enum Rotation { + /** Automatically detect and rotate as needed. */ + AUTO("Auto"), + + /** Do not rotate the video. If the output format supports it, any metadata about rotation is kept intact. */ + NONE("None"), + + /** Do not rotate the video but remove any metadata about the rotation. */ + ROTATE0("Rotate0"), + + /** Rotate 90 degrees clockwise. */ + ROTATE90("Rotate90"), + + /** Rotate 180 degrees clockwise. */ + ROTATE180("Rotate180"), + + /** Rotate 270 degrees clockwise. */ + ROTATE270("Rotate270"); + + /** The actual serialized value for a Rotation instance. */ + private String value; + + Rotation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Rotation instance. + * + * @param value the serialized value to parse. + * @return the parsed Rotation object, or null if unable to parse. + */ + @JsonCreator + public static Rotation fromString(String value) { + Rotation[] items = Rotation.values(); + for (Rotation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ServiceSpecification.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ServiceSpecification.java new file mode 100644 index 000000000000..edc902d5db89 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/ServiceSpecification.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The service metric specifications. + */ +public class ServiceSpecification { + /** + * List of metric specifications. + */ + @JsonProperty(value = "metricSpecifications", access = JsonProperty.Access.WRITE_ONLY) + private List metricSpecifications; + + /** + * Get list of metric specifications. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StandardEncoderPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StandardEncoderPreset.java new file mode 100644 index 000000000000..869e3a4f290f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StandardEncoderPreset.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes all the settings to be used when encoding the input video with the + * Standard Encoder. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.StandardEncoderPreset") +public class StandardEncoderPreset extends Preset { + /** + * One or more filtering operations that are applied to the input media + * before encoding. + */ + @JsonProperty(value = "filters") + private Filters filters; + + /** + * The list of codecs to be used when encoding the input video. + */ + @JsonProperty(value = "codecs") + private List codecs; + + /** + * The list of outputs to be produced by the encoder. + */ + @JsonProperty(value = "formats") + private List formats; + + /** + * Get one or more filtering operations that are applied to the input media before encoding. + * + * @return the filters value + */ + public Filters filters() { + return this.filters; + } + + /** + * Set one or more filtering operations that are applied to the input media before encoding. + * + * @param filters the filters value to set + * @return the StandardEncoderPreset object itself. + */ + public StandardEncoderPreset withFilters(Filters filters) { + this.filters = filters; + return this; + } + + /** + * Get the list of codecs to be used when encoding the input video. + * + * @return the codecs value + */ + public List codecs() { + return this.codecs; + } + + /** + * Set the list of codecs to be used when encoding the input video. + * + * @param codecs the codecs value to set + * @return the StandardEncoderPreset object itself. + */ + public StandardEncoderPreset withCodecs(List codecs) { + this.codecs = codecs; + return this; + } + + /** + * Get the list of outputs to be produced by the encoder. + * + * @return the formats value + */ + public List formats() { + return this.formats; + } + + /** + * Set the list of outputs to be produced by the encoder. + * + * @param formats the formats value to set + * @return the StandardEncoderPreset object itself. + */ + public StandardEncoderPreset withFormats(List formats) { + this.formats = formats; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccount.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccount.java new file mode 100644 index 000000000000..c65dfdb6303b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccount.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account details. + */ +public class StorageAccount { + /** + * The ID of the storage account resource. Media Services relies on tables + * and queues as well as blobs, so the primary storage account must be a + * Standard Storage account (either Microsoft.ClassicStorage or + * Microsoft.Storage). Blob only storage accounts can be added as secondary + * storage accounts. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The type of the storage account. Possible values include: 'Primary', + * 'Secondary'. + */ + @JsonProperty(value = "type", required = true) + private StorageAccountType type; + + /** + * Get the ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts. + * + * @param id the id value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type of the storage account. Possible values include: 'Primary', 'Secondary'. + * + * @return the type value + */ + public StorageAccountType type() { + return this.type; + } + + /** + * Set the type of the storage account. Possible values include: 'Primary', 'Secondary'. + * + * @param type the type value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withType(StorageAccountType type) { + this.type = type; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccountType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccountType.java new file mode 100644 index 000000000000..70c3b6d9a000 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageAccountType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StorageAccountType. + */ +public enum StorageAccountType { + /** The primary storage account for the Media Services account. */ + PRIMARY("Primary"), + + /** A secondary storage account for the Media Services account. */ + SECONDARY("Secondary"); + + /** The actual serialized value for a StorageAccountType instance. */ + private String value; + + StorageAccountType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StorageAccountType instance. + * + * @param value the serialized value to parse. + * @return the parsed StorageAccountType object, or null if unable to parse. + */ + @JsonCreator + public static StorageAccountType fromString(String value) { + StorageAccountType[] items = StorageAccountType.values(); + for (StorageAccountType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageEncryptedAssetDecryptionData.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageEncryptedAssetDecryptionData.java new file mode 100644 index 000000000000..202ff3be8756 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StorageEncryptedAssetDecryptionData.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StorageEncryptedAssetDecryptionDataInner; +import java.util.List; + +/** + * Type representing StorageEncryptedAssetDecryptionData. + */ +public interface StorageEncryptedAssetDecryptionData extends HasInner, HasManager { + /** + * @return the assetFileEncryptionMetadata value. + */ + List assetFileEncryptionMetadata(); + + /** + * @return the key value. + */ + byte[] keyVal(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamOptionsFlag.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamOptionsFlag.java new file mode 100644 index 000000000000..0175cb8065e1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamOptionsFlag.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamOptionsFlag. + */ +public enum StreamOptionsFlag { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value LowLatency. */ + LOW_LATENCY("LowLatency"); + + /** The actual serialized value for a StreamOptionsFlag instance. */ + private String value; + + StreamOptionsFlag(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamOptionsFlag instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamOptionsFlag object, or null if unable to parse. + */ + @JsonCreator + public static StreamOptionsFlag fromString(String value) { + StreamOptionsFlag[] items = StreamOptionsFlag.values(); + for (StreamOptionsFlag item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoint.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoint.java new file mode 100644 index 000000000000..88b3fe0b58e0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoint.java @@ -0,0 +1,408 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingEndpointInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import java.util.Map; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing StreamingEndpoint. + */ +public interface StreamingEndpoint extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the accessControl value. + */ + StreamingEndpointAccessControl accessControl(); + + /** + * @return the availabilitySetName value. + */ + String availabilitySetName(); + + /** + * @return the cdnEnabled value. + */ + Boolean cdnEnabled(); + + /** + * @return the cdnProfile value. + */ + String cdnProfile(); + + /** + * @return the cdnProvider value. + */ + String cdnProvider(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the crossSiteAccessPolicies value. + */ + CrossSiteAccessPolicies crossSiteAccessPolicies(); + + /** + * @return the customHostNames value. + */ + List customHostNames(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the freeTrialEndTime value. + */ + DateTime freeTrialEndTime(); + + /** + * @return the hostName value. + */ + String hostName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the maxCacheAge value. + */ + Long maxCacheAge(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the resourceState value. + */ + StreamingEndpointResourceState resourceState(); + + /** + * @return the scaleUnits value. + */ + int scaleUnits(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StreamingEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithScaleUnits, DefinitionStages.WithCreate { + } + + /** + * Grouping of StreamingEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StreamingEndpoint definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the streamingendpoint definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + */ + WithScaleUnits withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streamingendpoint definition allowing to specify ScaleUnits. + */ + interface WithScaleUnits { + /** + * Specifies scaleUnits. + */ + WithCreate withScaleUnits(int scaleUnits); + } + + /** + * The stage of the streamingendpoint definition allowing to specify AccessControl. + */ + interface WithAccessControl { + /** + * Specifies accessControl. + */ + WithCreate withAccessControl(StreamingEndpointAccessControl accessControl); + } + + /** + * The stage of the streamingendpoint definition allowing to specify AvailabilitySetName. + */ + interface WithAvailabilitySetName { + /** + * Specifies availabilitySetName. + */ + WithCreate withAvailabilitySetName(String availabilitySetName); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CdnEnabled. + */ + interface WithCdnEnabled { + /** + * Specifies cdnEnabled. + */ + WithCreate withCdnEnabled(Boolean cdnEnabled); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CdnProfile. + */ + interface WithCdnProfile { + /** + * Specifies cdnProfile. + */ + WithCreate withCdnProfile(String cdnProfile); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CdnProvider. + */ + interface WithCdnProvider { + /** + * Specifies cdnProvider. + */ + WithCreate withCdnProvider(String cdnProvider); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + */ + WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the streamingendpoint definition allowing to specify CustomHostNames. + */ + interface WithCustomHostNames { + /** + * Specifies customHostNames. + */ + WithCreate withCustomHostNames(List customHostNames); + } + + /** + * The stage of the streamingendpoint definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the streamingendpoint definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the streamingendpoint definition allowing to specify MaxCacheAge. + */ + interface WithMaxCacheAge { + /** + * Specifies maxCacheAge. + */ + WithCreate withMaxCacheAge(Long maxCacheAge); + } + + /** + * The stage of the streamingendpoint definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAccessControl, DefinitionStages.WithAvailabilitySetName, DefinitionStages.WithCdnEnabled, DefinitionStages.WithCdnProfile, DefinitionStages.WithCdnProvider, DefinitionStages.WithCrossSiteAccessPolicies, DefinitionStages.WithCustomHostNames, DefinitionStages.WithDescription, DefinitionStages.WithLocation, DefinitionStages.WithMaxCacheAge, DefinitionStages.WithTags { + } + } + /** + * The template for a StreamingEndpoint update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAccessControl, UpdateStages.WithAvailabilitySetName, UpdateStages.WithCdnEnabled, UpdateStages.WithCdnProfile, UpdateStages.WithCdnProvider, UpdateStages.WithCrossSiteAccessPolicies, UpdateStages.WithCustomHostNames, UpdateStages.WithDescription, UpdateStages.WithLocation, UpdateStages.WithMaxCacheAge, UpdateStages.WithTags { + } + + /** + * Grouping of StreamingEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the streamingendpoint update allowing to specify AccessControl. + */ + interface WithAccessControl { + /** + * Specifies accessControl. + */ + Update withAccessControl(StreamingEndpointAccessControl accessControl); + } + + /** + * The stage of the streamingendpoint update allowing to specify AvailabilitySetName. + */ + interface WithAvailabilitySetName { + /** + * Specifies availabilitySetName. + */ + Update withAvailabilitySetName(String availabilitySetName); + } + + /** + * The stage of the streamingendpoint update allowing to specify CdnEnabled. + */ + interface WithCdnEnabled { + /** + * Specifies cdnEnabled. + */ + Update withCdnEnabled(Boolean cdnEnabled); + } + + /** + * The stage of the streamingendpoint update allowing to specify CdnProfile. + */ + interface WithCdnProfile { + /** + * Specifies cdnProfile. + */ + Update withCdnProfile(String cdnProfile); + } + + /** + * The stage of the streamingendpoint update allowing to specify CdnProvider. + */ + interface WithCdnProvider { + /** + * Specifies cdnProvider. + */ + Update withCdnProvider(String cdnProvider); + } + + /** + * The stage of the streamingendpoint update allowing to specify CrossSiteAccessPolicies. + */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies crossSiteAccessPolicies. + */ + Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + + /** + * The stage of the streamingendpoint update allowing to specify CustomHostNames. + */ + interface WithCustomHostNames { + /** + * Specifies customHostNames. + */ + Update withCustomHostNames(List customHostNames); + } + + /** + * The stage of the streamingendpoint update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + Update withDescription(String description); + } + + /** + * The stage of the streamingendpoint update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + Update withLocation(String location); + } + + /** + * The stage of the streamingendpoint update allowing to specify MaxCacheAge. + */ + interface WithMaxCacheAge { + /** + * Specifies maxCacheAge. + */ + Update withMaxCacheAge(Long maxCacheAge); + } + + /** + * The stage of the streamingendpoint update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointAccessControl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointAccessControl.java new file mode 100644 index 000000000000..516f0223148d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointAccessControl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * StreamingEndpoint access control definition. + */ +public class StreamingEndpointAccessControl { + /** + * The access control of Akamai. + */ + @JsonProperty(value = "akamai") + private AkamaiAccessControl akamai; + + /** + * The IP access control of the StreamingEndpoint. + */ + @JsonProperty(value = "ip") + private IPAccessControl ip; + + /** + * Get the access control of Akamai. + * + * @return the akamai value + */ + public AkamaiAccessControl akamai() { + return this.akamai; + } + + /** + * Set the access control of Akamai. + * + * @param akamai the akamai value to set + * @return the StreamingEndpointAccessControl object itself. + */ + public StreamingEndpointAccessControl withAkamai(AkamaiAccessControl akamai) { + this.akamai = akamai; + return this; + } + + /** + * Get the IP access control of the StreamingEndpoint. + * + * @return the ip value + */ + public IPAccessControl ip() { + return this.ip; + } + + /** + * Set the IP access control of the StreamingEndpoint. + * + * @param ip the ip value to set + * @return the StreamingEndpointAccessControl object itself. + */ + public StreamingEndpointAccessControl withIp(IPAccessControl ip) { + this.ip = ip; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointResourceState.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointResourceState.java new file mode 100644 index 000000000000..18a922254a7c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpointResourceState.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamingEndpointResourceState. + */ +public enum StreamingEndpointResourceState { + /** Enum value Stopped. */ + STOPPED("Stopped"), + + /** Enum value Starting. */ + STARTING("Starting"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Stopping. */ + STOPPING("Stopping"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Scaling. */ + SCALING("Scaling"); + + /** The actual serialized value for a StreamingEndpointResourceState instance. */ + private String value; + + StreamingEndpointResourceState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamingEndpointResourceState instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamingEndpointResourceState object, or null if unable to parse. + */ + @JsonCreator + public static StreamingEndpointResourceState fromString(String value) { + StreamingEndpointResourceState[] items = StreamingEndpointResourceState.values(); + for (StreamingEndpointResourceState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoints.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoints.java new file mode 100644 index 000000000000..5f5dc9c986e1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEndpoints.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingEndpointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StreamingEndpoints. + */ +public interface StreamingEndpoints extends SupportsCreating, HasInner { + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEntityScaleUnit.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEntityScaleUnit.java new file mode 100644 index 000000000000..cffcf254c733 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingEntityScaleUnit.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * scale units definition. + */ +public class StreamingEntityScaleUnit { + /** + * The scale unit number of the StreamingEndpoint. + */ + @JsonProperty(value = "scaleUnit") + private Integer scaleUnit; + + /** + * Get the scale unit number of the StreamingEndpoint. + * + * @return the scaleUnit value + */ + public Integer scaleUnit() { + return this.scaleUnit; + } + + /** + * Set the scale unit number of the StreamingEndpoint. + * + * @param scaleUnit the scaleUnit value to set + * @return the StreamingEntityScaleUnit object itself. + */ + public StreamingEntityScaleUnit withScaleUnit(Integer scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocator.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocator.java new file mode 100644 index 000000000000..f523dd5b3b87 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocator.java @@ -0,0 +1,273 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingLocatorInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.DateTime; +import java.util.UUID; +import java.util.List; + +/** + * Type representing StreamingLocator. + */ +public interface StreamingLocator extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the alternativeMediaId value. + */ + String alternativeMediaId(); + + /** + * @return the assetName value. + */ + String assetName(); + + /** + * @return the contentKeys value. + */ + List contentKeys(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the defaultContentKeyPolicyName value. + */ + String defaultContentKeyPolicyName(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the streamingLocatorId value. + */ + UUID streamingLocatorId(); + + /** + * @return the streamingPolicyName value. + */ + String streamingPolicyName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StreamingLocator definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithAssetName, DefinitionStages.WithStreamingPolicyName, DefinitionStages.WithCreate { + } + + /** + * Grouping of StreamingLocator definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StreamingLocator definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the streaminglocator definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + */ + WithAssetName withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streaminglocator definition allowing to specify AssetName. + */ + interface WithAssetName { + /** + * Specifies assetName. + */ + WithStreamingPolicyName withAssetName(String assetName); + } + + /** + * The stage of the streaminglocator definition allowing to specify StreamingPolicyName. + */ + interface WithStreamingPolicyName { + /** + * Specifies streamingPolicyName. + */ + WithCreate withStreamingPolicyName(String streamingPolicyName); + } + + /** + * The stage of the streaminglocator definition allowing to specify AlternativeMediaId. + */ + interface WithAlternativeMediaId { + /** + * Specifies alternativeMediaId. + */ + WithCreate withAlternativeMediaId(String alternativeMediaId); + } + + /** + * The stage of the streaminglocator definition allowing to specify ContentKeys. + */ + interface WithContentKeys { + /** + * Specifies contentKeys. + */ + WithCreate withContentKeys(List contentKeys); + } + + /** + * The stage of the streaminglocator definition allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + */ + WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streaminglocator definition allowing to specify EndTime. + */ + interface WithEndTime { + /** + * Specifies endTime. + */ + WithCreate withEndTime(DateTime endTime); + } + + /** + * The stage of the streaminglocator definition allowing to specify StartTime. + */ + interface WithStartTime { + /** + * Specifies startTime. + */ + WithCreate withStartTime(DateTime startTime); + } + + /** + * The stage of the streaminglocator definition allowing to specify StreamingLocatorId. + */ + interface WithStreamingLocatorId { + /** + * Specifies streamingLocatorId. + */ + WithCreate withStreamingLocatorId(UUID streamingLocatorId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAlternativeMediaId, DefinitionStages.WithContentKeys, DefinitionStages.WithDefaultContentKeyPolicyName, DefinitionStages.WithEndTime, DefinitionStages.WithStartTime, DefinitionStages.WithStreamingLocatorId { + } + } + /** + * The template for a StreamingLocator update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAlternativeMediaId, UpdateStages.WithContentKeys, UpdateStages.WithDefaultContentKeyPolicyName, UpdateStages.WithEndTime, UpdateStages.WithStartTime, UpdateStages.WithStreamingLocatorId { + } + + /** + * Grouping of StreamingLocator update stages. + */ + interface UpdateStages { + /** + * The stage of the streaminglocator update allowing to specify AlternativeMediaId. + */ + interface WithAlternativeMediaId { + /** + * Specifies alternativeMediaId. + */ + Update withAlternativeMediaId(String alternativeMediaId); + } + + /** + * The stage of the streaminglocator update allowing to specify ContentKeys. + */ + interface WithContentKeys { + /** + * Specifies contentKeys. + */ + Update withContentKeys(List contentKeys); + } + + /** + * The stage of the streaminglocator update allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + */ + Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streaminglocator update allowing to specify EndTime. + */ + interface WithEndTime { + /** + * Specifies endTime. + */ + Update withEndTime(DateTime endTime); + } + + /** + * The stage of the streaminglocator update allowing to specify StartTime. + */ + interface WithStartTime { + /** + * Specifies startTime. + */ + Update withStartTime(DateTime startTime); + } + + /** + * The stage of the streaminglocator update allowing to specify StreamingLocatorId. + */ + interface WithStreamingLocatorId { + /** + * Specifies streamingLocatorId. + */ + Update withStreamingLocatorId(UUID streamingLocatorId); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKey.java new file mode 100644 index 000000000000..bb4e9cb2fc52 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKey.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class for content key in Streaming Locator. + */ +public class StreamingLocatorContentKey { + /** + * ID of Content Key. + */ + @JsonProperty(value = "id", required = true) + private UUID id; + + /** + * Encryption type of Content Key. Possible values include: + * 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private StreamingLocatorContentKeyType type; + + /** + * Label of Content Key as specified in the Streaming Policy. + */ + @JsonProperty(value = "labelReferenceInStreamingPolicy") + private String labelReferenceInStreamingPolicy; + + /** + * Value of of Content Key. + */ + @JsonProperty(value = "value") + private String value; + + /** + * ContentKeyPolicy used by Content Key. + */ + @JsonProperty(value = "policyName", access = JsonProperty.Access.WRITE_ONLY) + private String policyName; + + /** + * Tracks which use this Content Key. + */ + @JsonProperty(value = "tracks", access = JsonProperty.Access.WRITE_ONLY) + private List tracks; + + /** + * Get iD of Content Key. + * + * @return the id value + */ + public UUID id() { + return this.id; + } + + /** + * Set iD of Content Key. + * + * @param id the id value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get encryption type of Content Key. Possible values include: 'CommonEncryptionCenc', 'CommonEncryptionCbcs', 'EnvelopeEncryption'. + * + * @return the type value + */ + public StreamingLocatorContentKeyType type() { + return this.type; + } + + /** + * Get label of Content Key as specified in the Streaming Policy. + * + * @return the labelReferenceInStreamingPolicy value + */ + public String labelReferenceInStreamingPolicy() { + return this.labelReferenceInStreamingPolicy; + } + + /** + * Set label of Content Key as specified in the Streaming Policy. + * + * @param labelReferenceInStreamingPolicy the labelReferenceInStreamingPolicy value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withLabelReferenceInStreamingPolicy(String labelReferenceInStreamingPolicy) { + this.labelReferenceInStreamingPolicy = labelReferenceInStreamingPolicy; + return this; + } + + /** + * Get value of of Content Key. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set value of of Content Key. + * + * @param value the value value to set + * @return the StreamingLocatorContentKey object itself. + */ + public StreamingLocatorContentKey withValue(String value) { + this.value = value; + return this; + } + + /** + * Get contentKeyPolicy used by Content Key. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Get tracks which use this Content Key. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKeyType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKeyType.java new file mode 100644 index 000000000000..249f8d72c30e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocatorContentKeyType.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamingLocatorContentKeyType. + */ +public enum StreamingLocatorContentKeyType { + /** Common Encryption using CENC. */ + COMMON_ENCRYPTION_CENC("CommonEncryptionCenc"), + + /** Common Encryption using CBCS. */ + COMMON_ENCRYPTION_CBCS("CommonEncryptionCbcs"), + + /** Envelope Encryption. */ + ENVELOPE_ENCRYPTION("EnvelopeEncryption"); + + /** The actual serialized value for a StreamingLocatorContentKeyType instance. */ + private String value; + + StreamingLocatorContentKeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamingLocatorContentKeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamingLocatorContentKeyType object, or null if unable to parse. + */ + @JsonCreator + public static StreamingLocatorContentKeyType fromString(String value) { + StreamingLocatorContentKeyType[] items = StreamingLocatorContentKeyType.values(); + for (StreamingLocatorContentKeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocators.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocators.java new file mode 100644 index 000000000000..4a5460d5c4f1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingLocators.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingLocatorsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StreamingLocators. + */ +public interface StreamingLocators extends SupportsCreating, HasInner { + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPath.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPath.java new file mode 100644 index 000000000000..6d474bdb6e81 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPath.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class of paths for streaming. + */ +public class StreamingPath { + /** + * Streaming protocol. Possible values include: 'Hls', 'Dash', + * 'SmoothStreaming', 'Download'. + */ + @JsonProperty(value = "streamingProtocol", required = true) + private StreamingPolicyStreamingProtocol streamingProtocol; + + /** + * Encryption scheme. Possible values include: 'NoEncryption', + * 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. + */ + @JsonProperty(value = "encryptionScheme", required = true) + private EncryptionScheme encryptionScheme; + + /** + * Streaming paths for each protocol and encryptionScheme pair. + */ + @JsonProperty(value = "paths") + private List paths; + + /** + * Get streaming protocol. Possible values include: 'Hls', 'Dash', 'SmoothStreaming', 'Download'. + * + * @return the streamingProtocol value + */ + public StreamingPolicyStreamingProtocol streamingProtocol() { + return this.streamingProtocol; + } + + /** + * Set streaming protocol. Possible values include: 'Hls', 'Dash', 'SmoothStreaming', 'Download'. + * + * @param streamingProtocol the streamingProtocol value to set + * @return the StreamingPath object itself. + */ + public StreamingPath withStreamingProtocol(StreamingPolicyStreamingProtocol streamingProtocol) { + this.streamingProtocol = streamingProtocol; + return this; + } + + /** + * Get encryption scheme. Possible values include: 'NoEncryption', 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. + * + * @return the encryptionScheme value + */ + public EncryptionScheme encryptionScheme() { + return this.encryptionScheme; + } + + /** + * Set encryption scheme. Possible values include: 'NoEncryption', 'EnvelopeEncryption', 'CommonEncryptionCenc', 'CommonEncryptionCbcs'. + * + * @param encryptionScheme the encryptionScheme value to set + * @return the StreamingPath object itself. + */ + public StreamingPath withEncryptionScheme(EncryptionScheme encryptionScheme) { + this.encryptionScheme = encryptionScheme; + return this; + } + + /** + * Get streaming paths for each protocol and encryptionScheme pair. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set streaming paths for each protocol and encryptionScheme pair. + * + * @param paths the paths value to set + * @return the StreamingPath object itself. + */ + public StreamingPath withPaths(List paths) { + this.paths = paths; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicies.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicies.java new file mode 100644 index 000000000000..d0533f2f0773 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicies.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StreamingPolicies. + */ +public interface StreamingPolicies extends SupportsCreating, HasInner { + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName); + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicy.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicy.java new file mode 100644 index 000000000000..f0d758d32077 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicy.java @@ -0,0 +1,216 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.StreamingPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.DateTime; + +/** + * Type representing StreamingPolicy. + */ +public interface StreamingPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the commonEncryptionCbcs value. + */ + CommonEncryptionCbcs commonEncryptionCbcs(); + + /** + * @return the commonEncryptionCenc value. + */ + CommonEncryptionCenc commonEncryptionCenc(); + + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the defaultContentKeyPolicyName value. + */ + String defaultContentKeyPolicyName(); + + /** + * @return the envelopeEncryption value. + */ + EnvelopeEncryption envelopeEncryption(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the noEncryption value. + */ + NoEncryption noEncryption(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StreamingPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithCreate { + } + + /** + * Grouping of StreamingPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StreamingPolicy definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the streamingpolicy definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the streamingpolicy definition allowing to specify CommonEncryptionCbcs. + */ + interface WithCommonEncryptionCbcs { + /** + * Specifies commonEncryptionCbcs. + */ + WithCreate withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); + } + + /** + * The stage of the streamingpolicy definition allowing to specify CommonEncryptionCenc. + */ + interface WithCommonEncryptionCenc { + /** + * Specifies commonEncryptionCenc. + */ + WithCreate withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); + } + + /** + * The stage of the streamingpolicy definition allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + */ + WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streamingpolicy definition allowing to specify EnvelopeEncryption. + */ + interface WithEnvelopeEncryption { + /** + * Specifies envelopeEncryption. + */ + WithCreate withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); + } + + /** + * The stage of the streamingpolicy definition allowing to specify NoEncryption. + */ + interface WithNoEncryption { + /** + * Specifies noEncryption. + */ + WithCreate withNoEncryption(NoEncryption noEncryption); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCommonEncryptionCbcs, DefinitionStages.WithCommonEncryptionCenc, DefinitionStages.WithDefaultContentKeyPolicyName, DefinitionStages.WithEnvelopeEncryption, DefinitionStages.WithNoEncryption { + } + } + /** + * The template for a StreamingPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCommonEncryptionCbcs, UpdateStages.WithCommonEncryptionCenc, UpdateStages.WithDefaultContentKeyPolicyName, UpdateStages.WithEnvelopeEncryption, UpdateStages.WithNoEncryption { + } + + /** + * Grouping of StreamingPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the streamingpolicy update allowing to specify CommonEncryptionCbcs. + */ + interface WithCommonEncryptionCbcs { + /** + * Specifies commonEncryptionCbcs. + */ + Update withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); + } + + /** + * The stage of the streamingpolicy update allowing to specify CommonEncryptionCenc. + */ + interface WithCommonEncryptionCenc { + /** + * Specifies commonEncryptionCenc. + */ + Update withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); + } + + /** + * The stage of the streamingpolicy update allowing to specify DefaultContentKeyPolicyName. + */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies defaultContentKeyPolicyName. + */ + Update withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + + /** + * The stage of the streamingpolicy update allowing to specify EnvelopeEncryption. + */ + interface WithEnvelopeEncryption { + /** + * Specifies envelopeEncryption. + */ + Update withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); + } + + /** + * The stage of the streamingpolicy update allowing to specify NoEncryption. + */ + interface WithNoEncryption { + /** + * Specifies noEncryption. + */ + Update withNoEncryption(NoEncryption noEncryption); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKey.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKey.java new file mode 100644 index 000000000000..44bc99463a8e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKey.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify properties of content key. + */ +public class StreamingPolicyContentKey { + /** + * Label can be used to specify Content Key when creating a Streaming + * Locator. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Policy used by Content Key. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * Tracks which use this content key. + */ + @JsonProperty(value = "tracks") + private List tracks; + + /** + * Get label can be used to specify Content Key when creating a Streaming Locator. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set label can be used to specify Content Key when creating a Streaming Locator. + * + * @param label the label value to set + * @return the StreamingPolicyContentKey object itself. + */ + public StreamingPolicyContentKey withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get policy used by Content Key. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set policy used by Content Key. + * + * @param policyName the policyName value to set + * @return the StreamingPolicyContentKey object itself. + */ + public StreamingPolicyContentKey withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get tracks which use this content key. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + + /** + * Set tracks which use this content key. + * + * @param tracks the tracks value to set + * @return the StreamingPolicyContentKey object itself. + */ + public StreamingPolicyContentKey withTracks(List tracks) { + this.tracks = tracks; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKeys.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKeys.java new file mode 100644 index 000000000000..470ff7df8fa9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyContentKeys.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify properties of all content keys in Streaming Policy. + */ +public class StreamingPolicyContentKeys { + /** + * Default content key for an encryption scheme. + */ + @JsonProperty(value = "defaultKey") + private DefaultKey defaultKey; + + /** + * Representing tracks needs separate content key. + */ + @JsonProperty(value = "keyToTrackMappings") + private List keyToTrackMappings; + + /** + * Get default content key for an encryption scheme. + * + * @return the defaultKey value + */ + public DefaultKey defaultKey() { + return this.defaultKey; + } + + /** + * Set default content key for an encryption scheme. + * + * @param defaultKey the defaultKey value to set + * @return the StreamingPolicyContentKeys object itself. + */ + public StreamingPolicyContentKeys withDefaultKey(DefaultKey defaultKey) { + this.defaultKey = defaultKey; + return this; + } + + /** + * Get representing tracks needs separate content key. + * + * @return the keyToTrackMappings value + */ + public List keyToTrackMappings() { + return this.keyToTrackMappings; + } + + /** + * Set representing tracks needs separate content key. + * + * @param keyToTrackMappings the keyToTrackMappings value to set + * @return the StreamingPolicyContentKeys object itself. + */ + public StreamingPolicyContentKeys withKeyToTrackMappings(List keyToTrackMappings) { + this.keyToTrackMappings = keyToTrackMappings; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyFairPlayConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyFairPlayConfiguration.java new file mode 100644 index 000000000000..d95cc3bc7da0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyFairPlayConfiguration.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify configurations of FairPlay in Streaming Policy. + */ +public class StreamingPolicyFairPlayConfiguration { + /** + * The template for a customer service to deliver keys to end users. Not + * needed when using Azure Media Services for issuing keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * All license to be persistent or not. + */ + @JsonProperty(value = "allowPersistentLicense", required = true) + private boolean allowPersistentLicense; + + /** + * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the StreamingPolicyFairPlayConfiguration object itself. + */ + public StreamingPolicyFairPlayConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + + /** + * Get all license to be persistent or not. + * + * @return the allowPersistentLicense value + */ + public boolean allowPersistentLicense() { + return this.allowPersistentLicense; + } + + /** + * Set all license to be persistent or not. + * + * @param allowPersistentLicense the allowPersistentLicense value to set + * @return the StreamingPolicyFairPlayConfiguration object itself. + */ + public StreamingPolicyFairPlayConfiguration withAllowPersistentLicense(boolean allowPersistentLicense) { + this.allowPersistentLicense = allowPersistentLicense; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyPlayReadyConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyPlayReadyConfiguration.java new file mode 100644 index 000000000000..4d99c8214154 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyPlayReadyConfiguration.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify configurations of PlayReady in Streaming Policy. + */ +public class StreamingPolicyPlayReadyConfiguration { + /** + * The template for a customer service to deliver keys to end users. Not + * needed when using Azure Media Services for issuing keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * Custom attributes for PlayReady. + */ + @JsonProperty(value = "playReadyCustomAttributes") + private String playReadyCustomAttributes; + + /** + * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the StreamingPolicyPlayReadyConfiguration object itself. + */ + public StreamingPolicyPlayReadyConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + + /** + * Get custom attributes for PlayReady. + * + * @return the playReadyCustomAttributes value + */ + public String playReadyCustomAttributes() { + return this.playReadyCustomAttributes; + } + + /** + * Set custom attributes for PlayReady. + * + * @param playReadyCustomAttributes the playReadyCustomAttributes value to set + * @return the StreamingPolicyPlayReadyConfiguration object itself. + */ + public StreamingPolicyPlayReadyConfiguration withPlayReadyCustomAttributes(String playReadyCustomAttributes) { + this.playReadyCustomAttributes = playReadyCustomAttributes; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyStreamingProtocol.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyStreamingProtocol.java new file mode 100644 index 000000000000..4b621ae04d47 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyStreamingProtocol.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StreamingPolicyStreamingProtocol. + */ +public enum StreamingPolicyStreamingProtocol { + /** HLS protocol. */ + HLS("Hls"), + + /** DASH protocol. */ + DASH("Dash"), + + /** SmoothStreaming protocol. */ + SMOOTH_STREAMING("SmoothStreaming"), + + /** Download protocol. */ + DOWNLOAD("Download"); + + /** The actual serialized value for a StreamingPolicyStreamingProtocol instance. */ + private String value; + + StreamingPolicyStreamingProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StreamingPolicyStreamingProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed StreamingPolicyStreamingProtocol object, or null if unable to parse. + */ + @JsonCreator + public static StreamingPolicyStreamingProtocol fromString(String value) { + StreamingPolicyStreamingProtocol[] items = StreamingPolicyStreamingProtocol.values(); + for (StreamingPolicyStreamingProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyWidevineConfiguration.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyWidevineConfiguration.java new file mode 100644 index 000000000000..225795bdadbe --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StreamingPolicyWidevineConfiguration.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify configurations of Widevine in Streaming Policy. + */ +public class StreamingPolicyWidevineConfiguration { + /** + * The template for a customer service to deliver keys to end users. Not + * needed when using Azure Media Services for issuing keys. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * Get the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @return the customLicenseAcquisitionUrlTemplate value + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the template for a customer service to deliver keys to end users. Not needed when using Azure Media Services for issuing keys. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set + * @return the StreamingPolicyWidevineConfiguration object itself. + */ + public StreamingPolicyWidevineConfiguration withCustomLicenseAcquisitionUrlTemplate(String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StretchMode.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StretchMode.java new file mode 100644 index 000000000000..9dcc8bd6942c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/StretchMode.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StretchMode. + */ +public enum StretchMode { + /** Strictly respect the output resolution without considering the pixel aspect ratio or display aspect ratio of the input video. */ + NONE("None"), + + /** Override the output resolution, and change it to match the display aspect ratio of the input, without padding. For example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the value in the preset is overridden, and the output will be at 1280x720, which maintains the input aspect ratio of 16:9. */ + AUTO_SIZE("AutoSize"), + + /** Pad the output (with either letterbox or pillar box) to honor the output resolution, while ensuring that the active video region in the output has the same aspect ratio as the input. For example, if the input is 1920x1080 and the encoding preset asks for 1280x1280, then the output will be at 1280x1280, which contains an inner rectangle of 1280x720 at aspect ratio of 16:9, and pillar box regions 280 pixels wide at the left and right. */ + AUTO_FIT("AutoFit"); + + /** The actual serialized value for a StretchMode instance. */ + private String value; + + StretchMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StretchMode instance. + * + * @param value the serialized value to parse. + * @return the parsed StretchMode object, or null if unable to parse. + */ + @JsonCreator + public static StretchMode fromString(String value) { + StretchMode[] items = StretchMode.values(); + for (StretchMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SubscriptionMediaService.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SubscriptionMediaService.java new file mode 100644 index 000000000000..4c4342a33d4b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SubscriptionMediaService.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.SubscriptionMediaServiceInner; +import java.util.UUID; +import java.util.List; +import java.util.Map; + +/** + * Type representing SubscriptionMediaService. + */ +public interface SubscriptionMediaService extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mediaServiceId value. + */ + UUID mediaServiceId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the storageAccounts value. + */ + List storageAccounts(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SyncStorageKeysInput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SyncStorageKeysInput.java new file mode 100644 index 000000000000..6915bf0705a6 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/SyncStorageKeysInput.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The input to the sync storage keys request. + */ +public class SyncStorageKeysInput { + /** + * The ID of the storage account resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the ID of the storage account resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the storage account resource. + * + * @param id the id value to set + * @return the SyncStorageKeysInput object itself. + */ + public SyncStorageKeysInput withId(String id) { + this.id = id; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCompareOperation.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCompareOperation.java new file mode 100644 index 000000000000..668632edce63 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCompareOperation.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TrackPropertyCompareOperation. + */ +public enum TrackPropertyCompareOperation { + /** Unknown track property compare operation. */ + UNKNOWN("Unknown"), + + /** Equal operation. */ + EQUAL("Equal"); + + /** The actual serialized value for a TrackPropertyCompareOperation instance. */ + private String value; + + TrackPropertyCompareOperation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TrackPropertyCompareOperation instance. + * + * @param value the serialized value to parse. + * @return the parsed TrackPropertyCompareOperation object, or null if unable to parse. + */ + @JsonCreator + public static TrackPropertyCompareOperation fromString(String value) { + TrackPropertyCompareOperation[] items = TrackPropertyCompareOperation.values(); + for (TrackPropertyCompareOperation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCondition.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCondition.java new file mode 100644 index 000000000000..30770116b29d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyCondition.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to specify one track property condition. + */ +public class TrackPropertyCondition { + /** + * Track property type. Possible values include: 'Unknown', 'FourCC'. + */ + @JsonProperty(value = "property", required = true) + private TrackPropertyType property; + + /** + * Track property condition operation. Possible values include: 'Unknown', + * 'Equal'. + */ + @JsonProperty(value = "operation", required = true) + private TrackPropertyCompareOperation operation; + + /** + * Track property value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get track property type. Possible values include: 'Unknown', 'FourCC'. + * + * @return the property value + */ + public TrackPropertyType property() { + return this.property; + } + + /** + * Set track property type. Possible values include: 'Unknown', 'FourCC'. + * + * @param property the property value to set + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withProperty(TrackPropertyType property) { + this.property = property; + return this; + } + + /** + * Get track property condition operation. Possible values include: 'Unknown', 'Equal'. + * + * @return the operation value + */ + public TrackPropertyCompareOperation operation() { + return this.operation; + } + + /** + * Set track property condition operation. Possible values include: 'Unknown', 'Equal'. + * + * @param operation the operation value to set + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withOperation(TrackPropertyCompareOperation operation) { + this.operation = operation; + return this; + } + + /** + * Get track property value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set track property value. + * + * @param value the value value to set + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyType.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyType.java new file mode 100644 index 000000000000..938ed8add6d5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackPropertyType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for TrackPropertyType. + */ +public enum TrackPropertyType { + /** Unknown track property. */ + UNKNOWN("Unknown"), + + /** Track FourCC. */ + FOUR_CC("FourCC"); + + /** The actual serialized value for a TrackPropertyType instance. */ + private String value; + + TrackPropertyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TrackPropertyType instance. + * + * @param value the serialized value to parse. + * @return the parsed TrackPropertyType object, or null if unable to parse. + */ + @JsonCreator + public static TrackPropertyType fromString(String value) { + TrackPropertyType[] items = TrackPropertyType.values(); + for (TrackPropertyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackSelection.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackSelection.java new file mode 100644 index 000000000000..ff3c76c41305 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TrackSelection.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class to select a track. + */ +public class TrackSelection { + /** + * TrackSelections is a track property condition list which can specify + * track(s). + */ + @JsonProperty(value = "trackSelections") + private List trackSelections; + + /** + * Get trackSelections is a track property condition list which can specify track(s). + * + * @return the trackSelections value + */ + public List trackSelections() { + return this.trackSelections; + } + + /** + * Set trackSelections is a track property condition list which can specify track(s). + * + * @param trackSelections the trackSelections value to set + * @return the TrackSelection object itself. + */ + public TrackSelection withTrackSelections(List trackSelections) { + this.trackSelections = trackSelections; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transform.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transform.java new file mode 100644 index 000000000000..2f41cba5079c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transform.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.TransformInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.MediaManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Transform. + */ +public interface Transform extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputs value. + */ + List outputs(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Transform definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMediaservice, DefinitionStages.WithOutputs, DefinitionStages.WithCreate { + } + + /** + * Grouping of Transform definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Transform definition. + */ + interface Blank extends WithMediaservice { + } + + /** + * The stage of the transform definition allowing to specify Mediaservice. + */ + interface WithMediaservice { + /** + * Specifies resourceGroupName, accountName. + */ + WithOutputs withExistingMediaservice(String resourceGroupName, String accountName); + } + + /** + * The stage of the transform definition allowing to specify Outputs. + */ + interface WithOutputs { + /** + * Specifies outputs. + */ + WithCreate withOutputs(List outputs); + } + + /** + * The stage of the transform definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDescription { + } + } + /** + * The template for a Transform update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDescription { + } + + /** + * Grouping of Transform update stages. + */ + interface UpdateStages { + /** + * The stage of the transform update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + */ + Update withDescription(String description); + } + + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransformOutput.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransformOutput.java new file mode 100644 index 000000000000..a36c04c8712c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransformOutput.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a TransformOutput, which are the rules to be + * applied while generating the desired output. + */ +public class TransformOutput { + /** + * A Transform can define more than one outputs. This property defines what + * the service should do when one output fails - either continue to produce + * other outputs, or, stop the other outputs. The overall Job state will + * not reflect failures of outputs that are specified with 'ContinueJob'. + * The default is 'StopProcessingJob'. Possible values include: + * 'StopProcessingJob', 'ContinueJob'. + */ + @JsonProperty(value = "onError") + private OnErrorType onError; + + /** + * Sets the relative priority of the TransformOutputs within a Transform. + * This sets the priority that the service uses for processing + * TransformOutputs. The default priority is Normal. Possible values + * include: 'Low', 'Normal', 'High'. + */ + @JsonProperty(value = "relativePriority") + private Priority relativePriority; + + /** + * Preset that describes the operations that will be used to modify, + * transcode, or extract insights from the source file to generate the + * output. + */ + @JsonProperty(value = "preset", required = true) + private Preset preset; + + /** + * Get a Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The overall Job state will not reflect failures of outputs that are specified with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values include: 'StopProcessingJob', 'ContinueJob'. + * + * @return the onError value + */ + public OnErrorType onError() { + return this.onError; + } + + /** + * Set a Transform can define more than one outputs. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The overall Job state will not reflect failures of outputs that are specified with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values include: 'StopProcessingJob', 'ContinueJob'. + * + * @param onError the onError value to set + * @return the TransformOutput object itself. + */ + public TransformOutput withOnError(OnErrorType onError) { + this.onError = onError; + return this; + } + + /** + * Get sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @return the relativePriority value + */ + public Priority relativePriority() { + return this.relativePriority; + } + + /** + * Set sets the relative priority of the TransformOutputs within a Transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @param relativePriority the relativePriority value to set + * @return the TransformOutput object itself. + */ + public TransformOutput withRelativePriority(Priority relativePriority) { + this.relativePriority = relativePriority; + return this; + } + + /** + * Get preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. + * + * @return the preset value + */ + public Preset preset() { + return this.preset; + } + + /** + * Set preset that describes the operations that will be used to modify, transcode, or extract insights from the source file to generate the output. + * + * @param preset the preset value to set + * @return the TransformOutput object itself. + */ + public TransformOutput withPreset(Preset preset) { + this.preset = preset; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transforms.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transforms.java new file mode 100644 index 000000000000..2ffcea3c0b0a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Transforms.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.implementation.TransformsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Transforms. + */ +public interface Transforms extends SupportsCreating, HasInner { + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String transformName); + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String transformName); + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransportStreamFormat.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransportStreamFormat.java new file mode 100644 index 000000000000..60bc5befab05 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/TransportStreamFormat.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC + * 13818-1) output video file(s). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.TransportStreamFormat") +public class TransportStreamFormat extends MultiBitrateFormat { +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Video.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Video.java new file mode 100644 index 000000000000..de99921054fd --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/Video.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the basic properties for encoding the input video. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.Video") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Image", value = Image.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.H264Video", value = H264Video.class) +}) +public class Video extends Codec { + /** + * The distance between two key frames, thereby defining a group of + * pictures (GOP). The value should be a non-zero integer in the range [1, + * 30] seconds, specified in ISO 8601 format. The default is 2 seconds + * (PT2S). + */ + @JsonProperty(value = "keyFrameInterval") + private Period keyFrameInterval; + + /** + * The resizing mode - how the input video will be resized to fit the + * desired output resolution(s). Default is AutoSize. Possible values + * include: 'None', 'AutoSize', 'AutoFit'. + */ + @JsonProperty(value = "stretchMode") + private StretchMode stretchMode; + + /** + * Get the distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + * + * @return the keyFrameInterval value + */ + public Period keyFrameInterval() { + return this.keyFrameInterval; + } + + /** + * Set the distance between two key frames, thereby defining a group of pictures (GOP). The value should be a non-zero integer in the range [1, 30] seconds, specified in ISO 8601 format. The default is 2 seconds (PT2S). + * + * @param keyFrameInterval the keyFrameInterval value to set + * @return the Video object itself. + */ + public Video withKeyFrameInterval(Period keyFrameInterval) { + this.keyFrameInterval = keyFrameInterval; + return this; + } + + /** + * Get the resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'None', 'AutoSize', 'AutoFit'. + * + * @return the stretchMode value + */ + public StretchMode stretchMode() { + return this.stretchMode; + } + + /** + * Set the resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize. Possible values include: 'None', 'AutoSize', 'AutoFit'. + * + * @param stretchMode the stretchMode value to set + * @return the Video object itself. + */ + public Video withStretchMode(StretchMode stretchMode) { + this.stretchMode = stretchMode; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoAnalyzerPreset.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoAnalyzerPreset.java new file mode 100644 index 000000000000..92cab5c520ca --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoAnalyzerPreset.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A video analyzer preset that extracts insights (rich metadata) from both + * audio and video, and outputs a JSON format file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.VideoAnalyzerPreset") +public class VideoAnalyzerPreset extends AudioAnalyzerPreset { + /** + * The type of insights to be extracted. If not set then based on the + * content the type will selected. If the content is audi only then only + * audio insights are extraced and if it is video only. Possible values + * include: 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights'. + */ + @JsonProperty(value = "insightsToExtract") + private InsightsType insightsToExtract; + + /** + * Get the type of insights to be extracted. If not set then based on the content the type will selected. If the content is audi only then only audio insights are extraced and if it is video only. Possible values include: 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights'. + * + * @return the insightsToExtract value + */ + public InsightsType insightsToExtract() { + return this.insightsToExtract; + } + + /** + * Set the type of insights to be extracted. If not set then based on the content the type will selected. If the content is audi only then only audio insights are extraced and if it is video only. Possible values include: 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights'. + * + * @param insightsToExtract the insightsToExtract value to set + * @return the VideoAnalyzerPreset object itself. + */ + public VideoAnalyzerPreset withInsightsToExtract(InsightsType insightsToExtract) { + this.insightsToExtract = insightsToExtract; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoLayer.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoLayer.java new file mode 100644 index 000000000000..a9ce42d77b87 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoLayer.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the settings to be used when encoding the input video into a + * desired output bitrate layer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.VideoLayer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.H264Layer", value = H264Layer.class) +}) +public class VideoLayer extends Layer { + /** + * The average bitrate in bits per second at which to encode the input + * video when generating this layer. This is a required field. + */ + @JsonProperty(value = "bitrate") + private Integer bitrate; + + /** + * The maximum bitrate (in bits per second), at which the VBV buffer should + * be assumed to refill. If not specified, defaults to the same value as + * bitrate. + */ + @JsonProperty(value = "maxBitrate") + private Integer maxBitrate; + + /** + * The number of B-frames to be used when encoding this layer. If not + * specified, the encoder chooses an appropriate number based on the video + * profile and level. + */ + @JsonProperty(value = "bFrames") + private Integer bFrames; + + /** + * The frame rate (in frames per second) at which to encode this layer. The + * value can be in the form of M/N where M and N are integers (For example, + * 30000/1001), or in the form of a number (For example, 30, or 29.97). The + * encoder enforces constraints on allowed frame rates based on the profile + * and level. If it is not specified, the encoder will use the same frame + * rate as the input video. + */ + @JsonProperty(value = "frameRate") + private String frameRate; + + /** + * The number of slices to be used when encoding this layer. If not + * specified, default is zero, which means that encoder will use a single + * slice for each frame. + */ + @JsonProperty(value = "slices") + private Integer slices; + + /** + * Whether or not adaptive B-frames are to be used when encoding this + * layer. If not specified, the encoder will turn it on whenever the video + * profile permits its use. + */ + @JsonProperty(value = "adaptiveBFrame") + private Boolean adaptiveBFrame; + + /** + * Get the average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. + * + * @return the bitrate value + */ + public Integer bitrate() { + return this.bitrate; + } + + /** + * Set the average bitrate in bits per second at which to encode the input video when generating this layer. This is a required field. + * + * @param bitrate the bitrate value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withBitrate(Integer bitrate) { + this.bitrate = bitrate; + return this; + } + + /** + * Get the maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. + * + * @return the maxBitrate value + */ + public Integer maxBitrate() { + return this.maxBitrate; + } + + /** + * Set the maximum bitrate (in bits per second), at which the VBV buffer should be assumed to refill. If not specified, defaults to the same value as bitrate. + * + * @param maxBitrate the maxBitrate value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withMaxBitrate(Integer maxBitrate) { + this.maxBitrate = maxBitrate; + return this; + } + + /** + * Get the number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. + * + * @return the bFrames value + */ + public Integer bFrames() { + return this.bFrames; + } + + /** + * Set the number of B-frames to be used when encoding this layer. If not specified, the encoder chooses an appropriate number based on the video profile and level. + * + * @param bFrames the bFrames value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withBFrames(Integer bFrames) { + this.bFrames = bFrames; + return this; + } + + /** + * Get the frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. + * + * @return the frameRate value + */ + public String frameRate() { + return this.frameRate; + } + + /** + * Set the frame rate (in frames per second) at which to encode this layer. The value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame rates based on the profile and level. If it is not specified, the encoder will use the same frame rate as the input video. + * + * @param frameRate the frameRate value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withFrameRate(String frameRate) { + this.frameRate = frameRate; + return this; + } + + /** + * Get the number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. + * + * @return the slices value + */ + public Integer slices() { + return this.slices; + } + + /** + * Set the number of slices to be used when encoding this layer. If not specified, default is zero, which means that encoder will use a single slice for each frame. + * + * @param slices the slices value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withSlices(Integer slices) { + this.slices = slices; + return this; + } + + /** + * Get whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. + * + * @return the adaptiveBFrame value + */ + public Boolean adaptiveBFrame() { + return this.adaptiveBFrame; + } + + /** + * Set whether or not adaptive B-frames are to be used when encoding this layer. If not specified, the encoder will turn it on whenever the video profile permits its use. + * + * @param adaptiveBFrame the adaptiveBFrame value to set + * @return the VideoLayer object itself. + */ + public VideoLayer withAdaptiveBFrame(Boolean adaptiveBFrame) { + this.adaptiveBFrame = adaptiveBFrame; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoOverlay.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoOverlay.java new file mode 100644 index 000000000000..968fb6cc21ca --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/VideoOverlay.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties of a video overlay. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata.type") +@JsonTypeName("#Microsoft.Media.VideoOverlay") +public class VideoOverlay extends Overlay { + /** + * The location in the input video where the overlay is applied. + */ + @JsonProperty(value = "position") + private Rectangle position; + + /** + * The opacity of the overlay. This is a value in the range [0 - 1.0]. + * Default is 1.0 which mean the overlay is opaque. + */ + @JsonProperty(value = "opacity") + private Double opacity; + + /** + * An optional rectangular window used to crop the overlay image or video. + */ + @JsonProperty(value = "cropRectangle") + private Rectangle cropRectangle; + + /** + * Get the location in the input video where the overlay is applied. + * + * @return the position value + */ + public Rectangle position() { + return this.position; + } + + /** + * Set the location in the input video where the overlay is applied. + * + * @param position the position value to set + * @return the VideoOverlay object itself. + */ + public VideoOverlay withPosition(Rectangle position) { + this.position = position; + return this; + } + + /** + * Get the opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. + * + * @return the opacity value + */ + public Double opacity() { + return this.opacity; + } + + /** + * Set the opacity of the overlay. This is a value in the range [0 - 1.0]. Default is 1.0 which mean the overlay is opaque. + * + * @param opacity the opacity value to set + * @return the VideoOverlay object itself. + */ + public VideoOverlay withOpacity(Double opacity) { + this.opacity = opacity; + return this; + } + + /** + * Get an optional rectangular window used to crop the overlay image or video. + * + * @return the cropRectangle value + */ + public Rectangle cropRectangle() { + return this.cropRectangle; + } + + /** + * Set an optional rectangular window used to crop the overlay image or video. + * + * @param cropRectangle the cropRectangle value to set + * @return the VideoOverlay object itself. + */ + public VideoOverlay withCropRectangle(Rectangle cropRectangle) { + this.cropRectangle = cropRectangle; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterImpl.java new file mode 100644 index 000000000000..51e330e78184 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterImpl.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilter; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.PresentationTimeRange; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FirstQuality; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FilterTrackSelection; + +class AccountFilterImpl extends CreatableUpdatableImpl implements AccountFilter, AccountFilter.Definition, AccountFilter.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String filterName; + + AccountFilterImpl(String name, MediaManager manager) { + super(name, new AccountFilterInner()); + this.manager = manager; + // Set resource name + this.filterName = name; + // + } + + AccountFilterImpl(AccountFilterInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.filterName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.filterName = IdParsingUtils.getValueFromIdByName(inner.id(), "accountFilters"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AccountFiltersInner client = this.manager().inner().accountFilters(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.filterName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AccountFiltersInner client = this.manager().inner().accountFilters(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.filterName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AccountFiltersInner client = this.manager().inner().accountFilters(); + return client.getAsync(this.resourceGroupName, this.accountName, this.filterName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public FirstQuality firstQuality() { + return this.inner().firstQuality(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PresentationTimeRange presentationTimeRange() { + return this.inner().presentationTimeRange(); + } + + @Override + public List tracks() { + return this.inner().tracks(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AccountFilterImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public AccountFilterImpl withFirstQuality(FirstQuality firstQuality) { + this.inner().withFirstQuality(firstQuality); + return this; + } + + @Override + public AccountFilterImpl withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.inner().withPresentationTimeRange(presentationTimeRange); + return this; + } + + @Override + public AccountFilterImpl withTracks(List tracks) { + this.inner().withTracks(tracks); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterInner.java new file mode 100644 index 000000000000..19ff37879234 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFilterInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.PresentationTimeRange; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FirstQuality; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FilterTrackSelection; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An Account Filter. + */ +@JsonFlatten +public class AccountFilterInner extends ProxyResource { + /** + * The presentation time range. + */ + @JsonProperty(value = "properties.presentationTimeRange") + private PresentationTimeRange presentationTimeRange; + + /** + * The first quality. + */ + @JsonProperty(value = "properties.firstQuality") + private FirstQuality firstQuality; + + /** + * The tracks selection conditions. + */ + @JsonProperty(value = "properties.tracks") + private List tracks; + + /** + * Get the presentation time range. + * + * @return the presentationTimeRange value + */ + public PresentationTimeRange presentationTimeRange() { + return this.presentationTimeRange; + } + + /** + * Set the presentation time range. + * + * @param presentationTimeRange the presentationTimeRange value to set + * @return the AccountFilterInner object itself. + */ + public AccountFilterInner withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.presentationTimeRange = presentationTimeRange; + return this; + } + + /** + * Get the first quality. + * + * @return the firstQuality value + */ + public FirstQuality firstQuality() { + return this.firstQuality; + } + + /** + * Set the first quality. + * + * @param firstQuality the firstQuality value to set + * @return the AccountFilterInner object itself. + */ + public AccountFilterInner withFirstQuality(FirstQuality firstQuality) { + this.firstQuality = firstQuality; + return this; + } + + /** + * Get the tracks selection conditions. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + + /** + * Set the tracks selection conditions. + * + * @param tracks the tracks value to set + * @return the AccountFilterInner object itself. + */ + public AccountFilterInner withTracks(List tracks) { + this.tracks = tracks; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersImpl.java new file mode 100644 index 000000000000..f0e6985ef519 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilter; + +class AccountFiltersImpl extends WrapperImpl implements AccountFilters { + private final MediaManager manager; + + AccountFiltersImpl(MediaManager manager) { + super(manager.inner().accountFilters()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public AccountFilterImpl define(String name) { + return wrapModel(name); + } + + private AccountFilterImpl wrapModel(AccountFilterInner inner) { + return new AccountFilterImpl(inner, manager()); + } + + private AccountFilterImpl wrapModel(String name) { + return new AccountFilterImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + AccountFiltersInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AccountFilter call(AccountFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String filterName) { + AccountFiltersInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, filterName) + .map(new Func1() { + @Override + public AccountFilter call(AccountFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String filterName) { + AccountFiltersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, filterName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java new file mode 100644 index 000000000000..b3281ececa3b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AccountFiltersInner.java @@ -0,0 +1,741 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AccountFilters. + */ +public class AccountFiltersInner { + /** The Retrofit service to perform REST calls. */ + private AccountFiltersService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of AccountFiltersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AccountFiltersInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(AccountFiltersService.class); + this.client = client; + } + + /** + * The interface defining all the services for AccountFilters to be + * used by Retrofit to perform actually REST calls. + */ + interface AccountFiltersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("filterName") String filterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("filterName") String filterName, @Body AccountFilterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("filterName") String filterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/accountFilters/{filterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("filterName") String filterName, @Body AccountFilterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AccountFilterInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AccountFilterInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AccountFilterInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AccountFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccountFilterInner object if successful. + */ + public AccountFilterInner get(String resourceGroupName, String accountName, String filterName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, filterName).toBlocking().single().body(); + } + + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String filterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, filterName), serviceCallback); + } + + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String filterName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, filterName).map(new Func1, AccountFilterInner>() { + @Override + public AccountFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an Account Filter. + * Get the details of an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String filterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, filterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Account Filter. + * Creates or updates an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccountFilterInner object if successful. + */ + public AccountFilterInner createOrUpdate(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Account Filter. + * Creates or updates an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters), serviceCallback); + } + + /** + * Create or update an Account Filter. + * Creates or updates an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).map(new Func1, AccountFilterInner>() { + @Override + public AccountFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Account Filter. + * Creates or updates an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, filterName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String filterName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, filterName).toBlocking().single().body(); + } + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String filterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, filterName), serviceCallback); + } + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String filterName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, filterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an Account Filter. + * Deletes an Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String filterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, filterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update an Account Filter. + * Updates an existing Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AccountFilterInner object if successful. + */ + public AccountFilterInner update(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).toBlocking().single().body(); + } + + /** + * Update an Account Filter. + * Updates an existing Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters), serviceCallback); + } + + /** + * Update an Account Filter. + * Updates an existing Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, filterName, parameters).map(new Func1, AccountFilterInner>() { + @Override + public AccountFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an Account Filter. + * Updates an existing Account Filter in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filterName The Account Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AccountFilterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, filterName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AccountFilterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AccountFilterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AccountFilterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Account Filters. + * List Account Filters in the Media Services account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AccountFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasImpl.java new file mode 100644 index 000000000000..9be4881180a1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetContainerSas; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class AssetContainerSasImpl extends WrapperImpl implements AssetContainerSas { + private final MediaManager manager; + AssetContainerSasImpl(AssetContainerSasInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List assetContainerSasUrls() { + return this.inner().assetContainerSasUrls(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasInner.java new file mode 100644 index 000000000000..740b81c6f27d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetContainerSasInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Asset Storage container SAS URLs. + */ +public class AssetContainerSasInner { + /** + * The list of Asset container SAS URLs. + */ + @JsonProperty(value = "assetContainerSasUrls") + private List assetContainerSasUrls; + + /** + * Get the list of Asset container SAS URLs. + * + * @return the assetContainerSasUrls value + */ + public List assetContainerSasUrls() { + return this.assetContainerSasUrls; + } + + /** + * Set the list of Asset container SAS URLs. + * + * @param assetContainerSasUrls the assetContainerSasUrls value to set + * @return the AssetContainerSasInner object itself. + */ + public AssetContainerSasInner withAssetContainerSasUrls(List assetContainerSasUrls) { + this.assetContainerSasUrls = assetContainerSasUrls; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterImpl.java new file mode 100644 index 000000000000..6edec1bb6ff1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterImpl.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilter; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.PresentationTimeRange; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FirstQuality; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FilterTrackSelection; + +class AssetFilterImpl extends CreatableUpdatableImpl implements AssetFilter, AssetFilter.Definition, AssetFilter.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String assetName; + private String filterName; + + AssetFilterImpl(String name, MediaManager manager) { + super(name, new AssetFilterInner()); + this.manager = manager; + // Set resource name + this.filterName = name; + // + } + + AssetFilterImpl(AssetFilterInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.filterName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.assetName = IdParsingUtils.getValueFromIdByName(inner.id(), "assets"); + this.filterName = IdParsingUtils.getValueFromIdByName(inner.id(), "assetFilters"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AssetFiltersInner client = this.manager().inner().assetFilters(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.assetName, this.filterName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AssetFiltersInner client = this.manager().inner().assetFilters(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.assetName, this.filterName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AssetFiltersInner client = this.manager().inner().assetFilters(); + return client.getAsync(this.resourceGroupName, this.accountName, this.assetName, this.filterName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public FirstQuality firstQuality() { + return this.inner().firstQuality(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PresentationTimeRange presentationTimeRange() { + return this.inner().presentationTimeRange(); + } + + @Override + public List tracks() { + return this.inner().tracks(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AssetFilterImpl withExistingAsset(String resourceGroupName, String accountName, String assetName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.assetName = assetName; + return this; + } + + @Override + public AssetFilterImpl withFirstQuality(FirstQuality firstQuality) { + this.inner().withFirstQuality(firstQuality); + return this; + } + + @Override + public AssetFilterImpl withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.inner().withPresentationTimeRange(presentationTimeRange); + return this; + } + + @Override + public AssetFilterImpl withTracks(List tracks) { + this.inner().withTracks(tracks); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterInner.java new file mode 100644 index 000000000000..cb971f48b5f3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFilterInner.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.PresentationTimeRange; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FirstQuality; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.FilterTrackSelection; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An Asset Filter. + */ +@JsonFlatten +public class AssetFilterInner extends ProxyResource { + /** + * The presentation time range. + */ + @JsonProperty(value = "properties.presentationTimeRange") + private PresentationTimeRange presentationTimeRange; + + /** + * The first quality. + */ + @JsonProperty(value = "properties.firstQuality") + private FirstQuality firstQuality; + + /** + * The tracks selection conditions. + */ + @JsonProperty(value = "properties.tracks") + private List tracks; + + /** + * Get the presentation time range. + * + * @return the presentationTimeRange value + */ + public PresentationTimeRange presentationTimeRange() { + return this.presentationTimeRange; + } + + /** + * Set the presentation time range. + * + * @param presentationTimeRange the presentationTimeRange value to set + * @return the AssetFilterInner object itself. + */ + public AssetFilterInner withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.presentationTimeRange = presentationTimeRange; + return this; + } + + /** + * Get the first quality. + * + * @return the firstQuality value + */ + public FirstQuality firstQuality() { + return this.firstQuality; + } + + /** + * Set the first quality. + * + * @param firstQuality the firstQuality value to set + * @return the AssetFilterInner object itself. + */ + public AssetFilterInner withFirstQuality(FirstQuality firstQuality) { + this.firstQuality = firstQuality; + return this; + } + + /** + * Get the tracks selection conditions. + * + * @return the tracks value + */ + public List tracks() { + return this.tracks; + } + + /** + * Set the tracks selection conditions. + * + * @param tracks the tracks value to set + * @return the AssetFilterInner object itself. + */ + public AssetFilterInner withTracks(List tracks) { + this.tracks = tracks; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersImpl.java new file mode 100644 index 000000000000..28bc3b48c463 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilter; + +class AssetFiltersImpl extends WrapperImpl implements AssetFilters { + private final MediaManager manager; + + AssetFiltersImpl(MediaManager manager) { + super(manager.inner().assetFilters()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public AssetFilterImpl define(String name) { + return wrapModel(name); + } + + private AssetFilterImpl wrapModel(AssetFilterInner inner) { + return new AssetFilterImpl(inner, manager()); + } + + private AssetFilterImpl wrapModel(String name) { + return new AssetFilterImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName, final String assetName) { + AssetFiltersInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, assetName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AssetFilter call(AssetFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + AssetFiltersInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, assetName, filterName) + .map(new Func1() { + @Override + public AssetFilter call(AssetFilterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + AssetFiltersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, assetName, filterName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java new file mode 100644 index 000000000000..f87d04a92f6d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java @@ -0,0 +1,777 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AssetFilters. + */ +public class AssetFiltersInner { + /** The Retrofit service to perform REST calls. */ + private AssetFiltersService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of AssetFiltersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AssetFiltersInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(AssetFiltersService.class); + this.client = client; + } + + /** + * The interface defining all the services for AssetFilters to be + * used by Retrofit to perform actually REST calls. + */ + interface AssetFiltersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Path("filterName") String filterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Path("filterName") String filterName, @Body AssetFilterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Path("filterName") String filterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/assetFilters/{filterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Path("filterName") String filterName, @Body AssetFilterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetFilterInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String assetName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, assetName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String assetName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, assetName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetFilterInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String assetName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, assetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetFilterInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String assetName) { + return listSinglePageAsync(resourceGroupName, accountName, assetName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetFilterInner object if successful. + */ + public AssetFilterInner get(String resourceGroupName, String accountName, String assetName, String filterName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName).toBlocking().single().body(); + } + + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String assetName, String filterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName), serviceCallback); + } + + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName).map(new Func1, AssetFilterInner>() { + @Override + public AssetFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an Asset Filter. + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, assetName, filterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Asset Filter. + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetFilterInner object if successful. + */ + public AssetFilterInner createOrUpdate(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Asset Filter. + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters), serviceCallback); + } + + /** + * Create or update an Asset Filter. + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).map(new Func1, AssetFilterInner>() { + @Override + public AssetFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Asset Filter. + * Creates or updates an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, assetName, filterName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String assetName, String filterName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName).toBlocking().single().body(); + } + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String assetName, String filterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName), serviceCallback); + } + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an Asset Filter. + * Deletes an Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, assetName, filterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update an Asset Filter. + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetFilterInner object if successful. + */ + public AssetFilterInner update(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).toBlocking().single().body(); + } + + /** + * Update an Asset Filter. + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters), serviceCallback); + } + + /** + * Update an Asset Filter. + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters).map(new Func1, AssetFilterInner>() { + @Override + public AssetFilterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an Asset Filter. + * Updates an existing Asset Filter associated with the specified Asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param filterName The Asset Filter name + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetFilterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (filterName == null) { + throw new IllegalArgumentException("Parameter filterName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, assetName, filterName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetFilterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetFilterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetFilterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Asset Filters. + * List Asset Filters associated with the specified Asset. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetFilterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetImpl.java new file mode 100644 index 000000000000..4e5d26fed1ad --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetImpl.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.Asset; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetStorageEncryptionFormat; + +class AssetImpl extends CreatableUpdatableImpl implements Asset, Asset.Definition, Asset.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String assetName; + + AssetImpl(String name, MediaManager manager) { + super(name, new AssetInner()); + this.manager = manager; + // Set resource name + this.assetName = name; + // + } + + AssetImpl(AssetInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.assetName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.assetName = IdParsingUtils.getValueFromIdByName(inner.id(), "assets"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AssetsInner client = this.manager().inner().assets(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.assetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AssetsInner client = this.manager().inner().assets(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.assetName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AssetsInner client = this.manager().inner().assets(); + return client.getAsync(this.resourceGroupName, this.accountName, this.assetName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String alternateId() { + return this.inner().alternateId(); + } + + @Override + public UUID assetId() { + return this.inner().assetId(); + } + + @Override + public String container() { + return this.inner().container(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String storageAccountName() { + return this.inner().storageAccountName(); + } + + @Override + public AssetStorageEncryptionFormat storageEncryptionFormat() { + return this.inner().storageEncryptionFormat(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public AssetImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public AssetImpl withAlternateId(String alternateId) { + this.inner().withAlternateId(alternateId); + return this; + } + + @Override + public AssetImpl withContainer(String container) { + this.inner().withContainer(container); + return this; + } + + @Override + public AssetImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public AssetImpl withStorageAccountName(String storageAccountName) { + this.inner().withStorageAccountName(storageAccountName); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetInner.java new file mode 100644 index 000000000000..6b37faca17ea --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetInner.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetStorageEncryptionFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An Asset. + */ +@JsonFlatten +public class AssetInner extends ProxyResource { + /** + * The Asset ID. + */ + @JsonProperty(value = "properties.assetId", access = JsonProperty.Access.WRITE_ONLY) + private UUID assetId; + + /** + * The creation date of the Asset. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The last modified date of the Asset. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The alternate ID of the Asset. + */ + @JsonProperty(value = "properties.alternateId") + private String alternateId; + + /** + * The Asset description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The name of the asset blob container. + */ + @JsonProperty(value = "properties.container") + private String container; + + /** + * The name of the storage account. + */ + @JsonProperty(value = "properties.storageAccountName") + private String storageAccountName; + + /** + * The Asset encryption format. One of None or MediaStorageEncryption. + * Possible values include: 'None', 'MediaStorageClientEncryption'. + */ + @JsonProperty(value = "properties.storageEncryptionFormat", access = JsonProperty.Access.WRITE_ONLY) + private AssetStorageEncryptionFormat storageEncryptionFormat; + + /** + * Get the Asset ID. + * + * @return the assetId value + */ + public UUID assetId() { + return this.assetId; + } + + /** + * Get the creation date of the Asset. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the last modified date of the Asset. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the alternate ID of the Asset. + * + * @return the alternateId value + */ + public String alternateId() { + return this.alternateId; + } + + /** + * Set the alternate ID of the Asset. + * + * @param alternateId the alternateId value to set + * @return the AssetInner object itself. + */ + public AssetInner withAlternateId(String alternateId) { + this.alternateId = alternateId; + return this; + } + + /** + * Get the Asset description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the Asset description. + * + * @param description the description value to set + * @return the AssetInner object itself. + */ + public AssetInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the name of the asset blob container. + * + * @return the container value + */ + public String container() { + return this.container; + } + + /** + * Set the name of the asset blob container. + * + * @param container the container value to set + * @return the AssetInner object itself. + */ + public AssetInner withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the name of the storage account. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account. + * + * @param storageAccountName the storageAccountName value to set + * @return the AssetInner object itself. + */ + public AssetInner withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the Asset encryption format. One of None or MediaStorageEncryption. Possible values include: 'None', 'MediaStorageClientEncryption'. + * + * @return the storageEncryptionFormat value + */ + public AssetStorageEncryptionFormat storageEncryptionFormat() { + return this.storageEncryptionFormat; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsImpl.java new file mode 100644 index 000000000000..c724c447dabc --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Assets; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetContainerSas; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageEncryptedAssetDecryptionData; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListStreamingLocatorsResponse; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListContainerSasInput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Asset; + +class AssetsImpl extends WrapperImpl implements Assets { + private final MediaManager manager; + + AssetsImpl(MediaManager manager) { + super(manager.inner().assets()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public AssetImpl define(String name) { + return wrapModel(name); + } + + private AssetImpl wrapModel(AssetInner inner) { + return new AssetImpl(inner, manager()); + } + + private AssetImpl wrapModel(String name) { + return new AssetImpl(name, this.manager()); + } + + @Override + public Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + AssetsInner client = this.inner(); + return client.listContainerSasAsync(resourceGroupName, accountName, assetName, parameters) + .map(new Func1() { + @Override + public AssetContainerSas call(AssetContainerSasInner inner) { + return new AssetContainerSasImpl(inner, manager()); + } + }); + } + + @Override + public Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.getEncryptionKeyAsync(resourceGroupName, accountName, assetName) + .map(new Func1() { + @Override + public StorageEncryptedAssetDecryptionData call(StorageEncryptedAssetDecryptionDataInner inner) { + return new StorageEncryptedAssetDecryptionDataImpl(inner, manager()); + } + }); + } + + @Override + public Observable listStreamingLocatorsAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.listStreamingLocatorsAsync(resourceGroupName, accountName, assetName) + .map(new Func1() { + @Override + public ListStreamingLocatorsResponse call(ListStreamingLocatorsResponseInner inner) { + return new ListStreamingLocatorsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + AssetsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Asset call(AssetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, assetName) + .map(new Func1() { + @Override + public Asset call(AssetInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String assetName) { + AssetsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, assetName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsInner.java new file mode 100644 index 000000000000..b545587414e3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsInner.java @@ -0,0 +1,1193 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListContainerSasInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Assets. + */ +public class AssetsInner { + /** The Retrofit service to perform REST calls. */ + private AssetsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of AssetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AssetsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(AssetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Assets to be + * used by Retrofit to perform actually REST calls. + */ + interface AssetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body AssetInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body AssetInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets listContainerSas" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/listContainerSas") + Observable> listContainerSas(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Body ListContainerSasInput parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets getEncryptionKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/getEncryptionKey") + Observable> getEncryptionKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets listStreamingLocators" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/assets/{assetName}/listStreamingLocators") + Observable> listStreamingLocators(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("assetName") String assetName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Assets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetInner object if successful. + */ + public AssetInner get(String resourceGroupName, String accountName, String assetName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String assetName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, AssetInner>() { + @Override + public AssetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an Asset. + * Get the details of an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetInner object if successful. + */ + public AssetInner createOrUpdate(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetInner>() { + @Override + public AssetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Asset. + * Creates or updates an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String assetName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String assetName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an Asset. + * Deletes an Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetInner object if successful. + */ + public AssetInner update(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetInner>() { + @Override + public AssetInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an Asset. + * Updates an existing Asset in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AssetContainerSasInner object if successful. + */ + public AssetContainerSasInner listContainerSas(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + return listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body(); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters), serviceCallback); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetContainerSasInner object + */ + public Observable listContainerSasAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + return listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).map(new Func1, AssetContainerSasInner>() { + @Override + public AssetContainerSasInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the Asset URLs. + * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AssetContainerSasInner object + */ + public Observable> listContainerSasWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.listContainerSas(this.client.subscriptionId(), resourceGroupName, accountName, assetName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listContainerSasDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listContainerSasDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageEncryptedAssetDecryptionDataInner object if successful. + */ + public StorageEncryptedAssetDecryptionDataInner getEncryptionKey(String resourceGroupName, String accountName, String assetName) { + return getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageEncryptedAssetDecryptionDataInner object + */ + public Observable getEncryptionKeyAsync(String resourceGroupName, String accountName, String assetName) { + return getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, StorageEncryptedAssetDecryptionDataInner>() { + @Override + public StorageEncryptedAssetDecryptionDataInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Asset storage key. + * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageEncryptedAssetDecryptionDataInner object + */ + public Observable> getEncryptionKeyWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getEncryptionKey(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEncryptionKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEncryptionKeyDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListStreamingLocatorsResponseInner object if successful. + */ + public ListStreamingLocatorsResponseInner listStreamingLocators(String resourceGroupName, String accountName, String assetName) { + return listStreamingLocatorsWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body(); + } + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listStreamingLocatorsAsync(String resourceGroupName, String accountName, String assetName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listStreamingLocatorsWithServiceResponseAsync(resourceGroupName, accountName, assetName), serviceCallback); + } + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListStreamingLocatorsResponseInner object + */ + public Observable listStreamingLocatorsAsync(String resourceGroupName, String accountName, String assetName) { + return listStreamingLocatorsWithServiceResponseAsync(resourceGroupName, accountName, assetName).map(new Func1, ListStreamingLocatorsResponseInner>() { + @Override + public ListStreamingLocatorsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists Streaming Locators which are associated with this asset. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListStreamingLocatorsResponseInner object + */ + public Observable> listStreamingLocatorsWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (assetName == null) { + throw new IllegalArgumentException("Parameter assetName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listStreamingLocators(this.client.subscriptionId(), resourceGroupName, accountName, assetName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listStreamingLocatorsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listStreamingLocatorsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AssetInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AssetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Assets. + * List Assets in the Media Services account with optional filtering and ordering. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AssetInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AzureMediaServicesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AzureMediaServicesImpl.java new file mode 100644 index 000000000000..0902f96f81c8 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AzureMediaServicesImpl.java @@ -0,0 +1,378 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AzureMediaServicesImpl class. + */ +public class AzureMediaServicesImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The unique identifier for a Microsoft Azure subscription. */ + private String subscriptionId; + + /** + * Gets The unique identifier for a Microsoft Azure subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The unique identifier for a Microsoft Azure subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AzureMediaServicesImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The Version of the API to be used with the client request. */ + private String apiVersion; + + /** + * Gets The Version of the API to be used with the client request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AzureMediaServicesImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AzureMediaServicesImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AzureMediaServicesImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AccountFiltersInner object to access its operations. + */ + private AccountFiltersInner accountFilters; + + /** + * Gets the AccountFiltersInner object to access its operations. + * @return the AccountFiltersInner object. + */ + public AccountFiltersInner accountFilters() { + return this.accountFilters; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The MediaservicesInner object to access its operations. + */ + private MediaservicesInner mediaservices; + + /** + * Gets the MediaservicesInner object to access its operations. + * @return the MediaservicesInner object. + */ + public MediaservicesInner mediaservices() { + return this.mediaservices; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The AssetsInner object to access its operations. + */ + private AssetsInner assets; + + /** + * Gets the AssetsInner object to access its operations. + * @return the AssetsInner object. + */ + public AssetsInner assets() { + return this.assets; + } + + /** + * The AssetFiltersInner object to access its operations. + */ + private AssetFiltersInner assetFilters; + + /** + * Gets the AssetFiltersInner object to access its operations. + * @return the AssetFiltersInner object. + */ + public AssetFiltersInner assetFilters() { + return this.assetFilters; + } + + /** + * The ContentKeyPoliciesInner object to access its operations. + */ + private ContentKeyPoliciesInner contentKeyPolicies; + + /** + * Gets the ContentKeyPoliciesInner object to access its operations. + * @return the ContentKeyPoliciesInner object. + */ + public ContentKeyPoliciesInner contentKeyPolicies() { + return this.contentKeyPolicies; + } + + /** + * The TransformsInner object to access its operations. + */ + private TransformsInner transforms; + + /** + * Gets the TransformsInner object to access its operations. + * @return the TransformsInner object. + */ + public TransformsInner transforms() { + return this.transforms; + } + + /** + * The JobsInner object to access its operations. + */ + private JobsInner jobs; + + /** + * Gets the JobsInner object to access its operations. + * @return the JobsInner object. + */ + public JobsInner jobs() { + return this.jobs; + } + + /** + * The StreamingPoliciesInner object to access its operations. + */ + private StreamingPoliciesInner streamingPolicies; + + /** + * Gets the StreamingPoliciesInner object to access its operations. + * @return the StreamingPoliciesInner object. + */ + public StreamingPoliciesInner streamingPolicies() { + return this.streamingPolicies; + } + + /** + * The StreamingLocatorsInner object to access its operations. + */ + private StreamingLocatorsInner streamingLocators; + + /** + * Gets the StreamingLocatorsInner object to access its operations. + * @return the StreamingLocatorsInner object. + */ + public StreamingLocatorsInner streamingLocators() { + return this.streamingLocators; + } + + /** + * The LiveEventsInner object to access its operations. + */ + private LiveEventsInner liveEvents; + + /** + * Gets the LiveEventsInner object to access its operations. + * @return the LiveEventsInner object. + */ + public LiveEventsInner liveEvents() { + return this.liveEvents; + } + + /** + * The LiveOutputsInner object to access its operations. + */ + private LiveOutputsInner liveOutputs; + + /** + * Gets the LiveOutputsInner object to access its operations. + * @return the LiveOutputsInner object. + */ + public LiveOutputsInner liveOutputs() { + return this.liveOutputs; + } + + /** + * The StreamingEndpointsInner object to access its operations. + */ + private StreamingEndpointsInner streamingEndpoints; + + /** + * Gets the StreamingEndpointsInner object to access its operations. + * @return the StreamingEndpointsInner object. + */ + public StreamingEndpointsInner streamingEndpoints() { + return this.streamingEndpoints; + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param credentials the management credentials for Azure + */ + public AzureMediaServicesImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AzureMediaServicesImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param restClient the REST client to connect to Azure. + */ + public AzureMediaServicesImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-07-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.accountFilters = new AccountFiltersInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.mediaservices = new MediaservicesInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.assets = new AssetsInner(restClient().retrofit(), this); + this.assetFilters = new AssetFiltersInner(restClient().retrofit(), this); + this.contentKeyPolicies = new ContentKeyPoliciesInner(restClient().retrofit(), this); + this.transforms = new TransformsInner(restClient().retrofit(), this); + this.jobs = new JobsInner(restClient().retrofit(), this); + this.streamingPolicies = new StreamingPoliciesInner(restClient().retrofit(), this); + this.streamingLocators = new StreamingLocatorsInner(restClient().retrofit(), this); + this.liveEvents = new LiveEventsInner(restClient().retrofit(), this); + this.liveOutputs = new LiveOutputsInner(restClient().retrofit(), this); + this.streamingEndpoints = new StreamingEndpointsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AzureMediaServices", "2018-07-01"); + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesImpl.java new file mode 100644 index 000000000000..dc1e487e7f3a --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesImpl.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyProperties; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicy; + +class ContentKeyPoliciesImpl extends WrapperImpl implements ContentKeyPolicies { + private final MediaManager manager; + + ContentKeyPoliciesImpl(MediaManager manager) { + super(manager.inner().contentKeyPolicies()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public ContentKeyPolicyImpl define(String name) { + return wrapModel(name); + } + + private ContentKeyPolicyImpl wrapModel(ContentKeyPolicyInner inner) { + return new ContentKeyPolicyImpl(inner, manager()); + } + + private ContentKeyPolicyImpl wrapModel(String name) { + return new ContentKeyPolicyImpl(name, this.manager()); + } + + @Override + public Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPoliciesInner client = this.inner(); + return client.getPolicyPropertiesWithSecretsAsync(resourceGroupName, accountName, contentKeyPolicyName) + .map(new Func1() { + @Override + public ContentKeyPolicyProperties call(ContentKeyPolicyPropertiesInner inner) { + return new ContentKeyPolicyPropertiesImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + ContentKeyPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContentKeyPolicy call(ContentKeyPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, contentKeyPolicyName) + .map(new Func1() { + @Override + public ContentKeyPolicy call(ContentKeyPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, contentKeyPolicyName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java new file mode 100644 index 000000000000..7e244a7e6094 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java @@ -0,0 +1,983 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContentKeyPolicies. + */ +public class ContentKeyPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private ContentKeyPoliciesService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of ContentKeyPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContentKeyPoliciesInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(ContentKeyPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContentKeyPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ContentKeyPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Body ContentKeyPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Body ContentKeyPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies getPolicyPropertiesWithSecrets" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/contentKeyPolicies/{contentKeyPolicyName}/getPolicyPropertiesWithSecrets") + Observable> getPolicyPropertiesWithSecrets(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("contentKeyPolicyName") String contentKeyPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContentKeyPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContentKeyPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyInner object if successful. + */ + public ContentKeyPolicyInner get(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, ContentKeyPolicyInner>() { + @Override + public ContentKeyPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Content Key Policy. + * Get the details of a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyInner object if successful. + */ + public ContentKeyPolicyInner createOrUpdate(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters), serviceCallback); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1, ContentKeyPolicyInner>() { + @Override + public ContentKeyPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Content Key Policy. + * Create or update a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String contentKeyPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Content Key Policy. + * Deletes a Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyInner object if successful. + */ + public ContentKeyPolicyInner update(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters), serviceCallback); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).map(new Func1, ContentKeyPolicyInner>() { + @Override + public ContentKeyPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Content Key Policy. + * Updates an existing Content Key Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContentKeyPolicyPropertiesInner object if successful. + */ + public ContentKeyPolicyPropertiesInner getPolicyPropertiesWithSecrets(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).toBlocking().single().body(); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName), serviceCallback); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyPropertiesInner object + */ + public Observable getPolicyPropertiesWithSecretsAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getPolicyPropertiesWithSecretsWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1, ContentKeyPolicyPropertiesInner>() { + @Override + public ContentKeyPolicyPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Content Key Policy with secrets. + * Get a Content Key Policy including secret values. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param contentKeyPolicyName The Content Key Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContentKeyPolicyPropertiesInner object + */ + public Observable> getPolicyPropertiesWithSecretsWithServiceResponseAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (contentKeyPolicyName == null) { + throw new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getPolicyPropertiesWithSecrets(this.client.subscriptionId(), resourceGroupName, accountName, contentKeyPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPolicyPropertiesWithSecretsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPolicyPropertiesWithSecretsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContentKeyPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContentKeyPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Content Key Policies. + * Lists the Content Key Policies in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContentKeyPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyImpl.java new file mode 100644 index 000000000000..aefaf77a50c0 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyOption; + +class ContentKeyPolicyImpl extends CreatableUpdatableImpl implements ContentKeyPolicy, ContentKeyPolicy.Definition, ContentKeyPolicy.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String contentKeyPolicyName; + + ContentKeyPolicyImpl(String name, MediaManager manager) { + super(name, new ContentKeyPolicyInner()); + this.manager = manager; + // Set resource name + this.contentKeyPolicyName = name; + // + } + + ContentKeyPolicyImpl(ContentKeyPolicyInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.contentKeyPolicyName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.contentKeyPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "contentKeyPolicies"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContentKeyPoliciesInner client = this.manager().inner().contentKeyPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.contentKeyPolicyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List options() { + return this.inner().options(); + } + + @Override + public UUID policyId() { + return this.inner().policyId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ContentKeyPolicyImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public ContentKeyPolicyImpl withOptions(List options) { + this.inner().withOptions(options); + return this; + } + + @Override + public ContentKeyPolicyImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyInner.java new file mode 100644 index 000000000000..02ac53171b59 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyInner.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyOption; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Content Key Policy resource. + */ +@JsonFlatten +public class ContentKeyPolicyInner extends ProxyResource { + /** + * The legacy Policy ID. + */ + @JsonProperty(value = "properties.policyId", access = JsonProperty.Access.WRITE_ONLY) + private UUID policyId; + + /** + * The creation date of the Policy. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The last modified date of the Policy. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * A description for the Policy. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The Key Policy options. + */ + @JsonProperty(value = "properties.options", required = true) + private List options; + + /** + * Get the legacy Policy ID. + * + * @return the policyId value + */ + public UUID policyId() { + return this.policyId; + } + + /** + * Get the creation date of the Policy. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the last modified date of the Policy. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get a description for the Policy. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for the Policy. + * + * @param description the description value to set + * @return the ContentKeyPolicyInner object itself. + */ + public ContentKeyPolicyInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Key Policy options. + * + * @return the options value + */ + public List options() { + return this.options; + } + + /** + * Set the Key Policy options. + * + * @param options the options value to set + * @return the ContentKeyPolicyInner object itself. + */ + public ContentKeyPolicyInner withOptions(List options) { + this.options = options; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesImpl.java new file mode 100644 index 000000000000..6e7a21fb08d9 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyProperties; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyOption; +import java.util.UUID; + +class ContentKeyPolicyPropertiesImpl extends WrapperImpl implements ContentKeyPolicyProperties { + private final MediaManager manager; + ContentKeyPolicyPropertiesImpl(ContentKeyPolicyPropertiesInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public List options() { + return this.inner().options(); + } + + @Override + public UUID policyId() { + return this.inner().policyId(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesInner.java new file mode 100644 index 000000000000..50940a83334d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPolicyPropertiesInner.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicyOption; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Content Key Policy. + */ +public class ContentKeyPolicyPropertiesInner { + /** + * The legacy Policy ID. + */ + @JsonProperty(value = "policyId", access = JsonProperty.Access.WRITE_ONLY) + private UUID policyId; + + /** + * The creation date of the Policy. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The last modified date of the Policy. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * A description for the Policy. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The Key Policy options. + */ + @JsonProperty(value = "options", required = true) + private List options; + + /** + * Get the legacy Policy ID. + * + * @return the policyId value + */ + public UUID policyId() { + return this.policyId; + } + + /** + * Get the creation date of the Policy. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the last modified date of the Policy. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get a description for the Policy. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description for the Policy. + * + * @param description the description value to set + * @return the ContentKeyPolicyPropertiesInner object itself. + */ + public ContentKeyPolicyPropertiesInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Key Policy options. + * + * @return the options value + */ + public List options() { + return this.options; + } + + /** + * Set the Key Policy options. + * + * @param options the options value to set + * @return the ContentKeyPolicyPropertiesInner object itself. + */ + public ContentKeyPolicyPropertiesInner withOptions(List options) { + this.options = options; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputImpl.java new file mode 100644 index 000000000000..ce956de3dac3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.EntityNameAvailabilityCheckOutput; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EntityNameAvailabilityCheckOutputImpl extends WrapperImpl implements EntityNameAvailabilityCheckOutput { + private final MediaManager manager; + EntityNameAvailabilityCheckOutputImpl(EntityNameAvailabilityCheckOutputInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputInner.java new file mode 100644 index 000000000000..ccb10b352d7d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/EntityNameAvailabilityCheckOutputInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the check name availability request. + */ +public class EntityNameAvailabilityCheckOutputInner { + /** + * Specifies if the name is available. + */ + @JsonProperty(value = "nameAvailable", required = true) + private boolean nameAvailable; + + /** + * Specifies the reason if the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * Specifies the detailed reason if the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get specifies if the name is available. + * + * @return the nameAvailable value + */ + public boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set specifies if the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the EntityNameAvailabilityCheckOutputInner object itself. + */ + public EntityNameAvailabilityCheckOutputInner withNameAvailable(boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get specifies the reason if the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set specifies the reason if the name is not available. + * + * @param reason the reason value to set + * @return the EntityNameAvailabilityCheckOutputInner object itself. + */ + public EntityNameAvailabilityCheckOutputInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get specifies the detailed reason if the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set specifies the detailed reason if the name is not available. + * + * @param message the message value to set + * @return the EntityNameAvailabilityCheckOutputInner object itself. + */ + public EntityNameAvailabilityCheckOutputInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/IdParsingUtils.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..d5fcbaae3f04 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobImpl.java new file mode 100644 index 000000000000..a4581708e619 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobImpl.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.Job; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobInput; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobOutput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Priority; +import java.util.Map; + +class JobImpl extends CreatableUpdatableImpl implements Job, Job.Definition, Job.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String transformName; + private String jobName; + + JobImpl(String name, MediaManager manager) { + super(name, new JobInner()); + this.manager = manager; + // Set resource name + this.jobName = name; + // + } + + JobImpl(JobInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.jobName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.transformName = IdParsingUtils.getValueFromIdByName(inner.id(), "transforms"); + this.jobName = IdParsingUtils.getValueFromIdByName(inner.id(), "jobs"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.getAsync(this.resourceGroupName, this.accountName, this.transformName, this.jobName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Map correlationData() { + return this.inner().correlationData(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public JobInput input() { + return this.inner().input(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outputs() { + return this.inner().outputs(); + } + + @Override + public Priority priority() { + return this.inner().priority(); + } + + @Override + public JobState state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public JobImpl withExistingTransform(String resourceGroupName, String accountName, String transformName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.transformName = transformName; + return this; + } + + @Override + public JobImpl withInput(JobInput input) { + this.inner().withInput(input); + return this; + } + + @Override + public JobImpl withOutputs(List outputs) { + this.inner().withOutputs(outputs); + return this; + } + + @Override + public JobImpl withCorrelationData(Map correlationData) { + this.inner().withCorrelationData(correlationData); + return this; + } + + @Override + public JobImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public JobImpl withPriority(Priority priority) { + this.inner().withPriority(priority); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobInner.java new file mode 100644 index 000000000000..12560283a830 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobInner.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobInput; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.JobOutput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Priority; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Job resource type. The progress and state can be obtained by polling a Job + * or subscribing to events using EventGrid. + */ +@JsonFlatten +public class JobInner extends ProxyResource { + /** + * The UTC date and time when the Job was created, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The current state of the job. Possible values include: 'Canceled', + * 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private JobState state; + + /** + * Optional customer supplied description of the Job. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The inputs for the Job. + */ + @JsonProperty(value = "properties.input", required = true) + private JobInput input; + + /** + * The UTC date and time when the Job was last updated, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The outputs for the Job. + */ + @JsonProperty(value = "properties.outputs", required = true) + private List outputs; + + /** + * Priority with which the job should be processed. Higher priority jobs + * are processed before lower priority jobs. If not set, the default is + * normal. Possible values include: 'Low', 'Normal', 'High'. + */ + @JsonProperty(value = "properties.priority") + private Priority priority; + + /** + * Customer provided correlation data that will be returned in Job and + * JobOutput state events. + */ + @JsonProperty(value = "properties.correlationData") + private Map correlationData; + + /** + * Get the UTC date and time when the Job was created, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the current state of the job. Possible values include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', 'Scheduled'. + * + * @return the state value + */ + public JobState state() { + return this.state; + } + + /** + * Get optional customer supplied description of the Job. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set optional customer supplied description of the Job. + * + * @param description the description value to set + * @return the JobInner object itself. + */ + public JobInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the inputs for the Job. + * + * @return the input value + */ + public JobInput input() { + return this.input; + } + + /** + * Set the inputs for the Job. + * + * @param input the input value to set + * @return the JobInner object itself. + */ + public JobInner withInput(JobInput input) { + this.input = input; + return this; + } + + /** + * Get the UTC date and time when the Job was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the outputs for the Job. + * + * @return the outputs value + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs for the Job. + * + * @param outputs the outputs value to set + * @return the JobInner object itself. + */ + public JobInner withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @return the priority value + */ + public Priority priority() { + return this.priority; + } + + /** + * Set priority with which the job should be processed. Higher priority jobs are processed before lower priority jobs. If not set, the default is normal. Possible values include: 'Low', 'Normal', 'High'. + * + * @param priority the priority value to set + * @return the JobInner object itself. + */ + public JobInner withPriority(Priority priority) { + this.priority = priority; + return this; + } + + /** + * Get customer provided correlation data that will be returned in Job and JobOutput state events. + * + * @return the correlationData value + */ + public Map correlationData() { + return this.correlationData; + } + + /** + * Set customer provided correlation data that will be returned in Job and JobOutput state events. + * + * @param correlationData the correlationData value to set + * @return the JobInner object itself. + */ + public JobInner withCorrelationData(Map correlationData) { + this.correlationData = correlationData; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsImpl.java new file mode 100644 index 000000000000..5304ba38fa3e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Job; + +class JobsImpl extends WrapperImpl implements Jobs { + private final MediaManager manager; + + JobsImpl(MediaManager manager) { + super(manager.inner().jobs()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public JobImpl define(String name) { + return wrapModel(name); + } + + private JobImpl wrapModel(JobInner inner) { + return new JobImpl(inner, manager()); + } + + private JobImpl wrapModel(String name) { + return new JobImpl(name, this.manager()); + } + + @Override + public Completable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + JobsInner client = this.inner(); + return client.cancelJobAsync(resourceGroupName, accountName, transformName, jobName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName, final String transformName) { + JobsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, transformName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Job call(JobInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + JobsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, transformName, jobName) + .map(new Func1() { + @Override + public Job call(JobInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + JobsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, transformName, jobName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsInner.java new file mode 100644 index 000000000000..72299bf41d19 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/JobsInner.java @@ -0,0 +1,1031 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Jobs. + */ +public class JobsInner { + /** The Retrofit service to perform REST calls. */ + private JobsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of JobsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(JobsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Jobs to be + * used by Retrofit to perform actually REST calls. + */ + interface JobsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Body JobInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Body JobInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs cancelJob" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}/cancelJob") + Observable> cancelJob(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String transformName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, transformName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String transformName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, transformName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String transformName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, transformName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String transformName) { + return listSinglePageAsync(resourceGroupName, accountName, transformName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String transformName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + return listWithServiceResponseAsync(resourceGroupName, accountName, transformName, filter, top, skip) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + return listSinglePageAsync(resourceGroupName, accountName, transformName, filter, top, skip) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param transformName The Transform name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String transformName, final String filter, final Integer top, final Integer skip) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner get(String resourceGroupName, String accountName, String transformName, String jobName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Job. + * Gets a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner create(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).toBlocking().single().body(); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters), serviceCallback); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Job. + * Creates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String transformName, String jobName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Job. + * Deletes a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update Job. + * Updates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner update(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).toBlocking().single().body(); + } + + /** + * Update Job. + * Updates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters), serviceCallback); + } + + /** + * Update Job. + * Updates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update Job. + * Updates a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void cancelJob(String resourceGroupName, String accountName, String transformName, String jobName) { + cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body(); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName), serviceCallback); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable cancelJobAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return cancelJobWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel Job. + * Cancel a Job. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param jobName The Job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> cancelJobWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.cancelJob(this.client.subscriptionId(), resourceGroupName, accountName, transformName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelJobDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Jobs. + * Lists all of the Jobs for the Transform. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseImpl.java new file mode 100644 index 000000000000..d5a21d5b6df3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListContentKeysResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocatorContentKey; + +class ListContentKeysResponseImpl extends WrapperImpl implements ListContentKeysResponse { + private final MediaManager manager; + ListContentKeysResponseImpl(ListContentKeysResponseInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List contentKeys() { + return this.inner().contentKeys(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseInner.java new file mode 100644 index 000000000000..b6aedf834354 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListContentKeysResponseInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocatorContentKey; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class of response for listContentKeys action. + */ +public class ListContentKeysResponseInner { + /** + * ContentKeys used by current Streaming Locator. + */ + @JsonProperty(value = "contentKeys") + private List contentKeys; + + /** + * Get contentKeys used by current Streaming Locator. + * + * @return the contentKeys value + */ + public List contentKeys() { + return this.contentKeys; + } + + /** + * Set contentKeys used by current Streaming Locator. + * + * @param contentKeys the contentKeys value to set + * @return the ListContentKeysResponseInner object itself. + */ + public ListContentKeysResponseInner withContentKeys(List contentKeys) { + this.contentKeys = contentKeys; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseImpl.java new file mode 100644 index 000000000000..133b5c594af5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListPathsResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPath; + +class ListPathsResponseImpl extends WrapperImpl implements ListPathsResponse { + private final MediaManager manager; + ListPathsResponseImpl(ListPathsResponseInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List downloadPaths() { + return this.inner().downloadPaths(); + } + + @Override + public List streamingPaths() { + return this.inner().streamingPaths(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseInner.java new file mode 100644 index 000000000000..daa7825bc039 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListPathsResponseInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPath; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class of response for listPaths action. + */ +public class ListPathsResponseInner { + /** + * Streaming Paths supported by current Streaming Locator. + */ + @JsonProperty(value = "streamingPaths") + private List streamingPaths; + + /** + * Download Paths supported by current Streaming Locator. + */ + @JsonProperty(value = "downloadPaths") + private List downloadPaths; + + /** + * Get streaming Paths supported by current Streaming Locator. + * + * @return the streamingPaths value + */ + public List streamingPaths() { + return this.streamingPaths; + } + + /** + * Set 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 download Paths supported by current Streaming Locator. + * + * @return the downloadPaths value + */ + public List downloadPaths() { + return this.downloadPaths; + } + + /** + * Set 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; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseImpl.java new file mode 100644 index 000000000000..e1a13fceec0e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListStreamingLocatorsResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetStreamingLocator; + +class ListStreamingLocatorsResponseImpl extends WrapperImpl implements ListStreamingLocatorsResponse { + private final MediaManager manager; + ListStreamingLocatorsResponseImpl(ListStreamingLocatorsResponseInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List streamingLocators() { + return this.inner().streamingLocators(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseInner.java new file mode 100644 index 000000000000..59e7e01f1ae3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ListStreamingLocatorsResponseInner.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetStreamingLocator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Streaming Locators associated with this Asset. + */ +public class ListStreamingLocatorsResponseInner { + /** + * The list of Streaming Locators. + */ + @JsonProperty(value = "streamingLocators", access = JsonProperty.Access.WRITE_ONLY) + private List streamingLocators; + + /** + * Get the list of Streaming Locators. + * + * @return the streamingLocators value + */ + public List streamingLocators() { + return this.streamingLocators; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventImpl.java new file mode 100644 index 000000000000..0210a9bfde14 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventImpl.java @@ -0,0 +1,222 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvent; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventInput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventPreview; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventEncoding; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventResourceState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CrossSiteAccessPolicies; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamOptionsFlag; +import org.joda.time.DateTime; + +class LiveEventImpl extends CreatableUpdatableImpl implements LiveEvent, LiveEvent.Definition, LiveEvent.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String liveEventName; + + LiveEventImpl(String name, MediaManager manager) { + super(name, new LiveEventInner()); + this.manager = manager; + // Set resource name + this.liveEventName = name; + // + } + + LiveEventImpl(LiveEventInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.liveEventName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); + this.liveEventName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveEvents"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + LiveEventsInner client = this.manager().inner().liveEvents(); + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LiveEventsInner client = this.manager().inner().liveEvents(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LiveEventsInner client = this.manager().inner().liveEvents(); + return client.getAsync(this.resourceGroupName, this.accountName, this.liveEventName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.inner().crossSiteAccessPolicies(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public LiveEventEncoding encoding() { + return this.inner().encoding(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public LiveEventInput input() { + return this.inner().input(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public LiveEventPreview preview() { + return this.inner().preview(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public LiveEventResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public List streamOptions() { + return this.inner().streamOptions(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Boolean vanityUrl() { + return this.inner().vanityUrl(); + } + + @Override + public LiveEventImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public LiveEventImpl withInput(LiveEventInput input) { + this.inner().withInput(input); + return this; + } + + @Override + public LiveEventImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.inner().withCrossSiteAccessPolicies(crossSiteAccessPolicies); + return this; + } + + @Override + public LiveEventImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public LiveEventImpl withEncoding(LiveEventEncoding encoding) { + this.inner().withEncoding(encoding); + return this; + } + + @Override + public LiveEventImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public LiveEventImpl withPreview(LiveEventPreview preview) { + this.inner().withPreview(preview); + return this; + } + + @Override + public LiveEventImpl withStreamOptions(List streamOptions) { + this.inner().withStreamOptions(streamOptions); + return this; + } + + @Override + public LiveEventImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public LiveEventImpl withVanityUrl(Boolean vanityUrl) { + this.inner().withVanityUrl(vanityUrl); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventInner.java new file mode 100644 index 000000000000..01c180888df5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventInner.java @@ -0,0 +1,275 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventInput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventPreview; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventEncoding; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventResourceState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CrossSiteAccessPolicies; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamOptionsFlag; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The Live Event. + */ +@JsonFlatten +@SkipParentValidation +public class LiveEventInner extends Resource { + /** + * The Live Event description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The Live Event input. + */ + @JsonProperty(value = "properties.input", required = true) + private LiveEventInput input; + + /** + * The Live Event preview. + */ + @JsonProperty(value = "properties.preview") + private LiveEventPreview preview; + + /** + * The Live Event encoding. + */ + @JsonProperty(value = "properties.encoding") + private LiveEventEncoding encoding; + + /** + * The provisioning state of the Live Event. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource state of the Live Event. Possible values include: + * 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private LiveEventResourceState resourceState; + + /** + * The Live Event access policies. + */ + @JsonProperty(value = "properties.crossSiteAccessPolicies") + private CrossSiteAccessPolicies crossSiteAccessPolicies; + + /** + * Specifies whether to use a vanity url with the Live Event. This value + * is specified at creation time and cannot be updated. + */ + @JsonProperty(value = "properties.vanityUrl") + private Boolean vanityUrl; + + /** + * The options to use for the LiveEvent. This value is specified at + * creation time and cannot be updated. + */ + @JsonProperty(value = "properties.streamOptions") + private List streamOptions; + + /** + * The exact time the Live Event was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The exact time the Live Event was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * Get the Live Event description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the Live Event description. + * + * @param description the description value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the Live Event input. + * + * @return the input value + */ + public LiveEventInput input() { + return this.input; + } + + /** + * Set the Live Event input. + * + * @param input the input value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withInput(LiveEventInput input) { + this.input = input; + return this; + } + + /** + * Get the Live Event preview. + * + * @return the preview value + */ + public LiveEventPreview preview() { + return this.preview; + } + + /** + * Set the Live Event preview. + * + * @param preview the preview value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withPreview(LiveEventPreview preview) { + this.preview = preview; + return this; + } + + /** + * Get the Live Event encoding. + * + * @return the encoding value + */ + public LiveEventEncoding encoding() { + return this.encoding; + } + + /** + * Set the Live Event encoding. + * + * @param encoding the encoding value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withEncoding(LiveEventEncoding encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get the provisioning state of the Live Event. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource state of the Live Event. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting'. + * + * @return the resourceState value + */ + public LiveEventResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the Live Event access policies. + * + * @return the crossSiteAccessPolicies value + */ + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.crossSiteAccessPolicies; + } + + /** + * Set the Live Event access policies. + * + * @param crossSiteAccessPolicies the crossSiteAccessPolicies value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.crossSiteAccessPolicies = crossSiteAccessPolicies; + return this; + } + + /** + * Get specifies whether to use a vanity url with the Live Event. This value is specified at creation time and cannot be updated. + * + * @return the vanityUrl value + */ + public Boolean vanityUrl() { + return this.vanityUrl; + } + + /** + * Set specifies whether to use a vanity url with the Live Event. This value is specified at creation time and cannot be updated. + * + * @param vanityUrl the vanityUrl value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withVanityUrl(Boolean vanityUrl) { + this.vanityUrl = vanityUrl; + return this; + } + + /** + * Get the options to use for the LiveEvent. This value is specified at creation time and cannot be updated. + * + * @return the streamOptions value + */ + public List streamOptions() { + return this.streamOptions; + } + + /** + * Set the options to use for the LiveEvent. This value is specified at creation time and cannot be updated. + * + * @param streamOptions the streamOptions value to set + * @return the LiveEventInner object itself. + */ + public LiveEventInner withStreamOptions(List streamOptions) { + this.streamOptions = streamOptions; + return this; + } + + /** + * Get the exact time the Live Event was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the exact time the Live Event was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsImpl.java new file mode 100644 index 000000000000..4fc91cbad990 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvent; + +class LiveEventsImpl extends WrapperImpl implements LiveEvents { + private final MediaManager manager; + + LiveEventsImpl(MediaManager manager) { + super(manager.inner().liveEvents()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public LiveEventImpl define(String name) { + return wrapModel(name); + } + + private LiveEventImpl wrapModel(LiveEventInner inner) { + return new LiveEventImpl(inner, manager()); + } + + private LiveEventImpl wrapModel(String name) { + return new LiveEventImpl(name, this.manager()); + } + + @Override + public Completable startAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.startAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.stopAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + + @Override + public Completable resetAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.resetAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + LiveEventsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LiveEvent call(LiveEventInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, liveEventName) + .map(new Func1() { + @Override + public LiveEvent call(LiveEventInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName) { + LiveEventsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, liveEventName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsInner.java new file mode 100644 index 000000000000..c2983442e625 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveEventsInner.java @@ -0,0 +1,1936 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEventActionInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LiveEvents. + */ +public class LiveEventsInner { + /** The Retrofit service to perform REST calls. */ + private LiveEventsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of LiveEventsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LiveEventsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(LiveEventsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LiveEvents to be + * used by Retrofit to perform actually REST calls. + */ + interface LiveEventsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Body LiveEventInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LiveEventActionInput parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LiveEventActionInput parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents reset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset") + Observable> reset(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents beginReset" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset") + Observable> beginReset(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveEventInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveEventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner get(String resourceGroupName, String accountName, String liveEventName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Live Event. + * Gets a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner create(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().last().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner create(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).toBlocking().last().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner beginCreate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().single().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner beginCreate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).toBlocking().single().body(); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart), serviceCallback); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Event. + * Creates a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner update(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().last().body(); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveEventInner object if successful. + */ + public LiveEventInner beginUpdate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().single().body(); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters), serviceCallback); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1, LiveEventInner>() { + @Override + public LiveEventInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param parameters Live Event properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveEventInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String liveEventName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String liveEventName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String liveEventName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Event. + * Deletes a Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String accountName, String liveEventName) { + startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String accountName, String liveEventName) { + return startWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String accountName, String liveEventName) { + beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginStartWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start Live Event. + * Starts an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String accountName, String liveEventName) { + stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String accountName, String liveEventName) { + return stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean removeOutputsOnStop = null; + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(null); + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).toBlocking().last().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + return stopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(removeOutputsOnStop); + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String accountName, String liveEventName) { + beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Boolean removeOutputsOnStop = null; + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(null); + return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).toBlocking().single().body(); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop), serviceCallback); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + return beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop Live Event. + * Stops an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + LiveEventActionInput parameters = new LiveEventActionInput(); + parameters.withRemoveOutputsOnStop(removeOutputsOnStop); + return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void reset(String resourceGroupName, String accountName, String liveEventName) { + resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().last().body(); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resetAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String accountName, String liveEventName) { + return resetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.reset(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginReset(String resourceGroupName, String accountName, String liveEventName) { + beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body(); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResetAsync(String resourceGroupName, String accountName, String liveEventName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName), serviceCallback); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResetAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Reset Live Event. + * Resets an existing Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginReset(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResetDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveEventInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveEventInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Events. + * Lists the Live Events in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveEventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputImpl.java new file mode 100644 index 000000000000..c9785f779cba --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputImpl.java @@ -0,0 +1,187 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutput; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.Period; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Hls; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputResourceState; + +class LiveOutputImpl extends CreatableUpdatableImpl implements LiveOutput, LiveOutput.Definition, LiveOutput.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String liveEventName; + private String liveOutputName; + + LiveOutputImpl(String name, MediaManager manager) { + super(name, new LiveOutputInner()); + this.manager = manager; + // Set resource name + this.liveOutputName = name; + // + } + + LiveOutputImpl(LiveOutputInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.liveOutputName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); + this.liveEventName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveEvents"); + this.liveOutputName = IdParsingUtils.getValueFromIdByName(inner.id(), "liveOutputs"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + LiveOutputsInner client = this.manager().inner().liveOutputs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LiveOutputsInner client = this.manager().inner().liveOutputs(); + return client.createAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LiveOutputsInner client = this.manager().inner().liveOutputs(); + return client.getAsync(this.resourceGroupName, this.accountName, this.liveEventName, this.liveOutputName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Period archiveWindowLength() { + return this.inner().archiveWindowLength(); + } + + @Override + public String assetName() { + return this.inner().assetName(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public Hls hls() { + return this.inner().hls(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String manifestName() { + return this.inner().manifestName(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Long outputSnapTime() { + return this.inner().outputSnapTime(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public LiveOutputResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public LiveOutputImpl withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.liveEventName = liveEventName; + return this; + } + + @Override + public LiveOutputImpl withArchiveWindowLength(Period archiveWindowLength) { + this.inner().withArchiveWindowLength(archiveWindowLength); + return this; + } + + @Override + public LiveOutputImpl withAssetName(String assetName) { + this.inner().withAssetName(assetName); + return this; + } + + @Override + public LiveOutputImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public LiveOutputImpl withHls(Hls hls) { + this.inner().withHls(hls); + return this; + } + + @Override + public LiveOutputImpl withManifestName(String manifestName) { + this.inner().withManifestName(manifestName); + return this; + } + + @Override + public LiveOutputImpl withOutputSnapTime(Long outputSnapTime) { + this.inner().withOutputSnapTime(outputSnapTime); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputInner.java new file mode 100644 index 000000000000..a9c6f733a257 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputInner.java @@ -0,0 +1,243 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.Period; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Hls; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputResourceState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Live Output. + */ +@JsonFlatten +public class LiveOutputInner extends ProxyResource { + /** + * The description of the Live Output. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The asset name. + */ + @JsonProperty(value = "properties.assetName", required = true) + private String assetName; + + /** + * ISO 8601 timespan duration of the archive window length. This is + * duration that customer want to retain the recorded content. + */ + @JsonProperty(value = "properties.archiveWindowLength", required = true) + private Period archiveWindowLength; + + /** + * The manifest file name. If not provided, the service will generate one + * automatically. + */ + @JsonProperty(value = "properties.manifestName") + private String manifestName; + + /** + * The HLS configuration. + */ + @JsonProperty(value = "properties.hls") + private Hls hls; + + /** + * The output snapshot time. + */ + @JsonProperty(value = "properties.outputSnapTime") + private Long outputSnapTime; + + /** + * The exact time the Live Output was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The exact time the Live Output was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The provisioning state of the Live Output. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource state of the Live Output. Possible values include: + * 'Creating', 'Running', 'Deleting'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private LiveOutputResourceState resourceState; + + /** + * Get the description of the Live Output. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the Live Output. + * + * @param description the description value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the asset name. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the asset name. + * + * @param assetName the assetName value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get iSO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. + * + * @return the archiveWindowLength value + */ + public Period archiveWindowLength() { + return this.archiveWindowLength; + } + + /** + * Set iSO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content. + * + * @param archiveWindowLength the archiveWindowLength value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withArchiveWindowLength(Period archiveWindowLength) { + this.archiveWindowLength = archiveWindowLength; + return this; + } + + /** + * Get the manifest file name. If not provided, the service will generate one automatically. + * + * @return the manifestName value + */ + public String manifestName() { + return this.manifestName; + } + + /** + * Set the manifest file name. If not provided, the service will generate one automatically. + * + * @param manifestName the manifestName value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withManifestName(String manifestName) { + this.manifestName = manifestName; + return this; + } + + /** + * Get the HLS configuration. + * + * @return the hls value + */ + public Hls hls() { + return this.hls; + } + + /** + * Set the HLS configuration. + * + * @param hls the hls value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withHls(Hls hls) { + this.hls = hls; + return this; + } + + /** + * Get the output snapshot time. + * + * @return the outputSnapTime value + */ + public Long outputSnapTime() { + return this.outputSnapTime; + } + + /** + * Set the output snapshot time. + * + * @param outputSnapTime the outputSnapTime value to set + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withOutputSnapTime(Long outputSnapTime) { + this.outputSnapTime = outputSnapTime; + return this; + } + + /** + * Get the exact time the Live Output was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the exact time the Live Output was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the provisioning state of the Live Output. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource state of the Live Output. Possible values include: 'Creating', 'Running', 'Deleting'. + * + * @return the resourceState value + */ + public LiveOutputResourceState resourceState() { + return this.resourceState; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsImpl.java new file mode 100644 index 000000000000..0627ddb54d4c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutput; + +class LiveOutputsImpl extends WrapperImpl implements LiveOutputs { + private final MediaManager manager; + + LiveOutputsImpl(MediaManager manager) { + super(manager.inner().liveOutputs()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public LiveOutputImpl define(String name) { + return wrapModel(name); + } + + private LiveOutputImpl wrapModel(LiveOutputInner inner) { + return new LiveOutputImpl(inner, manager()); + } + + private LiveOutputImpl wrapModel(String name) { + return new LiveOutputImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + LiveOutputsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName, liveEventName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public LiveOutput call(LiveOutputInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + LiveOutputsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, liveEventName, liveOutputName) + .map(new Func1() { + @Override + public LiveOutput call(LiveOutputInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + LiveOutputsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsInner.java new file mode 100644 index 000000000000..593f3650fdc3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LiveOutputsInner.java @@ -0,0 +1,850 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LiveOutputs. + */ +public class LiveOutputsInner { + /** The Retrofit service to perform REST calls. */ + private LiveOutputsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of LiveOutputsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LiveOutputsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(LiveOutputsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LiveOutputs to be + * used by Retrofit to perform actually REST calls. + */ + interface LiveOutputsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Body LiveOutputInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Body LiveOutputInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("liveEventName") String liveEventName, @Path("liveOutputName") String liveOutputName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveOutputInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String liveEventName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, liveEventName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String liveEventName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, liveEventName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + return listWithServiceResponseAsync(resourceGroupName, accountName, liveEventName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + return listSinglePageAsync(resourceGroupName, accountName, liveEventName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param liveEventName The name of the Live Event. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveOutputInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String liveEventName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveOutputInner object if successful. + */ + public LiveOutputInner get(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().single().body(); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, LiveOutputInner>() { + @Override + public LiveOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Live Output. + * Gets a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveOutputInner object if successful. + */ + public LiveOutputInner create(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).toBlocking().last().body(); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters), serviceCallback); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).map(new Func1, LiveOutputInner>() { + @Override + public LiveOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LiveOutputInner object if successful. + */ + public LiveOutputInner beginCreate(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).toBlocking().single().body(); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters), serviceCallback); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).map(new Func1, LiveOutputInner>() { + @Override + public LiveOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create Live Output. + * Creates a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param parameters Live Output properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LiveOutputInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().last().body(); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().single().body(); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName), serviceCallback); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Live Output. + * Deletes a Live Output. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param liveEventName The name of the Live Event. + * @param liveOutputName The name of the Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (liveEventName == null) { + throw new IllegalArgumentException("Parameter liveEventName is required and cannot be null."); + } + if (liveOutputName == null) { + throw new IllegalArgumentException("Parameter liveOutputName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, liveEventName, liveOutputName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<LiveOutputInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<LiveOutputInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Live Outputs. + * Lists the Live Outputs in the Live Event. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<LiveOutputInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationInner.java new file mode 100644 index 000000000000..533ad53de454 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LocationInner model. + */ +public class LocationInner { + /** + * The name property. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the LocationInner object itself. + */ + public LocationInner withName(String name) { + this.name = name; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsImpl.java new file mode 100644 index 000000000000..a68d7fea0cbc --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.mediaservices.v2018_07_01.EntityNameAvailabilityCheckOutput; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CheckNameAvailabilityInput; + +class LocationsImpl extends WrapperImpl implements Locations { + private final MediaManager manager; + + LocationsImpl(MediaManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters) { + LocationsInner client = this.inner(); + return client.checkNameAvailabilityAsync(locationName, parameters) + .map(new Func1() { + @Override + public EntityNameAvailabilityCheckOutput call(EntityNameAvailabilityCheckOutputInner inner) { + return new EntityNameAvailabilityCheckOutputImpl(inner, manager()); + } + }); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsInner.java new file mode 100644 index 000000000000..6feebdcd6dc5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/LocationsInner.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CheckNameAvailabilityInput; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Locations checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("locationName") String locationName, @Body CheckNameAvailabilityInput parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EntityNameAvailabilityCheckOutputInner object if successful. + */ + public EntityNameAvailabilityCheckOutputInner checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).toBlocking().single().body(); + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(locationName, parameters), serviceCallback); + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EntityNameAvailabilityCheckOutputInner object + */ + public Observable checkNameAvailabilityAsync(String locationName, CheckNameAvailabilityInput parameters) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).map(new Func1, EntityNameAvailabilityCheckOutputInner>() { + @Override + public EntityNameAvailabilityCheckOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check Name Availability. + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EntityNameAvailabilityCheckOutputInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String locationName, CheckNameAvailabilityInput parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.checkNameAvailability(this.client.subscriptionId(), locationName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaManager.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaManager.java new file mode 100644 index 000000000000..eca5000d601d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaManager.java @@ -0,0 +1,255 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AccountFilters; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Operations; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Locations; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Assets; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFilters; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ContentKeyPolicies; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Jobs; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveEvents; +import com.microsoft.azure.management.mediaservices.v2018_07_01.LiveOutputs; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Media resource management. + */ +public final class MediaManager extends ManagerCore { + private AccountFilters accountFilters; + private Operations operations; + private Mediaservices mediaservices; + private Locations locations; + private Assets assets; + private AssetFilters assetFilters; + private ContentKeyPolicies contentKeyPolicies; + private Transforms transforms; + private Jobs jobs; + private StreamingPolicies streamingPolicies; + private StreamingLocators streamingLocators; + private LiveEvents liveEvents; + private LiveOutputs liveOutputs; + private StreamingEndpoints streamingEndpoints; + /** + * Get a Configurable instance that can be used to create MediaManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new MediaManager.ConfigurableImpl(); + } + /** + * Creates an instance of MediaManager that exposes Media resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the MediaManager + */ + public static MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new MediaManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of MediaManager that exposes Media resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the MediaManager + */ + public static MediaManager authenticate(RestClient restClient, String subscriptionId) { + return new MediaManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of MediaManager that exposes Media management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Media management API entry points that work across subscriptions + */ + MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage AccountFilters. + */ + public AccountFilters accountFilters() { + if (this.accountFilters == null) { + this.accountFilters = new AccountFiltersImpl(this); + } + return this.accountFilters; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Mediaservices. + */ + public Mediaservices mediaservices() { + if (this.mediaservices == null) { + this.mediaservices = new MediaservicesImpl(this); + } + return this.mediaservices; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Assets. + */ + public Assets assets() { + if (this.assets == null) { + this.assets = new AssetsImpl(this); + } + return this.assets; + } + + /** + * @return Entry point to manage AssetFilters. + */ + public AssetFilters assetFilters() { + if (this.assetFilters == null) { + this.assetFilters = new AssetFiltersImpl(this); + } + return this.assetFilters; + } + + /** + * @return Entry point to manage ContentKeyPolicies. + */ + public ContentKeyPolicies contentKeyPolicies() { + if (this.contentKeyPolicies == null) { + this.contentKeyPolicies = new ContentKeyPoliciesImpl(this); + } + return this.contentKeyPolicies; + } + + /** + * @return Entry point to manage Transforms. + */ + public Transforms transforms() { + if (this.transforms == null) { + this.transforms = new TransformsImpl(this); + } + return this.transforms; + } + + /** + * @return Entry point to manage Jobs. + */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(this); + } + return this.jobs; + } + + /** + * @return Entry point to manage StreamingPolicies. + */ + public StreamingPolicies streamingPolicies() { + if (this.streamingPolicies == null) { + this.streamingPolicies = new StreamingPoliciesImpl(this); + } + return this.streamingPolicies; + } + + /** + * @return Entry point to manage StreamingLocators. + */ + public StreamingLocators streamingLocators() { + if (this.streamingLocators == null) { + this.streamingLocators = new StreamingLocatorsImpl(this); + } + return this.streamingLocators; + } + + /** + * @return Entry point to manage LiveEvents. + */ + public LiveEvents liveEvents() { + if (this.liveEvents == null) { + this.liveEvents = new LiveEventsImpl(this); + } + return this.liveEvents; + } + + /** + * @return Entry point to manage LiveOutputs. + */ + public LiveOutputs liveOutputs() { + if (this.liveOutputs == null) { + this.liveOutputs = new LiveOutputsImpl(this); + } + return this.liveOutputs; + } + + /** + * @return Entry point to manage StreamingEndpoints. + */ + public StreamingEndpoints streamingEndpoints() { + if (this.streamingEndpoints == null) { + this.streamingEndpoints = new StreamingEndpointsImpl(this); + } + return this.streamingEndpoints; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public MediaManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return MediaManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private MediaManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AzureMediaServicesImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceImpl.java new file mode 100644 index 000000000000..c45296152104 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.MediaService; +import rx.Observable; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageAccount; + +class MediaServiceImpl extends GroupableResourceCoreImpl implements MediaService, MediaService.Definition, MediaService.Update { + MediaServiceImpl(String name, MediaServiceInner inner, MediaManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + MediaservicesInner client = this.manager().inner().mediaservices(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MediaservicesInner client = this.manager().inner().mediaservices(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MediaservicesInner client = this.manager().inner().mediaservices(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public UUID mediaServiceId() { + return this.inner().mediaServiceId(); + } + + @Override + public List storageAccounts() { + return this.inner().storageAccounts(); + } + + @Override + public MediaServiceImpl withStorageAccounts(List storageAccounts) { + this.inner().withStorageAccounts(storageAccounts); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceInner.java new file mode 100644 index 000000000000..fbd9182349a1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaServiceInner.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageAccount; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A Media Services account. + */ +@JsonFlatten +@SkipParentValidation +public class MediaServiceInner extends Resource { + /** + * The Media Services account ID. + */ + @JsonProperty(value = "properties.mediaServiceId", access = JsonProperty.Access.WRITE_ONLY) + private UUID mediaServiceId; + + /** + * The storage accounts for this resource. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /** + * Get the Media Services account ID. + * + * @return the mediaServiceId value + */ + public UUID mediaServiceId() { + return this.mediaServiceId; + } + + /** + * Get the storage accounts for this resource. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storage accounts for this resource. + * + * @param storageAccounts the storageAccounts value to set + * @return the MediaServiceInner object itself. + */ + public MediaServiceInner withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesImpl.java new file mode 100644 index 000000000000..d29d72ff5b91 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesImpl.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices; +import com.microsoft.azure.management.mediaservices.v2018_07_01.MediaService; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.SubscriptionMediaService; +import com.microsoft.azure.arm.utils.PagedListConverter; + +class MediaservicesImpl extends GroupableResourcesCoreImpl implements Mediaservices { + protected MediaservicesImpl(MediaManager manager) { + super(manager.inner().mediaservices(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + MediaservicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + MediaservicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + MediaservicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + MediaservicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MediaService call(MediaServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + MediaservicesInner client = this.inner(); + PagedListConverter converter = + new PagedListConverter() { + @Override + public Observable typeConvertAsync(SubscriptionMediaServiceInner inner) { + return Observable.just(inner) + .flatMap(new Func1>() { + @Override + public Observable call(SubscriptionMediaServiceInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public MediaService call(MediaServiceInner inner) { + return wrapModel(inner); + } + }); + } + }; + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + MediaservicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .flatMap(new Func1>() { + @Override + public Observable call(SubscriptionMediaServiceInner inner) { + return getInnerAsync(ResourceUtilsCore.groupFromResourceId(inner.id()), ResourceUtilsCore.nameFromResourceId(inner.id())); + } + }) + .map(new Func1() { + @Override + public MediaService call(MediaServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public MediaServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable syncStorageKeysAsync(String resourceGroupName, String accountName) { + MediaservicesInner client = this.inner(); + return client.syncStorageKeysAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Observable getBySubscriptionAsync(String accountName) { + MediaservicesInner client = this.inner(); + return client.getBySubscriptionAsync(accountName) + .map(new Func1() { + @Override + public SubscriptionMediaService call(SubscriptionMediaServiceInner inner) { + return new SubscriptionMediaServiceImpl(inner, manager()); + } + }); + } + + @Override + protected MediaServiceImpl wrapModel(MediaServiceInner inner) { + return new MediaServiceImpl(inner.name(), inner, manager()); + } + + @Override + protected MediaServiceImpl wrapModel(String name) { + return new MediaServiceImpl(name, new MediaServiceInner(), this.manager()); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesInner.java new file mode 100644 index 000000000000..2e901ff7d331 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/MediaservicesInner.java @@ -0,0 +1,1214 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.SyncStorageKeysInput; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Mediaservices. + */ +public class MediaservicesInner implements InnerSupportsGet, InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private MediaservicesService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of MediaservicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MediaservicesInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(MediaservicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Mediaservices to be + * used by Retrofit to perform actually REST calls. + */ + interface MediaservicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body MediaServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Body MediaServiceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices syncStorageKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/syncStorageKeys") + Observable> syncStorageKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SyncStorageKeysInput parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices getBySubscription" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices/{accountName}") + Observable> getBySubscription(@Path("subscriptionId") String subscriptionId, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Mediaservices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MediaServiceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MediaServiceInner object if successful. + */ + public MediaServiceInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, MediaServiceInner>() { + @Override + public MediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MediaServiceInner object if successful. + */ + public MediaServiceInner createOrUpdate(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, MediaServiceInner>() { + @Override + public MediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Media Services account. + * Creates or updates a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Media Services account. + * Deletes a Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MediaServiceInner object if successful. + */ + public MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, MediaServiceInner>() { + @Override + public MediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Media Services account. + * Updates an existing Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MediaServiceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void syncStorageKeys(String resourceGroupName, String accountName) { + syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture syncStorageKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable syncStorageKeysAsync(String resourceGroupName, String accountName) { + return syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> syncStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String id = null; + SyncStorageKeysInput parameters = new SyncStorageKeysInput(); + parameters.withId(null); + return service.syncStorageKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = syncStorageKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void syncStorageKeys(String resourceGroupName, String accountName, String id) { + syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id).toBlocking().single().body(); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture syncStorageKeysAsync(String resourceGroupName, String accountName, String id, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id), serviceCallback); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable syncStorageKeysAsync(String resourceGroupName, String accountName, String id) { + return syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName, id).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Synchronizes Storage Account Keys. + * Synchronizes storage account keys for a storage account associated with the Media Service account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param id The ID of the storage account resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> syncStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName, String id) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + SyncStorageKeysInput parameters = new SyncStorageKeysInput(); + parameters.withId(id); + return service.syncStorageKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = syncStorageKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse syncStorageKeysDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubscriptionMediaServiceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubscriptionMediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubscriptionMediaServiceInner object if successful. + */ + public SubscriptionMediaServiceInner getBySubscription(String accountName) { + return getBySubscriptionWithServiceResponseAsync(accountName).toBlocking().single().body(); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBySubscriptionAsync(String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBySubscriptionWithServiceResponseAsync(accountName), serviceCallback); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubscriptionMediaServiceInner object + */ + public Observable getBySubscriptionAsync(String accountName) { + return getBySubscriptionWithServiceResponseAsync(accountName).map(new Func1, SubscriptionMediaServiceInner>() { + @Override + public SubscriptionMediaServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Media Services account. + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubscriptionMediaServiceInner object + */ + public Observable> getBySubscriptionWithServiceResponseAsync(String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getBySubscription(this.client.subscriptionId(), accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBySubscriptionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBySubscriptionDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MediaServiceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MediaServiceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SubscriptionMediaServiceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SubscriptionMediaServiceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Media Services accounts. + * List Media Services accounts in the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SubscriptionMediaServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..95c17f1faace --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.OperationDisplay; +import com.microsoft.azure.management.mediaservices.v2018_07_01.MetricProperties; + +class OperationImpl extends WrapperImpl implements Operation { + private final MediaManager manager; + OperationImpl(OperationInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public MetricProperties properties() { + return this.inner().properties(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationInner.java new file mode 100644 index 000000000000..7bd5cf2969ac --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.OperationDisplay; +import com.microsoft.azure.management.mediaservices.v2018_07_01.MetricProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation. + */ +public class OperationInner { + /** + * The operation name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The operation display name. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Operation properties format. + */ + @JsonProperty(value = "properties") + private MetricProperties properties; + + /** + * Get the operation name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the operation display name. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the operation display name. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get operation properties format. + * + * @return the properties value + */ + public MetricProperties properties() { + return this.properties; + } + + /** + * Set operation properties format. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(MetricProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..679cc277fc08 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final MediaManager manager; + + OperationsImpl(MediaManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..ee0a52aef635 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/OperationsInner.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Operations list" }) + @GET("providers/Microsoft.Media/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Operations. + * Lists all the Media Services operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/PageImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/PageImpl.java new file mode 100644 index 000000000000..d28491d163c1 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("@odata.nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataImpl.java new file mode 100644 index 000000000000..70a473e67e19 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageEncryptedAssetDecryptionData; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFileEncryptionMetadata; + +class StorageEncryptedAssetDecryptionDataImpl extends WrapperImpl implements StorageEncryptedAssetDecryptionData { + private final MediaManager manager; + StorageEncryptedAssetDecryptionDataImpl(StorageEncryptedAssetDecryptionDataInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public List assetFileEncryptionMetadata() { + return this.inner().assetFileEncryptionMetadata(); + } + + @Override + public byte[] keyVal() { + return this.inner().key(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataInner.java new file mode 100644 index 000000000000..ff30b02014b4 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StorageEncryptedAssetDecryptionDataInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.AssetFileEncryptionMetadata; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data needed to decrypt asset files encrypted with legacy storage encryption. + */ +public class StorageEncryptedAssetDecryptionDataInner { + /** + * The Asset File storage encryption key. + */ + @JsonProperty(value = "key") + private byte[] key; + + /** + * Asset File encryption metadata. + */ + @JsonProperty(value = "assetFileEncryptionMetadata") + private List assetFileEncryptionMetadata; + + /** + * Get the Asset File storage encryption key. + * + * @return the key value + */ + public byte[] key() { + return this.key; + } + + /** + * Set the Asset File storage encryption key. + * + * @param key the key value to set + * @return the StorageEncryptedAssetDecryptionDataInner object itself. + */ + public StorageEncryptedAssetDecryptionDataInner withKey(byte[] key) { + this.key = key; + return this; + } + + /** + * Get asset File encryption metadata. + * + * @return the assetFileEncryptionMetadata value + */ + public List assetFileEncryptionMetadata() { + return this.assetFileEncryptionMetadata; + } + + /** + * Set asset File encryption metadata. + * + * @param assetFileEncryptionMetadata the assetFileEncryptionMetadata value to set + * @return the StorageEncryptedAssetDecryptionDataInner object itself. + */ + public StorageEncryptedAssetDecryptionDataInner withAssetFileEncryptionMetadata(List assetFileEncryptionMetadata) { + this.assetFileEncryptionMetadata = assetFileEncryptionMetadata; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointImpl.java new file mode 100644 index 000000000000..0827213e66aa --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointImpl.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoint; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpointAccessControl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpointResourceState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CrossSiteAccessPolicies; +import org.joda.time.DateTime; + +class StreamingEndpointImpl extends CreatableUpdatableImpl implements StreamingEndpoint, StreamingEndpoint.Definition, StreamingEndpoint.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String streamingEndpointName; + + StreamingEndpointImpl(String name, MediaManager manager) { + super(name, new StreamingEndpointInner()); + this.manager = manager; + // Set resource name + this.streamingEndpointName = name; + // + } + + StreamingEndpointImpl(StreamingEndpointInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.streamingEndpointName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaservices"); + this.streamingEndpointName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingEndpoints"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StreamingEndpointsInner client = this.manager().inner().streamingEndpoints(); + return client.getAsync(this.resourceGroupName, this.accountName, this.streamingEndpointName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public StreamingEndpointAccessControl accessControl() { + return this.inner().accessControl(); + } + + @Override + public String availabilitySetName() { + return this.inner().availabilitySetName(); + } + + @Override + public Boolean cdnEnabled() { + return this.inner().cdnEnabled(); + } + + @Override + public String cdnProfile() { + return this.inner().cdnProfile(); + } + + @Override + public String cdnProvider() { + return this.inner().cdnProvider(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.inner().crossSiteAccessPolicies(); + } + + @Override + public List customHostNames() { + return this.inner().customHostNames(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public DateTime freeTrialEndTime() { + return this.inner().freeTrialEndTime(); + } + + @Override + public String hostName() { + return this.inner().hostName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Long maxCacheAge() { + return this.inner().maxCacheAge(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public StreamingEndpointResourceState resourceState() { + return this.inner().resourceState(); + } + + @Override + public int scaleUnits() { + return this.inner().scaleUnits(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StreamingEndpointImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StreamingEndpointImpl withScaleUnits(int scaleUnits) { + this.inner().withScaleUnits(scaleUnits); + return this; + } + + @Override + public StreamingEndpointImpl withAccessControl(StreamingEndpointAccessControl accessControl) { + this.inner().withAccessControl(accessControl); + return this; + } + + @Override + public StreamingEndpointImpl withAvailabilitySetName(String availabilitySetName) { + this.inner().withAvailabilitySetName(availabilitySetName); + return this; + } + + @Override + public StreamingEndpointImpl withCdnEnabled(Boolean cdnEnabled) { + this.inner().withCdnEnabled(cdnEnabled); + return this; + } + + @Override + public StreamingEndpointImpl withCdnProfile(String cdnProfile) { + this.inner().withCdnProfile(cdnProfile); + return this; + } + + @Override + public StreamingEndpointImpl withCdnProvider(String cdnProvider) { + this.inner().withCdnProvider(cdnProvider); + return this; + } + + @Override + public StreamingEndpointImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.inner().withCrossSiteAccessPolicies(crossSiteAccessPolicies); + return this; + } + + @Override + public StreamingEndpointImpl withCustomHostNames(List customHostNames) { + this.inner().withCustomHostNames(customHostNames); + return this; + } + + @Override + public StreamingEndpointImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public StreamingEndpointImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public StreamingEndpointImpl withMaxCacheAge(Long maxCacheAge) { + this.inner().withMaxCacheAge(maxCacheAge); + return this; + } + + @Override + public StreamingEndpointImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointInner.java new file mode 100644 index 000000000000..cc9ff2326e10 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointInner.java @@ -0,0 +1,381 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpointAccessControl; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpointResourceState; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CrossSiteAccessPolicies; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The StreamingEndpoint. + */ +@JsonFlatten +@SkipParentValidation +public class StreamingEndpointInner extends Resource { + /** + * The StreamingEndpoint description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The number of scale units. Use the Scale operation to adjust this + * value. + */ + @JsonProperty(value = "properties.scaleUnits", required = true) + private int scaleUnits; + + /** + * The name of the AvailabilitySet used with this StreamingEndpoint for + * high availability streaming. This value can only be set at creation + * time. + */ + @JsonProperty(value = "properties.availabilitySetName") + private String availabilitySetName; + + /** + * The access control definition of the StreamingEndpoint. + */ + @JsonProperty(value = "properties.accessControl") + private StreamingEndpointAccessControl accessControl; + + /** + * Max cache age. + */ + @JsonProperty(value = "properties.maxCacheAge") + private Long maxCacheAge; + + /** + * The custom host names of the StreamingEndpoint. + */ + @JsonProperty(value = "properties.customHostNames") + private List customHostNames; + + /** + * The StreamingEndpoint host name. + */ + @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostName; + + /** + * The CDN enabled flag. + */ + @JsonProperty(value = "properties.cdnEnabled") + private Boolean cdnEnabled; + + /** + * The CDN provider name. + */ + @JsonProperty(value = "properties.cdnProvider") + private String cdnProvider; + + /** + * The CDN profile name. + */ + @JsonProperty(value = "properties.cdnProfile") + private String cdnProfile; + + /** + * The provisioning state of the StreamingEndpoint. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The resource state of the StreamingEndpoint. Possible values include: + * 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting', 'Scaling'. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private StreamingEndpointResourceState resourceState; + + /** + * The StreamingEndpoint access policies. + */ + @JsonProperty(value = "properties.crossSiteAccessPolicies") + private CrossSiteAccessPolicies crossSiteAccessPolicies; + + /** + * The free trial expiration time. + */ + @JsonProperty(value = "properties.freeTrialEndTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime freeTrialEndTime; + + /** + * The exact time the StreamingEndpoint was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The exact time the StreamingEndpoint was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * Get the StreamingEndpoint description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the StreamingEndpoint description. + * + * @param description the description value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the number of scale units. Use the Scale operation to adjust this value. + * + * @return the scaleUnits value + */ + public int scaleUnits() { + return this.scaleUnits; + } + + /** + * Set the number of scale units. Use the Scale operation to adjust this value. + * + * @param scaleUnits the scaleUnits value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withScaleUnits(int scaleUnits) { + this.scaleUnits = scaleUnits; + return this; + } + + /** + * Get the name of the AvailabilitySet used with this StreamingEndpoint for high availability streaming. This value can only be set at creation time. + * + * @return the availabilitySetName value + */ + public String availabilitySetName() { + return this.availabilitySetName; + } + + /** + * Set the name of the AvailabilitySet used with this StreamingEndpoint for high availability streaming. This value can only be set at creation time. + * + * @param availabilitySetName the availabilitySetName value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withAvailabilitySetName(String availabilitySetName) { + this.availabilitySetName = availabilitySetName; + return this; + } + + /** + * Get the access control definition of the StreamingEndpoint. + * + * @return the accessControl value + */ + public StreamingEndpointAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the access control definition of the StreamingEndpoint. + * + * @param accessControl the accessControl value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withAccessControl(StreamingEndpointAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get max cache age. + * + * @return the maxCacheAge value + */ + public Long maxCacheAge() { + return this.maxCacheAge; + } + + /** + * Set max cache age. + * + * @param maxCacheAge the maxCacheAge value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withMaxCacheAge(Long maxCacheAge) { + this.maxCacheAge = maxCacheAge; + return this; + } + + /** + * Get the custom host names of the StreamingEndpoint. + * + * @return the customHostNames value + */ + public List customHostNames() { + return this.customHostNames; + } + + /** + * Set the custom host names of the StreamingEndpoint. + * + * @param customHostNames the customHostNames value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCustomHostNames(List customHostNames) { + this.customHostNames = customHostNames; + return this; + } + + /** + * Get the StreamingEndpoint host name. + * + * @return the hostName value + */ + public String hostName() { + return this.hostName; + } + + /** + * Get the CDN enabled flag. + * + * @return the cdnEnabled value + */ + public Boolean cdnEnabled() { + return this.cdnEnabled; + } + + /** + * Set the CDN enabled flag. + * + * @param cdnEnabled the cdnEnabled value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCdnEnabled(Boolean cdnEnabled) { + this.cdnEnabled = cdnEnabled; + return this; + } + + /** + * Get the CDN provider name. + * + * @return the cdnProvider value + */ + public String cdnProvider() { + return this.cdnProvider; + } + + /** + * Set the CDN provider name. + * + * @param cdnProvider the cdnProvider value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCdnProvider(String cdnProvider) { + this.cdnProvider = cdnProvider; + return this; + } + + /** + * Get the CDN profile name. + * + * @return the cdnProfile value + */ + public String cdnProfile() { + return this.cdnProfile; + } + + /** + * Set the CDN profile name. + * + * @param cdnProfile the cdnProfile value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCdnProfile(String cdnProfile) { + this.cdnProfile = cdnProfile; + return this; + } + + /** + * Get the provisioning state of the StreamingEndpoint. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource state of the StreamingEndpoint. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping', 'Deleting', 'Scaling'. + * + * @return the resourceState value + */ + public StreamingEndpointResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the StreamingEndpoint access policies. + * + * @return the crossSiteAccessPolicies value + */ + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.crossSiteAccessPolicies; + } + + /** + * Set the StreamingEndpoint access policies. + * + * @param crossSiteAccessPolicies the crossSiteAccessPolicies value to set + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.crossSiteAccessPolicies = crossSiteAccessPolicies; + return this; + } + + /** + * Get the free trial expiration time. + * + * @return the freeTrialEndTime value + */ + public DateTime freeTrialEndTime() { + return this.freeTrialEndTime; + } + + /** + * Get the exact time the StreamingEndpoint was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the exact time the StreamingEndpoint was last modified. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsImpl.java new file mode 100644 index 000000000000..f70f839dee54 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoint; + +class StreamingEndpointsImpl extends WrapperImpl implements StreamingEndpoints { + private final MediaManager manager; + + StreamingEndpointsImpl(MediaManager manager) { + super(manager.inner().streamingEndpoints()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public StreamingEndpointImpl define(String name) { + return wrapModel(name); + } + + private StreamingEndpointImpl wrapModel(StreamingEndpointInner inner) { + return new StreamingEndpointImpl(inner, manager()); + } + + private StreamingEndpointImpl wrapModel(String name) { + return new StreamingEndpointImpl(name, this.manager()); + } + + @Override + public Completable startAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.startAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.stopAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + + @Override + public Completable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.scaleAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + StreamingEndpointsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StreamingEndpoint call(StreamingEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, streamingEndpointName) + .map(new Func1() { + @Override + public StreamingEndpoint call(StreamingEndpointInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, streamingEndpointName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java new file mode 100644 index 000000000000..ff3842a17e42 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java @@ -0,0 +1,1944 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEntityScaleUnit; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StreamingEndpoints. + */ +public class StreamingEndpointsInner { + /** The Retrofit service to perform REST calls. */ + private StreamingEndpointsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingEndpointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StreamingEndpointsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(StreamingEndpointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StreamingEndpoints to be + * used by Retrofit to perform actually REST calls. + */ + interface StreamingEndpointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Query("autoStart") Boolean autoStart, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Body StreamingEndpointInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints scale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/scale") + Observable> scale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StreamingEntityScaleUnit parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints beginScale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/scale") + Observable> beginScale(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingEndpointName") String streamingEndpointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StreamingEntityScaleUnit parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingEndpoints listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingEndpointInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner get(String resourceGroupName, String accountName, String streamingEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get StreamingEndpoint. + * Gets a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner create(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner create(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).toBlocking().last().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final Boolean autoStart = null; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).toBlocking().single().body(); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart), serviceCallback); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create StreamingEndpoint. + * Creates a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), autoStart, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner update(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().last().body(); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingEndpointInner object if successful. + */ + public StreamingEndpointInner beginUpdate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).toBlocking().single().body(); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters), serviceCallback); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1, StreamingEndpointInner>() { + @Override + public StreamingEndpointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update StreamingEndpoint. + * Updates a existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param parameters StreamingEndpoint properties needed for creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingEndpointInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String streamingEndpointName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName, String streamingEndpointName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete StreamingEndpoint. + * Deletes a StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String accountName, String streamingEndpointName) { + startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return startWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String accountName, String streamingEndpointName) { + beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStartWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start StreamingEndpoint. + * Starts an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String accountName, String streamingEndpointName) { + stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stopAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return stopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String accountName, String streamingEndpointName) { + beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStopWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop StreamingEndpoint. + * Stops an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void scale(String resourceGroupName, String accountName, String streamingEndpointName) { + scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().last().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> scaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer scaleUnit = null; + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(null); + Observable> observable = service.scale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void scale(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).toBlocking().last().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable scaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + return scaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> scaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(scaleUnit); + Observable> observable = service.scale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName) { + beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer scaleUnit = null; + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(null); + return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginScaleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).toBlocking().single().body(); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit), serviceCallback); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginScaleAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + return beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, scaleUnit).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scale StreamingEndpoint. + * Scales an existing StreamingEndpoint. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingEndpointName The name of the StreamingEndpoint. + * @param scaleUnit The scale unit number of the StreamingEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingEndpointName, Integer scaleUnit) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingEndpointName == null) { + throw new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + StreamingEntityScaleUnit parameters = new StreamingEntityScaleUnit(); + parameters.withScaleUnit(scaleUnit); + return service.beginScale(this.client.subscriptionId(), resourceGroupName, accountName, streamingEndpointName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginScaleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginScaleDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingEndpointInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingEndpointInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List StreamingEndpoints. + * Lists the StreamingEndpoints in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingEndpointInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorImpl.java new file mode 100644 index 000000000000..ebf755dd55c3 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorImpl.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocator; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocatorContentKey; + +class StreamingLocatorImpl extends CreatableUpdatableImpl implements StreamingLocator, StreamingLocator.Definition, StreamingLocator.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String streamingLocatorName; + + StreamingLocatorImpl(String name, MediaManager manager) { + super(name, new StreamingLocatorInner()); + this.manager = manager; + // Set resource name + this.streamingLocatorName = name; + // + } + + StreamingLocatorImpl(StreamingLocatorInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.streamingLocatorName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.streamingLocatorName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingLocators"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StreamingLocatorsInner client = this.manager().inner().streamingLocators(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StreamingLocatorsInner client = this.manager().inner().streamingLocators(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StreamingLocatorsInner client = this.manager().inner().streamingLocators(); + return client.getAsync(this.resourceGroupName, this.accountName, this.streamingLocatorName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String alternativeMediaId() { + return this.inner().alternativeMediaId(); + } + + @Override + public String assetName() { + return this.inner().assetName(); + } + + @Override + public List contentKeys() { + return this.inner().contentKeys(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String defaultContentKeyPolicyName() { + return this.inner().defaultContentKeyPolicyName(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public UUID streamingLocatorId() { + return this.inner().streamingLocatorId(); + } + + @Override + public String streamingPolicyName() { + return this.inner().streamingPolicyName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StreamingLocatorImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StreamingLocatorImpl withAssetName(String assetName) { + this.inner().withAssetName(assetName); + return this; + } + + @Override + public StreamingLocatorImpl withStreamingPolicyName(String streamingPolicyName) { + this.inner().withStreamingPolicyName(streamingPolicyName); + return this; + } + + @Override + public StreamingLocatorImpl withAlternativeMediaId(String alternativeMediaId) { + this.inner().withAlternativeMediaId(alternativeMediaId); + return this; + } + + @Override + public StreamingLocatorImpl withContentKeys(List contentKeys) { + this.inner().withContentKeys(contentKeys); + return this; + } + + @Override + public StreamingLocatorImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.inner().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); + return this; + } + + @Override + public StreamingLocatorImpl withEndTime(DateTime endTime) { + this.inner().withEndTime(endTime); + return this; + } + + @Override + public StreamingLocatorImpl withStartTime(DateTime startTime) { + this.inner().withStartTime(startTime); + return this; + } + + @Override + public StreamingLocatorImpl withStreamingLocatorId(UUID streamingLocatorId) { + this.inner().withStreamingLocatorId(streamingLocatorId); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorInner.java new file mode 100644 index 000000000000..22f9e03b4d6f --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorInner.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocatorContentKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Streaming Locator resource. + */ +@JsonFlatten +public class StreamingLocatorInner extends ProxyResource { + /** + * Asset Name. + */ + @JsonProperty(value = "properties.assetName", required = true) + private String assetName; + + /** + * The creation time of the Streaming Locator. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * The start time of the Streaming Locator. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The end time of the Streaming Locator. + */ + @JsonProperty(value = "properties.endTime") + private DateTime endTime; + + /** + * The StreamingLocatorId of the Streaming Locator. + */ + @JsonProperty(value = "properties.streamingLocatorId") + private UUID streamingLocatorId; + + /** + * Name of the Streaming Policy used by this Streaming Locator. Either + * specify the name of Streaming Policy you created or use one of the + * predefined Streaming Policies. The predefined Streaming Policies + * available are: 'Predefined_DownloadOnly', + * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', + * 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and + * 'Predefined_MultiDrmStreaming'. + */ + @JsonProperty(value = "properties.streamingPolicyName", required = true) + private String streamingPolicyName; + + /** + * Name of the default ContentKeyPolicy used by this Streaming Locator. + */ + @JsonProperty(value = "properties.defaultContentKeyPolicyName") + private String defaultContentKeyPolicyName; + + /** + * The ContentKeys used by this Streaming Locator. + */ + @JsonProperty(value = "properties.contentKeys") + private List contentKeys; + + /** + * Alternative Media ID of this Streaming Locator. + */ + @JsonProperty(value = "properties.alternativeMediaId") + private String alternativeMediaId; + + /** + * Get asset Name. + * + * @return the assetName value + */ + public String assetName() { + return this.assetName; + } + + /** + * Set asset Name. + * + * @param assetName the assetName value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the creation time of the Streaming Locator. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get the start time of the Streaming Locator. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time of the Streaming Locator. + * + * @param startTime the startTime value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the Streaming Locator. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time of the Streaming Locator. + * + * @param endTime the endTime value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the StreamingLocatorId of the Streaming Locator. + * + * @return the streamingLocatorId value + */ + public UUID streamingLocatorId() { + return this.streamingLocatorId; + } + + /** + * Set the StreamingLocatorId of the Streaming Locator. + * + * @param streamingLocatorId the streamingLocatorId value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStreamingLocatorId(UUID streamingLocatorId) { + this.streamingLocatorId = streamingLocatorId; + return this; + } + + /** + * Get name of the Streaming Policy used by this Streaming Locator. Either specify the name of Streaming Policy you created or use one of the predefined Streaming Policies. The predefined Streaming Policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and 'Predefined_MultiDrmStreaming'. + * + * @return the streamingPolicyName value + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Set name of the Streaming Policy used by this Streaming Locator. Either specify the name of Streaming Policy you created or use one of the predefined Streaming Policies. The predefined Streaming Policies available are: 'Predefined_DownloadOnly', 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', 'Predefined_MultiDrmCencStreaming' and 'Predefined_MultiDrmStreaming'. + * + * @param streamingPolicyName the streamingPolicyName value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStreamingPolicyName(String streamingPolicyName) { + this.streamingPolicyName = streamingPolicyName; + return this; + } + + /** + * Get name of the default ContentKeyPolicy used by this Streaming Locator. + * + * @return the defaultContentKeyPolicyName value + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + + /** + * Set name of the default ContentKeyPolicy used by this Streaming Locator. + * + * @param defaultContentKeyPolicyName the defaultContentKeyPolicyName value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.defaultContentKeyPolicyName = defaultContentKeyPolicyName; + return this; + } + + /** + * Get the ContentKeys used by this Streaming Locator. + * + * @return the contentKeys value + */ + public List contentKeys() { + return this.contentKeys; + } + + /** + * Set the ContentKeys used by this Streaming Locator. + * + * @param contentKeys the contentKeys value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withContentKeys(List contentKeys) { + this.contentKeys = contentKeys; + return this; + } + + /** + * Get alternative Media ID of this Streaming Locator. + * + * @return the alternativeMediaId value + */ + public String alternativeMediaId() { + return this.alternativeMediaId; + } + + /** + * Set alternative Media ID of this Streaming Locator. + * + * @param alternativeMediaId the alternativeMediaId value to set + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withAlternativeMediaId(String alternativeMediaId) { + this.alternativeMediaId = alternativeMediaId; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsImpl.java new file mode 100644 index 000000000000..76911cb5519c --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsImpl.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListContentKeysResponse; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ListPathsResponse; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocator; + +class StreamingLocatorsImpl extends WrapperImpl implements StreamingLocators { + private final MediaManager manager; + + StreamingLocatorsImpl(MediaManager manager) { + super(manager.inner().streamingLocators()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public StreamingLocatorImpl define(String name) { + return wrapModel(name); + } + + private StreamingLocatorImpl wrapModel(StreamingLocatorInner inner) { + return new StreamingLocatorImpl(inner, manager()); + } + + private StreamingLocatorImpl wrapModel(String name) { + return new StreamingLocatorImpl(name, this.manager()); + } + + @Override + public Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.listContentKeysAsync(resourceGroupName, accountName, streamingLocatorName) + .map(new Func1() { + @Override + public ListContentKeysResponse call(ListContentKeysResponseInner inner) { + return new ListContentKeysResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.listPathsAsync(resourceGroupName, accountName, streamingLocatorName) + .map(new Func1() { + @Override + public ListPathsResponse call(ListPathsResponseInner inner) { + return new ListPathsResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + StreamingLocatorsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StreamingLocator call(StreamingLocatorInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, streamingLocatorName) + .map(new Func1() { + @Override + public StreamingLocator call(StreamingLocatorInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, streamingLocatorName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsInner.java new file mode 100644 index 000000000000..ae79dd0df9c5 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsInner.java @@ -0,0 +1,972 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StreamingLocators. + */ +public class StreamingLocatorsInner { + /** The Retrofit service to perform REST calls. */ + private StreamingLocatorsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingLocatorsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StreamingLocatorsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(StreamingLocatorsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StreamingLocators to be + * used by Retrofit to perform actually REST calls. + */ + interface StreamingLocatorsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Body StreamingLocatorInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators listContentKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listContentKeys") + Observable> listContentKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators listPaths" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listPaths") + Observable> listPaths(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingLocatorName") String streamingLocatorName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingLocators listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingLocatorInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingLocatorInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingLocatorInner object if successful. + */ + public StreamingLocatorInner get(String resourceGroupName, String accountName, String streamingLocatorName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, StreamingLocatorInner>() { + @Override + public StreamingLocatorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Streaming Locator. + * Get the details of a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingLocatorInner object if successful. + */ + public StreamingLocatorInner create(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters).toBlocking().single().body(); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters), serviceCallback); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters).map(new Func1, StreamingLocatorInner>() { + @Override + public StreamingLocatorInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a Streaming Locator. + * Create a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingLocatorInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String streamingLocatorName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Streaming Locator. + * Deletes a Streaming Locator in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListContentKeysResponseInner object if successful. + */ + public ListContentKeysResponseInner listContentKeys(String resourceGroupName, String accountName, String streamingLocatorName) { + return listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListContentKeysResponseInner object + */ + public Observable listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, ListContentKeysResponseInner>() { + @Override + public ListContentKeysResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Content Keys. + * List Content Keys used by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListContentKeysResponseInner object + */ + public Observable> listContentKeysWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listContentKeys(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listContentKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listContentKeysDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListPathsResponseInner object if successful. + */ + public ListPathsResponseInner listPaths(String resourceGroupName, String accountName, String streamingLocatorName) { + return listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).toBlocking().single().body(); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName), serviceCallback); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListPathsResponseInner object + */ + public Observable listPathsAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return listPathsWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1, ListPathsResponseInner>() { + @Override + public ListPathsResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List Paths. + * List Paths supported by this Streaming Locator. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingLocatorName The Streaming Locator name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListPathsResponseInner object + */ + public Observable> listPathsWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingLocatorName == null) { + throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listPaths(this.client.subscriptionId(), resourceGroupName, accountName, streamingLocatorName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listPathsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listPathsDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingLocatorInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingLocatorInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Locators. + * Lists the Streaming Locators in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingLocatorInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesImpl.java new file mode 100644 index 000000000000..0323902d915e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicy; + +class StreamingPoliciesImpl extends WrapperImpl implements StreamingPolicies { + private final MediaManager manager; + + StreamingPoliciesImpl(MediaManager manager) { + super(manager.inner().streamingPolicies()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public StreamingPolicyImpl define(String name) { + return wrapModel(name); + } + + private StreamingPolicyImpl wrapModel(StreamingPolicyInner inner) { + return new StreamingPolicyImpl(inner, manager()); + } + + private StreamingPolicyImpl wrapModel(String name) { + return new StreamingPolicyImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + StreamingPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StreamingPolicy call(StreamingPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + StreamingPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, streamingPolicyName) + .map(new Func1() { + @Override + public StreamingPolicy call(StreamingPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + StreamingPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, streamingPolicyName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesInner.java new file mode 100644 index 000000000000..9da275787f7e --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPoliciesInner.java @@ -0,0 +1,769 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StreamingPolicies. + */ +public class StreamingPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private StreamingPoliciesService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StreamingPoliciesInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(StreamingPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for StreamingPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface StreamingPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Body StreamingPolicyInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("streamingPolicyName") String streamingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, orderby) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param orderby Specifies the the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final String orderby) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingPolicyInner object if successful. + */ + public StreamingPolicyInner get(String resourceGroupName, String accountName, String streamingPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).toBlocking().single().body(); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String streamingPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName), serviceCallback); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).map(new Func1, StreamingPolicyInner>() { + @Override + public StreamingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a Streaming Policy. + * Get the details of a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingPolicyName == null) { + throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StreamingPolicyInner object if successful. + */ + public StreamingPolicyInner create(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters).toBlocking().single().body(); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters), serviceCallback); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters).map(new Func1, StreamingPolicyInner>() { + @Override + public StreamingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a Streaming Policy. + * Create a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StreamingPolicyInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingPolicyName == null) { + throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String streamingPolicyName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).toBlocking().single().body(); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName), serviceCallback); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Streaming Policy. + * Deletes a Streaming Policy in the Media Services account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param streamingPolicyName The Streaming Policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (streamingPolicyName == null) { + throw new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, streamingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StreamingPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StreamingPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Streaming Policies. + * Lists the Streaming Policies in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StreamingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyImpl.java new file mode 100644 index 000000000000..63361bade789 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyImpl.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.StreamingPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.EnvelopeEncryption; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CommonEncryptionCenc; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CommonEncryptionCbcs; +import com.microsoft.azure.management.mediaservices.v2018_07_01.NoEncryption; + +class StreamingPolicyImpl extends CreatableUpdatableImpl implements StreamingPolicy, StreamingPolicy.Definition, StreamingPolicy.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String streamingPolicyName; + + StreamingPolicyImpl(String name, MediaManager manager) { + super(name, new StreamingPolicyInner()); + this.manager = manager; + // Set resource name + this.streamingPolicyName = name; + // + } + + StreamingPolicyImpl(StreamingPolicyInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.streamingPolicyName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.streamingPolicyName = IdParsingUtils.getValueFromIdByName(inner.id(), "streamingPolicies"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); + return client.createAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StreamingPoliciesInner client = this.manager().inner().streamingPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.streamingPolicyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public CommonEncryptionCbcs commonEncryptionCbcs() { + return this.inner().commonEncryptionCbcs(); + } + + @Override + public CommonEncryptionCenc commonEncryptionCenc() { + return this.inner().commonEncryptionCenc(); + } + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String defaultContentKeyPolicyName() { + return this.inner().defaultContentKeyPolicyName(); + } + + @Override + public EnvelopeEncryption envelopeEncryption() { + return this.inner().envelopeEncryption(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NoEncryption noEncryption() { + return this.inner().noEncryption(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StreamingPolicyImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StreamingPolicyImpl withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs) { + this.inner().withCommonEncryptionCbcs(commonEncryptionCbcs); + return this; + } + + @Override + public StreamingPolicyImpl withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc) { + this.inner().withCommonEncryptionCenc(commonEncryptionCenc); + return this; + } + + @Override + public StreamingPolicyImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.inner().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); + return this; + } + + @Override + public StreamingPolicyImpl withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption) { + this.inner().withEnvelopeEncryption(envelopeEncryption); + return this; + } + + @Override + public StreamingPolicyImpl withNoEncryption(NoEncryption noEncryption) { + this.inner().withNoEncryption(noEncryption); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyInner.java new file mode 100644 index 000000000000..e79792291677 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingPolicyInner.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.mediaservices.v2018_07_01.EnvelopeEncryption; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CommonEncryptionCenc; +import com.microsoft.azure.management.mediaservices.v2018_07_01.CommonEncryptionCbcs; +import com.microsoft.azure.management.mediaservices.v2018_07_01.NoEncryption; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Streaming Policy resource. + */ +@JsonFlatten +public class StreamingPolicyInner extends ProxyResource { + /** + * Creation time of Streaming Policy. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * Default ContentKey used by current Streaming Policy. + */ + @JsonProperty(value = "properties.defaultContentKeyPolicyName") + private String defaultContentKeyPolicyName; + + /** + * Configuration of EnvelopeEncryption. + */ + @JsonProperty(value = "properties.envelopeEncryption") + private EnvelopeEncryption envelopeEncryption; + + /** + * Configuration of CommonEncryptionCenc. + */ + @JsonProperty(value = "properties.commonEncryptionCenc") + private CommonEncryptionCenc commonEncryptionCenc; + + /** + * Configuration of CommonEncryptionCbcs. + */ + @JsonProperty(value = "properties.commonEncryptionCbcs") + private CommonEncryptionCbcs commonEncryptionCbcs; + + /** + * Configurations of NoEncryption. + */ + @JsonProperty(value = "properties.noEncryption") + private NoEncryption noEncryption; + + /** + * Get creation time of Streaming Policy. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get default ContentKey used by current Streaming Policy. + * + * @return the defaultContentKeyPolicyName value + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + + /** + * Set default ContentKey used by current Streaming Policy. + * + * @param defaultContentKeyPolicyName the defaultContentKeyPolicyName value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.defaultContentKeyPolicyName = defaultContentKeyPolicyName; + return this; + } + + /** + * Get configuration of EnvelopeEncryption. + * + * @return the envelopeEncryption value + */ + public EnvelopeEncryption envelopeEncryption() { + return this.envelopeEncryption; + } + + /** + * Set configuration of EnvelopeEncryption. + * + * @param envelopeEncryption the envelopeEncryption value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption) { + this.envelopeEncryption = envelopeEncryption; + return this; + } + + /** + * Get configuration of CommonEncryptionCenc. + * + * @return the commonEncryptionCenc value + */ + public CommonEncryptionCenc commonEncryptionCenc() { + return this.commonEncryptionCenc; + } + + /** + * Set configuration of CommonEncryptionCenc. + * + * @param commonEncryptionCenc the commonEncryptionCenc value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc) { + this.commonEncryptionCenc = commonEncryptionCenc; + return this; + } + + /** + * Get configuration of CommonEncryptionCbcs. + * + * @return the commonEncryptionCbcs value + */ + public CommonEncryptionCbcs commonEncryptionCbcs() { + return this.commonEncryptionCbcs; + } + + /** + * Set configuration of CommonEncryptionCbcs. + * + * @param commonEncryptionCbcs the commonEncryptionCbcs value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs) { + this.commonEncryptionCbcs = commonEncryptionCbcs; + return this; + } + + /** + * Get configurations of NoEncryption. + * + * @return the noEncryption value + */ + public NoEncryption noEncryption() { + return this.noEncryption; + } + + /** + * Set configurations of NoEncryption. + * + * @param noEncryption the noEncryption value to set + * @return the StreamingPolicyInner object itself. + */ + public StreamingPolicyInner withNoEncryption(NoEncryption noEncryption) { + this.noEncryption = noEncryption; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceImpl.java new file mode 100644 index 000000000000..56506bb1fb56 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.SubscriptionMediaService; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageAccount; +import java.util.Map; + +class SubscriptionMediaServiceImpl extends WrapperImpl implements SubscriptionMediaService { + private final MediaManager manager; + SubscriptionMediaServiceImpl(SubscriptionMediaServiceInner inner, MediaManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public UUID mediaServiceId() { + return this.inner().mediaServiceId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List storageAccounts() { + return this.inner().storageAccounts(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceInner.java new file mode 100644 index 000000000000..47570dc540df --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/SubscriptionMediaServiceInner.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import java.util.UUID; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.StorageAccount; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A Media Services account. + */ +@JsonFlatten +@SkipParentValidation +public class SubscriptionMediaServiceInner extends Resource { + /** + * The Media Services account ID. + */ + @JsonProperty(value = "properties.mediaServiceId", access = JsonProperty.Access.WRITE_ONLY) + private UUID mediaServiceId; + + /** + * The storage accounts for this resource. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /** + * Get the Media Services account ID. + * + * @return the mediaServiceId value + */ + public UUID mediaServiceId() { + return this.mediaServiceId; + } + + /** + * Get the storage accounts for this resource. + * + * @return the storageAccounts value + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storage accounts for this resource. + * + * @param storageAccounts the storageAccounts value to set + * @return the SubscriptionMediaServiceInner object itself. + */ + public SubscriptionMediaServiceInner withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformImpl.java new file mode 100644 index 000000000000..a9dc63c51c57 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.management.mediaservices.v2018_07_01.Transform; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.TransformOutput; + +class TransformImpl extends CreatableUpdatableImpl implements Transform, Transform.Definition, Transform.Update { + private final MediaManager manager; + private String resourceGroupName; + private String accountName; + private String transformName; + + TransformImpl(String name, MediaManager manager) { + super(name, new TransformInner()); + this.manager = manager; + // Set resource name + this.transformName = name; + // + } + + TransformImpl(TransformInner inner, MediaManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.transformName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "mediaServices"); + this.transformName = IdParsingUtils.getValueFromIdByName(inner.id(), "transforms"); + // + } + + @Override + public MediaManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TransformsInner client = this.manager().inner().transforms(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.transformName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TransformsInner client = this.manager().inner().transforms(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.transformName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TransformsInner client = this.manager().inner().transforms(); + return client.getAsync(this.resourceGroupName, this.accountName, this.transformName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outputs() { + return this.inner().outputs(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TransformImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public TransformImpl withOutputs(List outputs) { + this.inner().withOutputs(outputs); + return this; + } + + @Override + public TransformImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformInner.java new file mode 100644 index 000000000000..23bdb61786df --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformInner.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.mediaservices.v2018_07_01.TransformOutput; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A Transform encapsulates the rules or instructions for generating desired + * outputs from input media, such as by transcoding or by extracting insights. + * After the Transform is created, it can be applied to input media by creating + * Jobs. + */ +@JsonFlatten +public class TransformInner extends ProxyResource { + /** + * The UTC date and time when the Transform was created, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private DateTime created; + + /** + * An optional verbose description of the Transform. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The UTC date and time when the Transform was last updated, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * An array of one or more TransformOutputs that the Transform should + * generate. + */ + @JsonProperty(value = "properties.outputs", required = true) + private List outputs; + + /** + * Get the UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Get an optional verbose description of the Transform. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set an optional verbose description of the Transform. + * + * @param description the description value to set + * @return the TransformInner object itself. + */ + public TransformInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the UTC date and time when the Transform was last updated, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get an array of one or more TransformOutputs that the Transform should generate. + * + * @return the outputs value + */ + public List outputs() { + return this.outputs; + } + + /** + * Set an array of one or more TransformOutputs that the Transform should generate. + * + * @param outputs the outputs value to set + * @return the TransformInner object itself. + */ + public TransformInner withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsImpl.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsImpl.java new file mode 100644 index 000000000000..f00f0ef5839d --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.mediaservices.v2018_07_01.Transform; + +class TransformsImpl extends WrapperImpl implements Transforms { + private final MediaManager manager; + + TransformsImpl(MediaManager manager) { + super(manager.inner().transforms()); + this.manager = manager; + } + + public MediaManager manager() { + return this.manager; + } + + @Override + public TransformImpl define(String name) { + return wrapModel(name); + } + + private TransformImpl wrapModel(TransformInner inner) { + return new TransformImpl(inner, manager()); + } + + private TransformImpl wrapModel(String name) { + return new TransformImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + TransformsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Transform call(TransformInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String transformName) { + TransformsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, transformName) + .map(new Func1() { + @Override + public Transform call(TransformInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String transformName) { + TransformsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, transformName).toCompletable(); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsInner.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsInner.java new file mode 100644 index 000000000000..bffea185ab9b --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/TransformsInner.java @@ -0,0 +1,880 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.mediaservices.v2018_07_01.ApiErrorException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Transforms. + */ +public class TransformsInner { + /** The Retrofit service to perform REST calls. */ + private TransformsService service; + /** The service client containing this operation class. */ + private AzureMediaServicesImpl client; + + /** + * Initializes an instance of TransformsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TransformsInner(Retrofit retrofit, AzureMediaServicesImpl client) { + this.service = retrofit.create(TransformsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Transforms to be + * used by Retrofit to perform actually REST calls. + */ + interface TransformsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skip") Integer skip, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Body TransformInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("transformName") String transformName, @Body TransformInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.mediaservices.v2018_07_01.Transforms listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransformInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final Integer top = null; + final Integer skip = null; + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransformInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, filter, top, skip).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, filter, top, skip), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + return listWithServiceResponseAsync(resourceGroupName, accountName, filter, top, skip) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param filter Restricts the set of items returned. + * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + return listSinglePageAsync(resourceGroupName, accountName, filter, top, skip) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the Azure subscription. + ServiceResponse> * @param accountName The Media Services account name. + ServiceResponse> * @param filter Restricts the set of items returned. + ServiceResponse> * @param top Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. + ServiceResponse> * @param skip Specifies a non-negative integer n that excludes the first n items of the queried collection from the result. The service returns items starting at position n+1. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, top, skip, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransformInner object if successful. + */ + public TransformInner get(String resourceGroupName, String accountName, String transformName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName).toBlocking().single().body(); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String transformName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, transformName), serviceCallback); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String transformName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, transformName).map(new Func1, TransformInner>() { + @Override + public TransformInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Transform. + * Gets a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransformInner object if successful. + */ + public TransformInner createOrUpdate(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).toBlocking().single().body(); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters), serviceCallback); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).map(new Func1, TransformInner>() { + @Override + public TransformInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update Transform. + * Creates or updates a new Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, transformName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String transformName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName).toBlocking().single().body(); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String transformName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName), serviceCallback); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String transformName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, transformName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete Transform. + * Deletes a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, accountName, transformName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TransformInner object if successful. + */ + public TransformInner update(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).toBlocking().single().body(); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters), serviceCallback); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).map(new Func1, TransformInner>() { + @Override + public TransformInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update Transform. + * Updates a Transform. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @param parameters The request parameters + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TransformInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (transformName == null) { + throw new IllegalArgumentException("Parameter transformName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, accountName, transformName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ApiErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TransformInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TransformInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Transforms. + * Lists the Transforms in the account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TransformInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ApiErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ApiErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ApiErrorException.class) + .build(response); + } + +} diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/package-info.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/package-info.java new file mode 100644 index 000000000000..29909a260e48 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for AzureMediaServices. + */ +package com.microsoft.azure.management.mediaservices.v2018_07_01.implementation; diff --git a/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/package-info.java b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/package-info.java new file mode 100644 index 000000000000..76f78f086c37 --- /dev/null +++ b/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for AzureMediaServices. + */ +package com.microsoft.azure.management.mediaservices.v2018_07_01;