diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 62906a566fee..464bc9b7cf1a 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -110,6 +110,7 @@ org.springframework.kafka:spring-kafka;2.5.7.RELEASE org.springframework.security:spring-security-config;5.3.5.RELEASE org.springframework.security:spring-security-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-client;5.3.5.RELEASE +org.springframework.security:spring-security-oauth2-resource-server;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-jose;5.3.5.RELEASE org.springframework.security:spring-security-web;5.3.5.RELEASE diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index fa2e6238ee36..6bd902945d24 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -40,17 +40,22 @@ com.azure:azure-ai-anomalydetector;3.0.0-beta.1;3.0.0-beta.2 com.azure:azure-ai-formrecognizer;3.0.3;3.1.0-beta.2 com.azure:azure-ai-metricsadvisor;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-ai-textanalytics;5.0.1;5.1.0-beta.4 +com.azure:azure-analytics-synapse-accesscontrol;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-spark;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-chat;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-common;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-administration;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-sms;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-core;1.10.0;1.11.0 -com.azure:azure-core-amqp;1.6.0;1.7.0-beta.3 +com.azure:azure-core;1.11.0;1.12.0-beta.1 +com.azure:azure-core-amqp;2.0.0;2.1.0-beta.1 com.azure:azure-core-amqp-experimental;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.8;1.0.0-beta.9 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-http-netty;1.6.3;1.7.0 -com.azure:azure-core-http-okhttp;1.3.3;1.4.0 +com.azure:azure-core-http-netty;1.7.0;1.8.0-beta.1 +com.azure:azure-core-http-okhttp;1.4.0;1.5.0-beta.1 com.azure:azure-core-management;1.0.0;1.1.0-beta.1 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 @@ -68,12 +73,12 @@ com.azure:azure-data-schemaregistry-avro;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-data-tables;12.0.0-beta.3;12.0.0-beta.4 com.azure:azure-digitaltwins-core;1.0.1;1.1.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-identity;1.2.0;1.3.0-beta.1 +com.azure:azure-identity;1.2.0;1.2.1 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventgrid;2.0.0-beta.3;2.0.0-beta.4 com.azure:azure-messaging-eventhubs;5.3.1;5.4.0-beta.2 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.3.1;1.4.0-beta.2 -com.azure:azure-messaging-servicebus;7.0.0-beta.7;7.0.0-beta.8 +com.azure:azure-messaging-servicebus;7.0.0;7.1.0-beta.1 com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-search-documents;11.1.2;11.2.0-beta.4 @@ -94,7 +99,7 @@ com.azure:azure-storage-blob-nio;12.0.0-beta.2;12.0.0-beta.3 com.azure:azure-storage-common;12.9.0;12.10.0-beta.1 com.azure:azure-storage-file-share;12.7.0;12.8.0-beta.1 com.azure:azure-storage-file-datalake;12.3.0;12.4.0-beta.1 -com.azure:azure-storage-internal-avro;12.0.1;12.1.0-beta.1 +com.azure:azure-storage-internal-avro;12.0.1;12.0.2-beta.1 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-storage-queue;12.7.0;12.8.0-beta.1 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 @@ -168,6 +173,7 @@ com.azure.resourcemanager:azure-resourcemanager-sql;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-storage;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-trafficmanager;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-test;2.0.0-beta.1;2.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-mediaservices;1.0.0-beta.1;1.0.0-beta.1 com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-beta.2 @@ -176,9 +182,7 @@ com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-b # Format; # unreleased_:;dependency-version # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. -unreleased_com.azure:azure-core;1.11.0 -unreleased_com.azure:azure-core-amqp;1.7.0-beta.3 -unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 +unreleased_com.azure:azure-messaging-servicebus;7.0.0 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid @@ -188,4 +192,3 @@ unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 # beta_:;dependency-version # note: Released beta versions will not be manipulated with the automatic PR creation code. beta_com.azure:azure-security-keyvault-keys;4.3.0-beta.1 -beta_com.azure:azure-core-amqp;1.7.0-beta.2 diff --git a/pom.xml b/pom.xml index d97614e5dba3..85f448c1740a 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,7 @@ sdk/search sdk/servicebus sdk/storage + sdk/synapse sdk/tables sdk/template sdk/textanalytics diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/CHANGELOG.md b/sdk/mediaservices/azure-resourcemanager-mediaservices/CHANGELOG.md new file mode 100644 index 000000000000..32655cd96ec7 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2020-12-09) + +- Azure Resource Manager Mediaservices client library for Java. This package contains Microsoft Azure SDK for Mediaservices Management SDK. This Swagger was generated by the API Framework. Package tag package-2020-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). \ No newline at end of file diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/README.md b/sdk/mediaservices/azure-resourcemanager-mediaservices/README.md new file mode 100644 index 000000000000..7a7df1ab1acc --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/README.md @@ -0,0 +1,84 @@ +# Azure Resource Manager Mediaservices client library for Java + +Azure Resource Manager Mediaservices client library for Java. + +This package contains Microsoft Azure SDK for Mediaservices Management SDK. This Swagger was generated by the API Framework. Package tag package-2020-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +```xml + + com.azure.resourcemanager + azure-resourcemanager-mediaservices + 1.0.0-beta.1 + +``` + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-mediaservices;current}) +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +MediaservicesManager manager = MediaservicesManager + .authenticate(credential, profile); +``` +[//]: # ({x-version-update-end}) + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +## Troubleshooting + +## Next steps + +## Contributing + +If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft +Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml b/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml new file mode 100644 index 000000000000..7f0df8c5056f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-mediaservices + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Mediaservices Management + This package contains Microsoft Azure SDK for Mediaservices Management SDK. This Swagger was generated by the API Framework. Package tag package-2020-05. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core-management + 1.0.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/MediaservicesManager.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/MediaservicesManager.java new file mode 100644 index 000000000000..ba915239ce37 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/MediaservicesManager.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.AzureMediaServices; +import com.azure.resourcemanager.mediaservices.implementation.AccountFiltersImpl; +import com.azure.resourcemanager.mediaservices.implementation.AssetFiltersImpl; +import com.azure.resourcemanager.mediaservices.implementation.AssetsImpl; +import com.azure.resourcemanager.mediaservices.implementation.AzureMediaServicesBuilder; +import com.azure.resourcemanager.mediaservices.implementation.ContentKeyPoliciesImpl; +import com.azure.resourcemanager.mediaservices.implementation.JobsImpl; +import com.azure.resourcemanager.mediaservices.implementation.LiveEventsImpl; +import com.azure.resourcemanager.mediaservices.implementation.LiveOutputsImpl; +import com.azure.resourcemanager.mediaservices.implementation.LocationsImpl; +import com.azure.resourcemanager.mediaservices.implementation.MediaservicesImpl; +import com.azure.resourcemanager.mediaservices.implementation.OperationsImpl; +import com.azure.resourcemanager.mediaservices.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.mediaservices.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.mediaservices.implementation.StreamingEndpointsImpl; +import com.azure.resourcemanager.mediaservices.implementation.StreamingLocatorsImpl; +import com.azure.resourcemanager.mediaservices.implementation.StreamingPoliciesImpl; +import com.azure.resourcemanager.mediaservices.implementation.TransformsImpl; +import com.azure.resourcemanager.mediaservices.models.AccountFilters; +import com.azure.resourcemanager.mediaservices.models.AssetFilters; +import com.azure.resourcemanager.mediaservices.models.Assets; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicies; +import com.azure.resourcemanager.mediaservices.models.Jobs; +import com.azure.resourcemanager.mediaservices.models.LiveEvents; +import com.azure.resourcemanager.mediaservices.models.LiveOutputs; +import com.azure.resourcemanager.mediaservices.models.Locations; +import com.azure.resourcemanager.mediaservices.models.Mediaservices; +import com.azure.resourcemanager.mediaservices.models.Operations; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnections; +import com.azure.resourcemanager.mediaservices.models.PrivateLinkResources; +import com.azure.resourcemanager.mediaservices.models.StreamingEndpoints; +import com.azure.resourcemanager.mediaservices.models.StreamingLocators; +import com.azure.resourcemanager.mediaservices.models.StreamingPolicies; +import com.azure.resourcemanager.mediaservices.models.Transforms; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to MediaservicesManager. This Swagger was generated by the API Framework. */ +public final class MediaservicesManager { + private AccountFilters accountFilters; + + private Operations operations; + + private Mediaservices mediaservices; + + private PrivateLinkResources privateLinkResources; + + private PrivateEndpointConnections privateEndpointConnections; + + 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; + + private final AzureMediaServices clientObject; + + private MediaservicesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AzureMediaServicesBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Mediaservices service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Mediaservices service API instance. + */ + public static MediaservicesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create MediaservicesManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new MediaservicesManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Mediaservices service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Mediaservices service API instance. + */ + public MediaservicesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies + .add( + new UserAgentPolicy( + null, + "com.azure.resourcemanager.mediaservices", + "1.0.0-beta.1", + Configuration.getGlobalConfiguration())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new MediaservicesManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of AccountFilters. */ + public AccountFilters accountFilters() { + if (this.accountFilters == null) { + this.accountFilters = new AccountFiltersImpl(clientObject.getAccountFilters(), this); + } + return accountFilters; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of Mediaservices. */ + public Mediaservices mediaservices() { + if (this.mediaservices == null) { + this.mediaservices = new MediaservicesImpl(clientObject.getMediaservices(), this); + } + return mediaservices; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of Locations. */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(clientObject.getLocations(), this); + } + return locations; + } + + /** @return Resource collection API of Assets. */ + public Assets assets() { + if (this.assets == null) { + this.assets = new AssetsImpl(clientObject.getAssets(), this); + } + return assets; + } + + /** @return Resource collection API of AssetFilters. */ + public AssetFilters assetFilters() { + if (this.assetFilters == null) { + this.assetFilters = new AssetFiltersImpl(clientObject.getAssetFilters(), this); + } + return assetFilters; + } + + /** @return Resource collection API of ContentKeyPolicies. */ + public ContentKeyPolicies contentKeyPolicies() { + if (this.contentKeyPolicies == null) { + this.contentKeyPolicies = new ContentKeyPoliciesImpl(clientObject.getContentKeyPolicies(), this); + } + return contentKeyPolicies; + } + + /** @return Resource collection API of Transforms. */ + public Transforms transforms() { + if (this.transforms == null) { + this.transforms = new TransformsImpl(clientObject.getTransforms(), this); + } + return transforms; + } + + /** @return Resource collection API of Jobs. */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(clientObject.getJobs(), this); + } + return jobs; + } + + /** @return Resource collection API of StreamingPolicies. */ + public StreamingPolicies streamingPolicies() { + if (this.streamingPolicies == null) { + this.streamingPolicies = new StreamingPoliciesImpl(clientObject.getStreamingPolicies(), this); + } + return streamingPolicies; + } + + /** @return Resource collection API of StreamingLocators. */ + public StreamingLocators streamingLocators() { + if (this.streamingLocators == null) { + this.streamingLocators = new StreamingLocatorsImpl(clientObject.getStreamingLocators(), this); + } + return streamingLocators; + } + + /** @return Resource collection API of LiveEvents. */ + public LiveEvents liveEvents() { + if (this.liveEvents == null) { + this.liveEvents = new LiveEventsImpl(clientObject.getLiveEvents(), this); + } + return liveEvents; + } + + /** @return Resource collection API of LiveOutputs. */ + public LiveOutputs liveOutputs() { + if (this.liveOutputs == null) { + this.liveOutputs = new LiveOutputsImpl(clientObject.getLiveOutputs(), this); + } + return liveOutputs; + } + + /** @return Resource collection API of StreamingEndpoints. */ + public StreamingEndpoints streamingEndpoints() { + if (this.streamingEndpoints == null) { + this.streamingEndpoints = new StreamingEndpointsImpl(clientObject.getStreamingEndpoints(), this); + } + return streamingEndpoints; + } + + /** + * @return Wrapped service client AzureMediaServices providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public AzureMediaServices serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AccountFiltersClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AccountFiltersClient.java new file mode 100644 index 000000000000..f6d7bf38c9b0 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AccountFiltersClient.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner; + +/** An instance of this class provides access to all the operations defined in AccountFiltersClient. */ +public interface AccountFiltersClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountFilterInner get(String resourceGroupName, String accountName, String filterName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String filterName, Context context); + + /** + * 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 An Account Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountFilterInner createOrUpdate( + String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters); + + /** + * 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 An Account Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String filterName, + AccountFilterInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String filterName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String filterName, Context context); + + /** + * 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 An Account Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountFilterInner update( + String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters); + + /** + * 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 An Account Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String filterName, + AccountFilterInner parameters, + Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AssetFiltersClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AssetFiltersClient.java new file mode 100644 index 000000000000..359c0d90aa9f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AssetFiltersClient.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner; + +/** An instance of this class provides access to all the operations defined in AssetFiltersClient. */ +public interface AssetFiltersClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String assetName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssetFilterInner get(String resourceGroupName, String accountName, String assetName, String filterName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String assetName, String filterName, Context context); + + /** + * 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 An Asset Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssetFilterInner createOrUpdate( + String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters); + + /** + * 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 An Asset Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String assetName, String filterName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String assetName, String filterName, Context context); + + /** + * 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 An Asset Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssetFilterInner update( + String resourceGroupName, String accountName, String assetName, String filterName, AssetFilterInner parameters); + + /** + * 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 An Asset Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters, + Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AssetsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AssetsClient.java new file mode 100644 index 000000000000..a443ad66bb73 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AssetsClient.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetContainerSasInner; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetInner; +import com.azure.resourcemanager.mediaservices.fluent.models.ListStreamingLocatorsResponseInner; +import com.azure.resourcemanager.mediaservices.fluent.models.StorageEncryptedAssetDecryptionDataInner; +import com.azure.resourcemanager.mediaservices.models.ListContainerSasInput; + +/** An instance of this class provides access to all the operations defined in AssetsClient. */ +public interface AssetsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssetInner get(String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String assetName, Context context); + + /** + * 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 An Asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssetInner createOrUpdate(String resourceGroupName, String accountName, String assetName, AssetInner parameters); + + /** + * 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 An Asset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, String assetName, AssetInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String assetName, Context context); + + /** + * 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 An Asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssetInner update(String resourceGroupName, String accountName, String assetName, AssetInner parameters); + + /** + * 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 An Asset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, String assetName, AssetInner parameters, Context context); + + /** + * 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 parameters to the list SAS request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset Storage container SAS URLs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssetContainerSasInner listContainerSas( + String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters); + + /** + * 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 parameters to the list SAS request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset Storage container SAS URLs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listContainerSasWithResponse( + String resourceGroupName, + String accountName, + String assetName, + ListContainerSasInput parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageEncryptedAssetDecryptionDataInner getEncryptionKey( + String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEncryptionKeyWithResponse( + String resourceGroupName, String accountName, String assetName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Streaming Locators associated with this Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListStreamingLocatorsResponseInner listStreamingLocators( + String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Streaming Locators associated with this Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listStreamingLocatorsWithResponse( + String resourceGroupName, String accountName, String assetName, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AzureMediaServices.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AzureMediaServices.java new file mode 100644 index 000000000000..8b471b588920 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AzureMediaServices.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AzureMediaServices class. */ +public interface AzureMediaServices { + /** + * Gets The unique identifier for a Microsoft Azure subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the AccountFiltersClient object to access its operations. + * + * @return the AccountFiltersClient object. + */ + AccountFiltersClient getAccountFilters(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the MediaservicesClient object to access its operations. + * + * @return the MediaservicesClient object. + */ + MediaservicesClient getMediaservices(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + LocationsClient getLocations(); + + /** + * Gets the AssetsClient object to access its operations. + * + * @return the AssetsClient object. + */ + AssetsClient getAssets(); + + /** + * Gets the AssetFiltersClient object to access its operations. + * + * @return the AssetFiltersClient object. + */ + AssetFiltersClient getAssetFilters(); + + /** + * Gets the ContentKeyPoliciesClient object to access its operations. + * + * @return the ContentKeyPoliciesClient object. + */ + ContentKeyPoliciesClient getContentKeyPolicies(); + + /** + * Gets the TransformsClient object to access its operations. + * + * @return the TransformsClient object. + */ + TransformsClient getTransforms(); + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + JobsClient getJobs(); + + /** + * Gets the StreamingPoliciesClient object to access its operations. + * + * @return the StreamingPoliciesClient object. + */ + StreamingPoliciesClient getStreamingPolicies(); + + /** + * Gets the StreamingLocatorsClient object to access its operations. + * + * @return the StreamingLocatorsClient object. + */ + StreamingLocatorsClient getStreamingLocators(); + + /** + * Gets the LiveEventsClient object to access its operations. + * + * @return the LiveEventsClient object. + */ + LiveEventsClient getLiveEvents(); + + /** + * Gets the LiveOutputsClient object to access its operations. + * + * @return the LiveOutputsClient object. + */ + LiveOutputsClient getLiveOutputs(); + + /** + * Gets the StreamingEndpointsClient object to access its operations. + * + * @return the StreamingEndpointsClient object. + */ + StreamingEndpointsClient getStreamingEndpoints(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/ContentKeyPoliciesClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/ContentKeyPoliciesClient.java new file mode 100644 index 000000000000..28bb1ef38d2e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/ContentKeyPoliciesClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyPropertiesInner; + +/** An instance of this class provides access to all the operations defined in ContentKeyPoliciesClient. */ +public interface ContentKeyPoliciesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContentKeyPolicyInner get(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context); + + /** + * 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 A Content Key Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContentKeyPolicyInner createOrUpdate( + String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters); + + /** + * 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 A Content Key Policy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String contentKeyPolicyName, + ContentKeyPolicyInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context); + + /** + * 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 A Content Key Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContentKeyPolicyInner update( + String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters); + + /** + * 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 A Content Key Policy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String contentKeyPolicyName, + ContentKeyPolicyInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy including secret values. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContentKeyPolicyPropertiesInner getPolicyPropertiesWithSecrets( + String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy including secret values. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPolicyPropertiesWithSecretsWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/JobsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/JobsClient.java new file mode 100644 index 000000000000..a4111ef9611e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/JobsClient.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.JobInner; + +/** An instance of this class provides access to all the operations defined in JobsClient. */ +public interface JobsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String transformName); + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String accountName, + String transformName, + String filter, + String orderby, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner get(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context); + + /** + * 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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner create( + String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters); + + /** + * 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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String accountName, + String transformName, + String jobName, + JobInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context); + + /** + * Update is only supported for description and priority. Updating Priority will take effect when the Job state is + * Queued or Scheduled and depending on the timing the priority update may be ignored. + * + * @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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner update( + String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters); + + /** + * Update is only supported for description and priority. Updating Priority will take effect when the Job state is + * Queued or Scheduled and depending on the timing the priority update may be ignored. + * + * @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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String transformName, + String jobName, + JobInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancelJob(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelJobWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/LiveEventsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/LiveEventsClient.java new file mode 100644 index 000000000000..93e1d5903718 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/LiveEventsClient.java @@ -0,0 +1,553 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner; +import com.azure.resourcemanager.mediaservices.models.LiveEventActionInput; + +/** An instance of this class provides access to all the operations defined in LiveEventsClient. */ +public interface LiveEventsClient { + /** + * Lists all 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets properties of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveEventInner get(String resourceGroupName, String accountName, String liveEventName); + + /** + * Gets properties of 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LiveEventInner> beginCreate( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart); + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LiveEventInner> beginCreate( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart, + Context context); + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveEventInner create( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart); + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveEventInner create( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters); + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveEventInner create( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart, + Context context); + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LiveEventInner> beginUpdate( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters); + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LiveEventInner> beginUpdate( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Context context); + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveEventInner update( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters); + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveEventInner update( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters, Context context); + + /** + * 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String liveEventName); + + /** + * 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String liveEventName); + + /** + * 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginAllocate( + String resourceGroupName, String accountName, String liveEventName); + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginAllocate( + String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void allocate(String resourceGroupName, String accountName, String liveEventName); + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void allocate(String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String resourceGroupName, String accountName, String liveEventName); + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart( + String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String accountName, String liveEventName); + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop( + String resourceGroupName, String accountName, String liveEventName, LiveEventActionInput parameters); + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventActionInput parameters, + Context context); + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String accountName, String liveEventName, LiveEventActionInput parameters); + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventActionInput parameters, + Context context); + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReset(String resourceGroupName, String accountName, String liveEventName); + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReset( + String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reset(String resourceGroupName, String accountName, String liveEventName); + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reset(String resourceGroupName, String accountName, String liveEventName, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/LiveOutputsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/LiveOutputsClient.java new file mode 100644 index 000000000000..8d22bde2ec64 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/LiveOutputsClient.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveOutputInner; + +/** An instance of this class provides access to all the operations defined in LiveOutputsClient. */ +public interface LiveOutputsClient { + /** + * Lists the live outputs of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String liveEventName); + + /** + * Lists the live outputs of 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveOutputInner get(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + + /** + * 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context); + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LiveOutputInner> beginCreate( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters); + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, LiveOutputInner> beginCreate( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters, + Context context); + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveOutputInner create( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters); + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LiveOutputInner create( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters, + Context context); + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context); + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/LocationsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/LocationsClient.java new file mode 100644 index 000000000000..939b187c74cb --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/LocationsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.EntityNameAvailabilityCheckOutputInner; +import com.azure.resourcemanager.mediaservices.models.CheckNameAvailabilityInput; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public interface LocationsClient { + /** + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location. + * @param parameters The input to the check name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EntityNameAvailabilityCheckOutputInner checkNameAvailability( + String locationName, CheckNameAvailabilityInput parameters); + + /** + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location. + * @param parameters The input to the check name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String locationName, CheckNameAvailabilityInput parameters, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/MediaservicesClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/MediaservicesClient.java new file mode 100644 index 000000000000..f54a3f7bb3a7 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/MediaservicesClient.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.EdgePoliciesInner; +import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; +import com.azure.resourcemanager.mediaservices.models.ListEdgePoliciesInput; +import com.azure.resourcemanager.mediaservices.models.SyncStorageKeysInput; + +/** An instance of this class provides access to all the operations defined in MediaservicesClient. */ +public interface MediaservicesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MediaServiceInner getByResourceGroup(String resourceGroupName, String accountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * 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 A Media Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MediaServiceInner createOrUpdate(String resourceGroupName, String accountName, MediaServiceInner parameters); + + /** + * 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 A Media Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, MediaServiceInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * 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 A Media Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceInner parameters); + + /** + * 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 A Media Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, MediaServiceInner parameters, Context context); + + /** + * 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 parameters The input to the sync storage keys request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void syncStorageKeys(String resourceGroupName, String accountName, SyncStorageKeysInput parameters); + + /** + * 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 parameters The input to the sync storage keys request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response syncStorageKeysWithResponse( + String resourceGroupName, String accountName, SyncStorageKeysInput parameters, Context context); + + /** + * List the media edge policies associated with the 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgePoliciesInner listEdgePolicies(String resourceGroupName, String accountName, ListEdgePoliciesInput parameters); + + /** + * List the media edge policies associated with the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listEdgePoliciesWithResponse( + String resourceGroupName, String accountName, ListEdgePoliciesInput parameters, Context context); + + /** + * List Media Services accounts in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Media Services accounts in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MediaServiceInner getBySubscription(String accountName); + + /** + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBySubscriptionWithResponse(String accountName, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/OperationsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/OperationsClient.java new file mode 100644 index 000000000000..052bb9e5c753 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all the Media Services operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the Media Services operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/PrivateEndpointConnectionsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..57b2960fa4fb --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Get all private endpoint connections. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionListResultInner list(String resourceGroupName, String accountName); + + /** + * Get all private endpoint connections. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Get private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String accountName, String name); + + /** + * Get private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String name, Context context); + + /** + * Update private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param parameters The Private Endpoint Connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, String accountName, String name, PrivateEndpointConnectionInner parameters); + + /** + * Update private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param parameters The Private Endpoint Connection resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String name, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Delete private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String name); + + /** + * Delete private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String name, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/PrivateLinkResourcesClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..641edfa4ff75 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Get list of group IDs. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of group IDs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner list(String resourceGroupName, String accountName); + + /** + * Get list of group IDs. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of group IDs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Get group ID. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return group ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String accountName, String name); + + /** + * Get group ID. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return group ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String name, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/StreamingEndpointsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/StreamingEndpointsClient.java new file mode 100644 index 000000000000..ef0cf21453a5 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/StreamingEndpointsClient.java @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner; +import com.azure.resourcemanager.mediaservices.models.StreamingEntityScaleUnit; + +/** An instance of this class provides access to all the operations defined in StreamingEndpointsClient. */ +public interface StreamingEndpointsClient { + /** + * Lists the streaming endpoints 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists the streaming endpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingEndpointInner get(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Gets a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StreamingEndpointInner> beginCreate( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart); + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StreamingEndpointInner> beginCreate( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart, + Context context); + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingEndpointInner create( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart); + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingEndpointInner create( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters); + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingEndpointInner create( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart, + Context context); + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StreamingEndpointInner> beginUpdate( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters); + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StreamingEndpointInner> beginUpdate( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Context context); + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingEndpointInner update( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters); + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingEndpointInner update( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Context context); + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart( + String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart( + String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop( + String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop( + String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginScale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters); + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginScale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters, + Context context); + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void scale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters); + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void scale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters, + Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/StreamingLocatorsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/StreamingLocatorsClient.java new file mode 100644 index 000000000000..8fe4ec8ee631 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/StreamingLocatorsClient.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.ListContentKeysResponseInner; +import com.azure.resourcemanager.mediaservices.fluent.models.ListPathsResponseInner; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingLocatorInner; + +/** An instance of this class provides access to all the operations defined in StreamingLocatorsClient. */ +public interface StreamingLocatorsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingLocatorInner get(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context); + + /** + * 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 A Streaming Locator resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Locator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingLocatorInner create( + String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters); + + /** + * 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 A Streaming Locator resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Locator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String accountName, + String streamingLocatorName, + StreamingLocatorInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listContentKeys action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListContentKeysResponseInner listContentKeys( + String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listContentKeys action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listContentKeysWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listPaths action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListPathsResponseInner listPaths(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listPaths action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listPathsWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/StreamingPoliciesClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/StreamingPoliciesClient.java new file mode 100644 index 000000000000..291e1287572d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/StreamingPoliciesClient.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner; + +/** An instance of this class provides access to all the operations defined in StreamingPoliciesClient. */ +public interface StreamingPoliciesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingPolicyInner get(String resourceGroupName, String accountName, String streamingPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String streamingPolicyName, Context context); + + /** + * 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 A Streaming Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamingPolicyInner create( + String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters); + + /** + * 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 A Streaming Policy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String accountName, + String streamingPolicyName, + StreamingPolicyInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String streamingPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String streamingPolicyName, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/TransformsClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/TransformsClient.java new file mode 100644 index 000000000000..c9d2f6a4c389 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/TransformsClient.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.TransformInner; + +/** An instance of this class provides access to all the operations defined in TransformsClient. */ +public interface TransformsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String filter, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransformInner get(String resourceGroupName, String accountName, String transformName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String transformName, Context context); + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransformInner createOrUpdate( + String resourceGroupName, String accountName, String transformName, TransformInner parameters); + + /** + * 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, String transformName, TransformInner parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String transformName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String transformName, Context context); + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransformInner update( + String resourceGroupName, String accountName, String transformName, TransformInner parameters); + + /** + * 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, String transformName, TransformInner parameters, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AccountFilterInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AccountFilterInner.java new file mode 100644 index 000000000000..d0705243f5a8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AccountFilterInner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.FilterTrackSelection; +import com.azure.resourcemanager.mediaservices.models.FirstQuality; +import com.azure.resourcemanager.mediaservices.models.PresentationTimeRange; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An Account Filter. */ +@JsonFlatten +@Fluent +public class AccountFilterInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountFilterInner.class); + + /* + * 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 presentationTimeRange property: The presentation time range. + * + * @return the presentationTimeRange value. + */ + public PresentationTimeRange presentationTimeRange() { + return this.presentationTimeRange; + } + + /** + * Set the presentationTimeRange property: 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 firstQuality property: The first quality. + * + * @return the firstQuality value. + */ + public FirstQuality firstQuality() { + return this.firstQuality; + } + + /** + * Set the firstQuality property: 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 property: The tracks selection conditions. + * + * @return the tracks value. + */ + public List tracks() { + return this.tracks; + } + + /** + * Set the tracks property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (presentationTimeRange() != null) { + presentationTimeRange().validate(); + } + if (firstQuality() != null) { + firstQuality().validate(); + } + if (tracks() != null) { + tracks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetContainerSasInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetContainerSasInner.java new file mode 100644 index 000000000000..635c5eb80f30 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetContainerSasInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Asset Storage container SAS URLs. */ +@Fluent +public final class AssetContainerSasInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssetContainerSasInner.class); + + /* + * The list of Asset container SAS URLs. + */ + @JsonProperty(value = "assetContainerSasUrls") + private List assetContainerSasUrls; + + /** + * Get the assetContainerSasUrls property: The list of Asset container SAS URLs. + * + * @return the assetContainerSasUrls value. + */ + public List assetContainerSasUrls() { + return this.assetContainerSasUrls; + } + + /** + * Set the assetContainerSasUrls property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetFilterInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetFilterInner.java new file mode 100644 index 000000000000..d18060609f8a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetFilterInner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.FilterTrackSelection; +import com.azure.resourcemanager.mediaservices.models.FirstQuality; +import com.azure.resourcemanager.mediaservices.models.PresentationTimeRange; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An Asset Filter. */ +@JsonFlatten +@Fluent +public class AssetFilterInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssetFilterInner.class); + + /* + * 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 presentationTimeRange property: The presentation time range. + * + * @return the presentationTimeRange value. + */ + public PresentationTimeRange presentationTimeRange() { + return this.presentationTimeRange; + } + + /** + * Set the presentationTimeRange property: 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 firstQuality property: The first quality. + * + * @return the firstQuality value. + */ + public FirstQuality firstQuality() { + return this.firstQuality; + } + + /** + * Set the firstQuality property: 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 property: The tracks selection conditions. + * + * @return the tracks value. + */ + public List tracks() { + return this.tracks; + } + + /** + * Set the tracks property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (presentationTimeRange() != null) { + presentationTimeRange().validate(); + } + if (firstQuality() != null) { + firstQuality().validate(); + } + if (tracks() != null) { + tracks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetInner.java new file mode 100644 index 000000000000..225debe57597 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.AssetStorageEncryptionFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** An Asset. */ +@JsonFlatten +@Fluent +public class AssetInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssetInner.class); + + /* + * 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 OffsetDateTime created; + + /* + * The last modified date of the Asset. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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. + */ + @JsonProperty(value = "properties.storageEncryptionFormat", access = JsonProperty.Access.WRITE_ONLY) + private AssetStorageEncryptionFormat storageEncryptionFormat; + + /** + * Get the assetId property: The Asset ID. + * + * @return the assetId value. + */ + public UUID assetId() { + return this.assetId; + } + + /** + * Get the created property: The creation date of the Asset. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the lastModified property: The last modified date of the Asset. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the alternateId property: The alternate ID of the Asset. + * + * @return the alternateId value. + */ + public String alternateId() { + return this.alternateId; + } + + /** + * Set the alternateId property: The alternate ID of the Asset. + * + * @param alternateId the alternateId value to set. + * @return the AssetInner object itself. + */ + public AssetInner withAlternateId(String alternateId) { + this.alternateId = alternateId; + return this; + } + + /** + * Get the description property: The Asset description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The Asset description. + * + * @param description the description value to set. + * @return the AssetInner object itself. + */ + public AssetInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the container property: The name of the asset blob container. + * + * @return the container value. + */ + public String container() { + return this.container; + } + + /** + * Set the container property: The name of the asset blob container. + * + * @param container the container value to set. + * @return the AssetInner object itself. + */ + public AssetInner withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the storageAccountName property: The name of the storage account. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: The name of the storage account. + * + * @param storageAccountName the storageAccountName value to set. + * @return the AssetInner object itself. + */ + public AssetInner withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageEncryptionFormat property: The Asset encryption format. One of None or MediaStorageEncryption. + * + * @return the storageEncryptionFormat value. + */ + public AssetStorageEncryptionFormat storageEncryptionFormat() { + return this.storageEncryptionFormat; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyInner.java new file mode 100644 index 000000000000..32d4954f6537 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyInner.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** A Content Key Policy resource. */ +@JsonFlatten +@Fluent +public class ContentKeyPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyInner.class); + + /* + * 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 OffsetDateTime created; + + /* + * The last modified date of the Policy + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModified; + + /* + * A description for the Policy. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The Key Policy options. + */ + @JsonProperty(value = "properties.options") + private List options; + + /** + * Get the policyId property: The legacy Policy ID. + * + * @return the policyId value. + */ + public UUID policyId() { + return this.policyId; + } + + /** + * Get the created property: The creation date of the Policy. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the lastModified property: The last modified date of the Policy. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the description property: A description for the Policy. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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 options property: The Key Policy options. + * + * @return the options value. + */ + public List options() { + return this.options; + } + + /** + * Set the options property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (options() != null) { + options().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyPropertiesInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyPropertiesInner.java new file mode 100644 index 000000000000..0dfedac80e67 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyPropertiesInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** The properties of the Content Key Policy. */ +@Fluent +public final class ContentKeyPolicyPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyPropertiesInner.class); + + /* + * 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 OffsetDateTime created; + + /* + * The last modified date of the Policy + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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 policyId property: The legacy Policy ID. + * + * @return the policyId value. + */ + public UUID policyId() { + return this.policyId; + } + + /** + * Get the created property: The creation date of the Policy. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the lastModified property: The last modified date of the Policy. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the description property: A description for the Policy. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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 options property: The Key Policy options. + * + * @return the options value. + */ + public List options() { + return this.options; + } + + /** + * Set the options property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (options() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property options in model ContentKeyPolicyPropertiesInner")); + } else { + options().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/EdgePoliciesInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/EdgePoliciesInner.java new file mode 100644 index 000000000000..adfcce4fab72 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/EdgePoliciesInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.EdgeUsageDataCollectionPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EdgePolicies model. */ +@Fluent +public final class EdgePoliciesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EdgePoliciesInner.class); + + /* + * The usageDataCollectionPolicy property. + */ + @JsonProperty(value = "usageDataCollectionPolicy") + private EdgeUsageDataCollectionPolicy usageDataCollectionPolicy; + + /** + * Get the usageDataCollectionPolicy property: The usageDataCollectionPolicy property. + * + * @return the usageDataCollectionPolicy value. + */ + public EdgeUsageDataCollectionPolicy usageDataCollectionPolicy() { + return this.usageDataCollectionPolicy; + } + + /** + * Set the usageDataCollectionPolicy property: The usageDataCollectionPolicy property. + * + * @param usageDataCollectionPolicy the usageDataCollectionPolicy value to set. + * @return the EdgePoliciesInner object itself. + */ + public EdgePoliciesInner withUsageDataCollectionPolicy(EdgeUsageDataCollectionPolicy usageDataCollectionPolicy) { + this.usageDataCollectionPolicy = usageDataCollectionPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (usageDataCollectionPolicy() != null) { + usageDataCollectionPolicy().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/EntityNameAvailabilityCheckOutputInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/EntityNameAvailabilityCheckOutputInner.java new file mode 100644 index 000000000000..447dcca01e24 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/EntityNameAvailabilityCheckOutputInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The response from the check name availability request. */ +@Fluent +public final class EntityNameAvailabilityCheckOutputInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityNameAvailabilityCheckOutputInner.class); + + /* + * 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 the nameAvailable property: Specifies if the name is available. + * + * @return the nameAvailable value. + */ + public boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: 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 the reason property: Specifies the reason if the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: 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 the message property: Specifies the detailed reason if the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/JobInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/JobInner.java new file mode 100644 index 000000000000..5f48711a9d14 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/JobInner.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.JobInput; +import com.azure.resourcemanager.mediaservices.models.JobOutput; +import com.azure.resourcemanager.mediaservices.models.JobState; +import com.azure.resourcemanager.mediaservices.models.Priority; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * A Job resource type. The progress and state can be obtained by polling a Job or subscribing to events using + * EventGrid. + */ +@JsonFlatten +@Fluent +public class JobInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobInner.class); + + /* + * The UTC date and time when the customer has created the Job, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime created; + + /* + * The current state of the job. + */ + @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") + private JobInput input; + + /* + * The UTC date and time when the customer has last updated the Job, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModified; + + /* + * The outputs for the Job. + */ + @JsonProperty(value = "properties.outputs") + 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. + */ + @JsonProperty(value = "properties.priority") + private Priority priority; + + /* + * Customer provided key, value pairs that will be returned in Job and + * JobOutput state events. + */ + @JsonProperty(value = "properties.correlationData") + private Map correlationData; + + /* + * The UTC date and time at which this Job began processing. + */ + @JsonProperty(value = "properties.startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The UTC date and time at which this Job finished processing. + */ + @JsonProperty(value = "properties.endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /** + * Get the created property: The UTC date and time when the customer has created the Job, in 'YYYY-MM-DDThh:mm:ssZ' + * format. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the state property: The current state of the job. + * + * @return the state value. + */ + public JobState state() { + return this.state; + } + + /** + * Get the description property: Optional customer supplied description of the Job. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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 input property: The inputs for the Job. + * + * @return the input value. + */ + public JobInput input() { + return this.input; + } + + /** + * Set the input property: 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 lastModified property: The UTC date and time when the customer has last updated the Job, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the outputs property: The outputs for the Job. + * + * @return the outputs value. + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs property: 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 the priority property: Priority with which the job should be processed. Higher priority jobs are processed + * before lower priority jobs. If not set, the default is normal. + * + * @return the priority value. + */ + public Priority priority() { + return this.priority; + } + + /** + * Set the priority property: Priority with which the job should be processed. Higher priority jobs are processed + * before lower priority jobs. If not set, the default is normal. + * + * @param priority the priority value to set. + * @return the JobInner object itself. + */ + public JobInner withPriority(Priority priority) { + this.priority = priority; + return this; + } + + /** + * Get the correlationData property: Customer provided key, value pairs that will be returned in Job and JobOutput + * state events. + * + * @return the correlationData value. + */ + public Map correlationData() { + return this.correlationData; + } + + /** + * Set the correlationData property: Customer provided key, value pairs 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; + } + + /** + * Get the startTime property: The UTC date and time at which this Job began processing. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The UTC date and time at which this Job finished processing. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (input() != null) { + input().validate(); + } + if (outputs() != null) { + outputs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ListContentKeysResponseInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ListContentKeysResponseInner.java new file mode 100644 index 000000000000..7c2e041c19c9 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ListContentKeysResponseInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.StreamingLocatorContentKey; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class of response for listContentKeys action. */ +@Fluent +public final class ListContentKeysResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListContentKeysResponseInner.class); + + /* + * ContentKeys used by current Streaming Locator + */ + @JsonProperty(value = "contentKeys") + private List contentKeys; + + /** + * Get the contentKeys property: ContentKeys used by current Streaming Locator. + * + * @return the contentKeys value. + */ + public List contentKeys() { + return this.contentKeys; + } + + /** + * Set the contentKeys property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentKeys() != null) { + contentKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ListPathsResponseInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ListPathsResponseInner.java new file mode 100644 index 000000000000..8c4e39ada112 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ListPathsResponseInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.StreamingPath; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class of response for listPaths action. */ +@Fluent +public final class ListPathsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListPathsResponseInner.class); + + /* + * 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 the streamingPaths property: Streaming Paths supported by current Streaming Locator. + * + * @return the streamingPaths value. + */ + public List streamingPaths() { + return this.streamingPaths; + } + + /** + * Set the streamingPaths property: Streaming Paths supported by current Streaming Locator. + * + * @param streamingPaths the streamingPaths value to set. + * @return the ListPathsResponseInner object itself. + */ + public ListPathsResponseInner withStreamingPaths(List streamingPaths) { + this.streamingPaths = streamingPaths; + return this; + } + + /** + * Get the downloadPaths property: Download Paths supported by current Streaming Locator. + * + * @return the downloadPaths value. + */ + public List downloadPaths() { + return this.downloadPaths; + } + + /** + * Set the downloadPaths property: Download Paths supported by current Streaming Locator. + * + * @param downloadPaths the downloadPaths value to set. + * @return the ListPathsResponseInner object itself. + */ + public ListPathsResponseInner withDownloadPaths(List downloadPaths) { + this.downloadPaths = downloadPaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streamingPaths() != null) { + streamingPaths().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ListStreamingLocatorsResponseInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ListStreamingLocatorsResponseInner.java new file mode 100644 index 000000000000..3dd8a18b8ce3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ListStreamingLocatorsResponseInner.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.AssetStreamingLocator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Streaming Locators associated with this Asset. */ +@Immutable +public final class ListStreamingLocatorsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListStreamingLocatorsResponseInner.class); + + /* + * The list of Streaming Locators. + */ + @JsonProperty(value = "streamingLocators", access = JsonProperty.Access.WRITE_ONLY) + private List streamingLocators; + + /** + * Get the streamingLocators property: The list of Streaming Locators. + * + * @return the streamingLocators value. + */ + public List streamingLocators() { + return this.streamingLocators; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streamingLocators() != null) { + streamingLocators().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveEventInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveEventInner.java new file mode 100644 index 000000000000..b9de698cfe82 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveEventInner.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.CrossSiteAccessPolicies; +import com.azure.resourcemanager.mediaservices.models.LiveEventEncoding; +import com.azure.resourcemanager.mediaservices.models.LiveEventInput; +import com.azure.resourcemanager.mediaservices.models.LiveEventPreview; +import com.azure.resourcemanager.mediaservices.models.LiveEventResourceState; +import com.azure.resourcemanager.mediaservices.models.LiveEventTranscription; +import com.azure.resourcemanager.mediaservices.models.StreamOptionsFlag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The live event. */ +@JsonFlatten +@Fluent +public class LiveEventInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventInner.class); + + /* + * A description for the live event. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Live event input settings. It defines how the live event receives input + * from a contribution encoder. + */ + @JsonProperty(value = "properties.input") + private LiveEventInput input; + + /* + * Live event preview settings. Preview allows live event producers to + * preview the live streaming content without creating any live output. + */ + @JsonProperty(value = "properties.preview") + private LiveEventPreview preview; + + /* + * Encoding settings for the live event. It configures whether a live + * encoder is used for the live event and settings for the live encoder if + * it is used. + */ + @JsonProperty(value = "properties.encoding") + private LiveEventEncoding encoding; + + /* + * Live transcription settings for the live event. See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information + * about the live transcription feature. + */ + @JsonProperty(value = "properties.transcriptions") + private List transcriptions; + + /* + * 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. See + * https://go.microsoft.com/fwlink/?linkid=2139012 for more information. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private LiveEventResourceState resourceState; + + /* + * Live event cross site access policies. + */ + @JsonProperty(value = "properties.crossSiteAccessPolicies") + private CrossSiteAccessPolicies crossSiteAccessPolicies; + + /* + * Specifies whether a static hostname would be assigned to the live event + * preview and ingest endpoints. This value can only be updated if the live + * event is in Standby state + */ + @JsonProperty(value = "properties.useStaticHostname") + private Boolean useStaticHostname; + + /* + * When useStaticHostname is set to true, the hostnamePrefix specifies the + * first part of the hostname assigned to the live event preview and ingest + * endpoints. The final hostname would be a combination of this prefix, the + * media service account name and a short code for the Azure Media Services + * data center. + */ + @JsonProperty(value = "properties.hostnamePrefix") + private String hostnamePrefix; + + /* + * The options to use for the LiveEvent. This value is specified at + * creation time and cannot be updated. The valid values for the array + * entry values are 'Default' and 'LowLatency'. + */ + @JsonProperty(value = "properties.streamOptions") + private List streamOptions; + + /* + * The creation time for the live event + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime created; + + /* + * The last modified time of the live event. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModified; + + /** + * Get the description property: A description for the live event. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description for the live event. + * + * @param description the description value to set. + * @return the LiveEventInner object itself. + */ + public LiveEventInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the input property: Live event input settings. It defines how the live event receives input from a + * contribution encoder. + * + * @return the input value. + */ + public LiveEventInput input() { + return this.input; + } + + /** + * Set the input property: Live event input settings. It defines how the live event receives input from a + * contribution encoder. + * + * @param input the input value to set. + * @return the LiveEventInner object itself. + */ + public LiveEventInner withInput(LiveEventInput input) { + this.input = input; + return this; + } + + /** + * Get the preview property: Live event preview settings. Preview allows live event producers to preview the live + * streaming content without creating any live output. + * + * @return the preview value. + */ + public LiveEventPreview preview() { + return this.preview; + } + + /** + * Set the preview property: Live event preview settings. Preview allows live event producers to preview the live + * streaming content without creating any live output. + * + * @param preview the preview value to set. + * @return the LiveEventInner object itself. + */ + public LiveEventInner withPreview(LiveEventPreview preview) { + this.preview = preview; + return this; + } + + /** + * Get the encoding property: Encoding settings for the live event. It configures whether a live encoder is used for + * the live event and settings for the live encoder if it is used. + * + * @return the encoding value. + */ + public LiveEventEncoding encoding() { + return this.encoding; + } + + /** + * Set the encoding property: Encoding settings for the live event. It configures whether a live encoder is used for + * the live event and settings for the live encoder if it is used. + * + * @param encoding the encoding value to set. + * @return the LiveEventInner object itself. + */ + public LiveEventInner withEncoding(LiveEventEncoding encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get the transcriptions property: Live transcription settings for the live event. See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature. + * + * @return the transcriptions value. + */ + public List transcriptions() { + return this.transcriptions; + } + + /** + * Set the transcriptions property: Live transcription settings for the live event. See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature. + * + * @param transcriptions the transcriptions value to set. + * @return the LiveEventInner object itself. + */ + public LiveEventInner withTranscriptions(List transcriptions) { + this.transcriptions = transcriptions; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the live event. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: The resource state of the live event. See + * https://go.microsoft.com/fwlink/?linkid=2139012 for more information. + * + * @return the resourceState value. + */ + public LiveEventResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the crossSiteAccessPolicies property: Live event cross site access policies. + * + * @return the crossSiteAccessPolicies value. + */ + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.crossSiteAccessPolicies; + } + + /** + * Set the crossSiteAccessPolicies property: Live event cross site 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 the useStaticHostname property: Specifies whether a static hostname would be assigned to the live event + * preview and ingest endpoints. This value can only be updated if the live event is in Standby state. + * + * @return the useStaticHostname value. + */ + public Boolean useStaticHostname() { + return this.useStaticHostname; + } + + /** + * Set the useStaticHostname property: Specifies whether a static hostname would be assigned to the live event + * preview and ingest endpoints. This value can only be updated if the live event is in Standby state. + * + * @param useStaticHostname the useStaticHostname value to set. + * @return the LiveEventInner object itself. + */ + public LiveEventInner withUseStaticHostname(Boolean useStaticHostname) { + this.useStaticHostname = useStaticHostname; + return this; + } + + /** + * Get the hostnamePrefix property: When useStaticHostname is set to true, the hostnamePrefix specifies the first + * part of the hostname assigned to the live event preview and ingest endpoints. The final hostname would be a + * combination of this prefix, the media service account name and a short code for the Azure Media Services data + * center. + * + * @return the hostnamePrefix value. + */ + public String hostnamePrefix() { + return this.hostnamePrefix; + } + + /** + * Set the hostnamePrefix property: When useStaticHostname is set to true, the hostnamePrefix specifies the first + * part of the hostname assigned to the live event preview and ingest endpoints. The final hostname would be a + * combination of this prefix, the media service account name and a short code for the Azure Media Services data + * center. + * + * @param hostnamePrefix the hostnamePrefix value to set. + * @return the LiveEventInner object itself. + */ + public LiveEventInner withHostnamePrefix(String hostnamePrefix) { + this.hostnamePrefix = hostnamePrefix; + return this; + } + + /** + * Get the streamOptions property: The options to use for the LiveEvent. This value is specified at creation time + * and cannot be updated. The valid values for the array entry values are 'Default' and 'LowLatency'. + * + * @return the streamOptions value. + */ + public List streamOptions() { + return this.streamOptions; + } + + /** + * Set the streamOptions property: The options to use for the LiveEvent. This value is specified at creation time + * and cannot be updated. The valid values for the array entry values are 'Default' and 'LowLatency'. + * + * @param streamOptions the streamOptions value to set. + * @return the LiveEventInner object itself. + */ + public LiveEventInner withStreamOptions(List streamOptions) { + this.streamOptions = streamOptions; + return this; + } + + /** + * Get the created property: The creation time for the live event. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the lastModified property: The last modified time of the live event. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** {@inheritDoc} */ + @Override + public LiveEventInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public LiveEventInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (input() != null) { + input().validate(); + } + if (preview() != null) { + preview().validate(); + } + if (encoding() != null) { + encoding().validate(); + } + if (transcriptions() != null) { + transcriptions().forEach(e -> e.validate()); + } + if (crossSiteAccessPolicies() != null) { + crossSiteAccessPolicies().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveOutputInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveOutputInner.java new file mode 100644 index 000000000000..1b51b55a390c --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveOutputInner.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.Hls; +import com.azure.resourcemanager.mediaservices.models.LiveOutputResourceState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** The Live Output. */ +@JsonFlatten +@Fluent +public class LiveOutputInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveOutputInner.class); + + /* + * The description of the live output. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The asset that the live output will write to. + */ + @JsonProperty(value = "properties.assetName") + private String assetName; + + /* + * ISO 8601 time between 1 minute to 25 hours to indicate the maximum + * content length that can be archived in the asset for this live output. + * This also sets the maximum content length for the rewind window. For + * example, use PT1H30M to indicate 1 hour and 30 minutes of archive + * window. + */ + @JsonProperty(value = "properties.archiveWindowLength") + private Duration archiveWindowLength; + + /* + * The manifest file name. If not provided, the service will generate one + * automatically. + */ + @JsonProperty(value = "properties.manifestName") + private String manifestName; + + /* + * HTTP Live Streaming (HLS) packing setting for the live output. + */ + @JsonProperty(value = "properties.hls") + private Hls hls; + + /* + * The initial timestamp that the live output will start at, any content + * before this value will not be archived. + */ + @JsonProperty(value = "properties.outputSnapTime") + private Long outputSnapTime; + + /* + * The creation time the live output. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime created; + + /* + * The time the live output was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private LiveOutputResourceState resourceState; + + /** + * Get the description property: The description of the live output. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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 assetName property: The asset that the live output will write to. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: The asset that the live output will write to. + * + * @param assetName the assetName value to set. + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withAssetName(String assetName) { + this.assetName = assetName; + return this; + } + + /** + * Get the archiveWindowLength property: ISO 8601 time between 1 minute to 25 hours to indicate the maximum content + * length that can be archived in the asset for this live output. This also sets the maximum content length for the + * rewind window. For example, use PT1H30M to indicate 1 hour and 30 minutes of archive window. + * + * @return the archiveWindowLength value. + */ + public Duration archiveWindowLength() { + return this.archiveWindowLength; + } + + /** + * Set the archiveWindowLength property: ISO 8601 time between 1 minute to 25 hours to indicate the maximum content + * length that can be archived in the asset for this live output. This also sets the maximum content length for the + * rewind window. For example, use PT1H30M to indicate 1 hour and 30 minutes of archive window. + * + * @param archiveWindowLength the archiveWindowLength value to set. + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withArchiveWindowLength(Duration archiveWindowLength) { + this.archiveWindowLength = archiveWindowLength; + return this; + } + + /** + * Get the manifestName property: 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 manifestName property: 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 property: HTTP Live Streaming (HLS) packing setting for the live output. + * + * @return the hls value. + */ + public Hls hls() { + return this.hls; + } + + /** + * Set the hls property: HTTP Live Streaming (HLS) packing setting for the live output. + * + * @param hls the hls value to set. + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withHls(Hls hls) { + this.hls = hls; + return this; + } + + /** + * Get the outputSnapTime property: The initial timestamp that the live output will start at, any content before + * this value will not be archived. + * + * @return the outputSnapTime value. + */ + public Long outputSnapTime() { + return this.outputSnapTime; + } + + /** + * Set the outputSnapTime property: The initial timestamp that the live output will start at, any content before + * this value will not be archived. + * + * @param outputSnapTime the outputSnapTime value to set. + * @return the LiveOutputInner object itself. + */ + public LiveOutputInner withOutputSnapTime(Long outputSnapTime) { + this.outputSnapTime = outputSnapTime; + return this; + } + + /** + * Get the created property: The creation time the live output. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the lastModified property: The time the live output was last modified. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the provisioningState property: The provisioning state of the live output. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: The resource state of the live output. + * + * @return the resourceState value. + */ + public LiveOutputResourceState resourceState() { + return this.resourceState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hls() != null) { + hls().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/MediaServiceInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/MediaServiceInner.java new file mode 100644 index 000000000000..4c4e87b38633 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/MediaServiceInner.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.AccountEncryption; +import com.azure.resourcemanager.mediaservices.models.MediaServiceIdentity; +import com.azure.resourcemanager.mediaservices.models.StorageAccount; +import com.azure.resourcemanager.mediaservices.models.StorageAuthentication; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** A Media Services account. */ +@JsonFlatten +@Fluent +public class MediaServiceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MediaServiceInner.class); + + /* + * The Managed Identity for the Media Services account. + */ + @JsonProperty(value = "identity") + private MediaServiceIdentity identity; + + /* + * 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; + + /* + * The storageAuthentication property. + */ + @JsonProperty(value = "properties.storageAuthentication") + private StorageAuthentication storageAuthentication; + + /* + * The account encryption properties. + */ + @JsonProperty(value = "properties.encryption") + private AccountEncryption encryption; + + /** + * Get the identity property: The Managed Identity for the Media Services account. + * + * @return the identity value. + */ + public MediaServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The Managed Identity for the Media Services account. + * + * @param identity the identity value to set. + * @return the MediaServiceInner object itself. + */ + public MediaServiceInner withIdentity(MediaServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the mediaServiceId property: The Media Services account ID. + * + * @return the mediaServiceId value. + */ + public UUID mediaServiceId() { + return this.mediaServiceId; + } + + /** + * Get the storageAccounts property: The storage accounts for this resource. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storageAccounts property: The storage accounts for this resource. + * + * @param storageAccounts the storageAccounts value to set. + * @return the MediaServiceInner object itself. + */ + public MediaServiceInner withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + + /** + * Get the storageAuthentication property: The storageAuthentication property. + * + * @return the storageAuthentication value. + */ + public StorageAuthentication storageAuthentication() { + return this.storageAuthentication; + } + + /** + * Set the storageAuthentication property: The storageAuthentication property. + * + * @param storageAuthentication the storageAuthentication value to set. + * @return the MediaServiceInner object itself. + */ + public MediaServiceInner withStorageAuthentication(StorageAuthentication storageAuthentication) { + this.storageAuthentication = storageAuthentication; + return this; + } + + /** + * Get the encryption property: The account encryption properties. + * + * @return the encryption value. + */ + public AccountEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The account encryption properties. + * + * @param encryption the encryption value to set. + * @return the MediaServiceInner object itself. + */ + public MediaServiceInner withEncryption(AccountEncryption encryption) { + this.encryption = encryption; + return this; + } + + /** {@inheritDoc} */ + @Override + public MediaServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MediaServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (storageAccounts() != null) { + storageAccounts().forEach(e -> e.validate()); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/OperationInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/OperationInner.java new file mode 100644 index 000000000000..89bcea6ac02f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/OperationInner.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.OperationDisplay; +import com.azure.resourcemanager.mediaservices.models.Properties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * 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 Properties properties; + + /** + * Get the name property: The operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 display property: The operation display name. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: 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 the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: 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 the properties property: Operation properties format. + * + * @return the properties value. + */ + public Properties properties() { + return this.properties; + } + + /** + * Set the properties property: Operation properties format. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Properties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model OperationInner")); + } + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateEndpointConnectionInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..68ba355b5d53 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpoint; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.mediaservices.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint Connection resource. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The resource of private end point. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateEndpointConnectionListResultInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateEndpointConnectionListResultInner.java new file mode 100644 index 000000000000..b6c10dcf66fc --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateEndpointConnectionListResultInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connection associated with the specified storage account. */ +@Fluent +public final class PrivateEndpointConnectionListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResultInner.class); + + /* + * Array of private endpoint connections + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResultInner object itself. + */ + public PrivateEndpointConnectionListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateLinkResourceInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..b4eb20d28ea3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@JsonFlatten +@Fluent +public class PrivateLinkResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 000000000000..304fe4613560 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResultInner.class); + + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StorageEncryptedAssetDecryptionDataInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StorageEncryptedAssetDecryptionDataInner.java new file mode 100644 index 000000000000..a7d0d083195a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StorageEncryptedAssetDecryptionDataInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.AssetFileEncryptionMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data needed to decrypt asset files encrypted with legacy storage encryption. */ +@Fluent +public final class StorageEncryptedAssetDecryptionDataInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageEncryptedAssetDecryptionDataInner.class); + + /* + * The Asset File storage encryption key. + */ + @JsonProperty(value = "key") + private byte[] key; + + /* + * Asset File encryption metadata. + */ + @JsonProperty(value = "assetFileEncryptionMetadata") + private List assetFileEncryptionMetadata; + + /** + * Get the key property: The Asset File storage encryption key. + * + * @return the key value. + */ + public byte[] key() { + return CoreUtils.clone(this.key); + } + + /** + * Set the key property: 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 = CoreUtils.clone(key); + return this; + } + + /** + * Get the assetFileEncryptionMetadata property: Asset File encryption metadata. + * + * @return the assetFileEncryptionMetadata value. + */ + public List assetFileEncryptionMetadata() { + return this.assetFileEncryptionMetadata; + } + + /** + * Set the assetFileEncryptionMetadata property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (assetFileEncryptionMetadata() != null) { + assetFileEncryptionMetadata().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingEndpointInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingEndpointInner.java new file mode 100644 index 000000000000..889963f9e44b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingEndpointInner.java @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.CrossSiteAccessPolicies; +import com.azure.resourcemanager.mediaservices.models.StreamingEndpointAccessControl; +import com.azure.resourcemanager.mediaservices.models.StreamingEndpointResourceState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The streaming endpoint. */ +@JsonFlatten +@Fluent +public class StreamingEndpointInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingEndpointInner.class); + + /* + * The streaming endpoint 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") + private Integer scaleUnits; + + /* + * This feature is deprecated, do not set a value for this property. + */ + @JsonProperty(value = "properties.availabilitySetName") + private String availabilitySetName; + + /* + * The access control definition of the streaming endpoint. + */ + @JsonProperty(value = "properties.accessControl") + private StreamingEndpointAccessControl accessControl; + + /* + * Max cache age + */ + @JsonProperty(value = "properties.maxCacheAge") + private Long maxCacheAge; + + /* + * The custom host names of the streaming endpoint + */ + @JsonProperty(value = "properties.customHostNames") + private List customHostNames; + + /* + * The streaming endpoint 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 streaming endpoint. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The resource state of the streaming endpoint. + */ + @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) + private StreamingEndpointResourceState resourceState; + + /* + * The streaming endpoint access policies. + */ + @JsonProperty(value = "properties.crossSiteAccessPolicies") + private CrossSiteAccessPolicies crossSiteAccessPolicies; + + /* + * The free trial expiration time. + */ + @JsonProperty(value = "properties.freeTrialEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime freeTrialEndTime; + + /* + * The exact time the streaming endpoint was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime created; + + /* + * The exact time the streaming endpoint was last modified. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModified; + + /** + * Get the description property: The streaming endpoint description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The streaming endpoint 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 scaleUnits property: The number of scale units. Use the Scale operation to adjust this value. + * + * @return the scaleUnits value. + */ + public Integer scaleUnits() { + return this.scaleUnits; + } + + /** + * Set the scaleUnits property: 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(Integer scaleUnits) { + this.scaleUnits = scaleUnits; + return this; + } + + /** + * Get the availabilitySetName property: This feature is deprecated, do not set a value for this property. + * + * @return the availabilitySetName value. + */ + public String availabilitySetName() { + return this.availabilitySetName; + } + + /** + * Set the availabilitySetName property: This feature is deprecated, do not set a value for this property. + * + * @param availabilitySetName the availabilitySetName value to set. + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withAvailabilitySetName(String availabilitySetName) { + this.availabilitySetName = availabilitySetName; + return this; + } + + /** + * Get the accessControl property: The access control definition of the streaming endpoint. + * + * @return the accessControl value. + */ + public StreamingEndpointAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the accessControl property: The access control definition of the streaming endpoint. + * + * @param accessControl the accessControl value to set. + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withAccessControl(StreamingEndpointAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get the maxCacheAge property: Max cache age. + * + * @return the maxCacheAge value. + */ + public Long maxCacheAge() { + return this.maxCacheAge; + } + + /** + * Set the maxCacheAge property: 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 customHostNames property: The custom host names of the streaming endpoint. + * + * @return the customHostNames value. + */ + public List customHostNames() { + return this.customHostNames; + } + + /** + * Set the customHostNames property: The custom host names of the streaming endpoint. + * + * @param customHostNames the customHostNames value to set. + * @return the StreamingEndpointInner object itself. + */ + public StreamingEndpointInner withCustomHostNames(List customHostNames) { + this.customHostNames = customHostNames; + return this; + } + + /** + * Get the hostname property: The streaming endpoint host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the cdnEnabled property: The CDN enabled flag. + * + * @return the cdnEnabled value. + */ + public Boolean cdnEnabled() { + return this.cdnEnabled; + } + + /** + * Set the cdnEnabled property: 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 cdnProvider property: The CDN provider name. + * + * @return the cdnProvider value. + */ + public String cdnProvider() { + return this.cdnProvider; + } + + /** + * Set the cdnProvider property: 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 cdnProfile property: The CDN profile name. + * + * @return the cdnProfile value. + */ + public String cdnProfile() { + return this.cdnProfile; + } + + /** + * Set the cdnProfile property: 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 provisioningState property: The provisioning state of the streaming endpoint. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: The resource state of the streaming endpoint. + * + * @return the resourceState value. + */ + public StreamingEndpointResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the crossSiteAccessPolicies property: The streaming endpoint access policies. + * + * @return the crossSiteAccessPolicies value. + */ + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.crossSiteAccessPolicies; + } + + /** + * Set the crossSiteAccessPolicies property: The streaming endpoint 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 freeTrialEndTime property: The free trial expiration time. + * + * @return the freeTrialEndTime value. + */ + public OffsetDateTime freeTrialEndTime() { + return this.freeTrialEndTime; + } + + /** + * Get the created property: The exact time the streaming endpoint was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the lastModified property: The exact time the streaming endpoint was last modified. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** {@inheritDoc} */ + @Override + public StreamingEndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public StreamingEndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessControl() != null) { + accessControl().validate(); + } + if (crossSiteAccessPolicies() != null) { + crossSiteAccessPolicies().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingLocatorInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingLocatorInner.java new file mode 100644 index 000000000000..8ff8841ef760 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingLocatorInner.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.StreamingLocatorContentKey; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** A Streaming Locator resource. */ +@JsonFlatten +@Fluent +public class StreamingLocatorInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingLocatorInner.class); + + /* + * Asset Name + */ + @JsonProperty(value = "properties.assetName") + private String assetName; + + /* + * The creation time of the Streaming Locator. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime created; + + /* + * The start time of the Streaming Locator. + */ + @JsonProperty(value = "properties.startTime") + private OffsetDateTime startTime; + + /* + * The end time of the Streaming Locator. + */ + @JsonProperty(value = "properties.endTime") + private OffsetDateTime 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") + 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; + + /* + * A list of asset or account filters which apply to this streaming locator + */ + @JsonProperty(value = "properties.filters") + private List filters; + + /** + * Get the assetName property: Asset Name. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: 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 created property: The creation time of the Streaming Locator. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the startTime property: The start time of the Streaming Locator. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the Streaming Locator. + * + * @param startTime the startTime value to set. + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the Streaming Locator. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the Streaming Locator. + * + * @param endTime the endTime value to set. + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the streamingLocatorId property: The StreamingLocatorId of the Streaming Locator. + * + * @return the streamingLocatorId value. + */ + public UUID streamingLocatorId() { + return this.streamingLocatorId; + } + + /** + * Set the streamingLocatorId property: 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 the streamingPolicyName property: 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 the streamingPolicyName property: 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 the defaultContentKeyPolicyName property: Name of the default ContentKeyPolicy used by this Streaming + * Locator. + * + * @return the defaultContentKeyPolicyName value. + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + + /** + * Set the defaultContentKeyPolicyName property: 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 property: The ContentKeys used by this Streaming Locator. + * + * @return the contentKeys value. + */ + public List contentKeys() { + return this.contentKeys; + } + + /** + * Set the contentKeys property: 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 the alternativeMediaId property: Alternative Media ID of this Streaming Locator. + * + * @return the alternativeMediaId value. + */ + public String alternativeMediaId() { + return this.alternativeMediaId; + } + + /** + * Set the alternativeMediaId property: 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; + } + + /** + * Get the filters property: A list of asset or account filters which apply to this streaming locator. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: A list of asset or account filters which apply to this streaming locator. + * + * @param filters the filters value to set. + * @return the StreamingLocatorInner object itself. + */ + public StreamingLocatorInner withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentKeys() != null) { + contentKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingPolicyInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingPolicyInner.java new file mode 100644 index 000000000000..c08cb610ba66 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingPolicyInner.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.CommonEncryptionCbcs; +import com.azure.resourcemanager.mediaservices.models.CommonEncryptionCenc; +import com.azure.resourcemanager.mediaservices.models.EnvelopeEncryption; +import com.azure.resourcemanager.mediaservices.models.NoEncryption; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A Streaming Policy resource. */ +@JsonFlatten +@Fluent +public class StreamingPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingPolicyInner.class); + + /* + * Creation time of Streaming Policy + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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 the created property: Creation time of Streaming Policy. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the defaultContentKeyPolicyName property: Default ContentKey used by current Streaming Policy. + * + * @return the defaultContentKeyPolicyName value. + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + + /** + * Set the defaultContentKeyPolicyName property: 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 the envelopeEncryption property: Configuration of EnvelopeEncryption. + * + * @return the envelopeEncryption value. + */ + public EnvelopeEncryption envelopeEncryption() { + return this.envelopeEncryption; + } + + /** + * Set the envelopeEncryption property: 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 the commonEncryptionCenc property: Configuration of CommonEncryptionCenc. + * + * @return the commonEncryptionCenc value. + */ + public CommonEncryptionCenc commonEncryptionCenc() { + return this.commonEncryptionCenc; + } + + /** + * Set the commonEncryptionCenc property: 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 the commonEncryptionCbcs property: Configuration of CommonEncryptionCbcs. + * + * @return the commonEncryptionCbcs value. + */ + public CommonEncryptionCbcs commonEncryptionCbcs() { + return this.commonEncryptionCbcs; + } + + /** + * Set the commonEncryptionCbcs property: 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 the noEncryption property: Configurations of NoEncryption. + * + * @return the noEncryption value. + */ + public NoEncryption noEncryption() { + return this.noEncryption; + } + + /** + * Set the noEncryption property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (envelopeEncryption() != null) { + envelopeEncryption().validate(); + } + if (commonEncryptionCenc() != null) { + commonEncryptionCenc().validate(); + } + if (commonEncryptionCbcs() != null) { + commonEncryptionCbcs().validate(); + } + if (noEncryption() != null) { + noEncryption().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/TransformInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/TransformInner.java new file mode 100644 index 000000000000..e317807d4d50 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/TransformInner.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.TransformOutput; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * 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 +@Fluent +public class TransformInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransformInner.class); + + /* + * 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 OffsetDateTime 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 OffsetDateTime lastModified; + + /* + * An array of one or more TransformOutputs that the Transform should + * generate. + */ + @JsonProperty(value = "properties.outputs") + private List outputs; + + /** + * Get the created property: The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the description property: An optional verbose description of the Transform. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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 lastModified property: The UTC date and time when the Transform was last updated, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the outputs property: An array of one or more TransformOutputs that the Transform should generate. + * + * @return the outputs value. + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (outputs() != null) { + outputs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/package-info.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/package-info.java new file mode 100644 index 000000000000..fc6d5e542c09 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for AzureMediaServices. This Swagger was generated by the API Framework. */ +package com.azure.resourcemanager.mediaservices.fluent.models; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/package-info.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/package-info.java new file mode 100644 index 000000000000..ee94897cffaa --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for AzureMediaServices. This Swagger was generated by the API Framework. */ +package com.azure.resourcemanager.mediaservices.fluent; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFilterImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFilterImpl.java new file mode 100644 index 000000000000..f3ee7d5391ab --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFilterImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner; +import com.azure.resourcemanager.mediaservices.models.AccountFilter; +import com.azure.resourcemanager.mediaservices.models.FilterTrackSelection; +import com.azure.resourcemanager.mediaservices.models.FirstQuality; +import com.azure.resourcemanager.mediaservices.models.PresentationTimeRange; +import java.util.Collections; +import java.util.List; + +public final class AccountFilterImpl implements AccountFilter, AccountFilter.Definition, AccountFilter.Update { + private AccountFilterInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PresentationTimeRange presentationTimeRange() { + return this.innerModel().presentationTimeRange(); + } + + public FirstQuality firstQuality() { + return this.innerModel().firstQuality(); + } + + public List tracks() { + List inner = this.innerModel().tracks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AccountFilterInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String filterName; + + public AccountFilterImpl withExistingMediaService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public AccountFilter create() { + this.innerObject = + serviceManager + .serviceClient() + .getAccountFilters() + .createOrUpdateWithResponse(resourceGroupName, accountName, filterName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AccountFilter create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccountFilters() + .createOrUpdateWithResponse(resourceGroupName, accountName, filterName, this.innerModel(), context) + .getValue(); + return this; + } + + public AccountFilterImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new AccountFilterInner(); + this.serviceManager = serviceManager; + this.filterName = name; + } + + public AccountFilterImpl update() { + return this; + } + + public AccountFilter apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAccountFilters() + .updateWithResponse(resourceGroupName, accountName, filterName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AccountFilter apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccountFilters() + .updateWithResponse(resourceGroupName, accountName, filterName, this.innerModel(), context) + .getValue(); + return this; + } + + public AccountFilterImpl(AccountFilterInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaServices"); + this.filterName = Utils.getValueFromIdByName(innerObject.id(), "accountFilters"); + } + + public AccountFilter refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAccountFilters() + .getWithResponse(resourceGroupName, accountName, filterName, Context.NONE) + .getValue(); + return this; + } + + public AccountFilter refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccountFilters() + .getWithResponse(resourceGroupName, accountName, filterName, context) + .getValue(); + return this; + } + + public AccountFilterImpl withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.innerModel().withPresentationTimeRange(presentationTimeRange); + return this; + } + + public AccountFilterImpl withFirstQuality(FirstQuality firstQuality) { + this.innerModel().withFirstQuality(firstQuality); + return this; + } + + public AccountFilterImpl withTracks(List tracks) { + this.innerModel().withTracks(tracks); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersClientImpl.java new file mode 100644 index 000000000000..57536a7bedcb --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersClientImpl.java @@ -0,0 +1,1098 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.AccountFiltersClient; +import com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner; +import com.azure.resourcemanager.mediaservices.models.AccountFilterCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccountFiltersClient. */ +public final class AccountFiltersClientImpl implements AccountFiltersClient { + private final ClientLogger logger = new ClientLogger(AccountFiltersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AccountFiltersService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of AccountFiltersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountFiltersClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(AccountFiltersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesAccountFilters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesAc") + private interface AccountFiltersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/accountFilters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/accountFilters/{filterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("filterName") String filterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/accountFilters/{filterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("filterName") String filterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccountFilterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/accountFilters/{filterName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("filterName") String filterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/accountFilters/{filterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("filterName") String filterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccountFilterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String filterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String filterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String filterName) { + return getWithResponseAsync(resourceGroupName, accountName, filterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountFilterInner get(String resourceGroupName, String accountName, String filterName) { + return getAsync(resourceGroupName, accountName, filterName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String filterName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, filterName, context).block(); + } + + /** + * 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 An Account Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 An Account Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String filterName, + AccountFilterInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 An Account Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, filterName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 An Account Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountFilterInner createOrUpdate( + String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return createOrUpdateAsync(resourceGroupName, accountName, filterName, parameters).block(); + } + + /** + * 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 An Account Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String filterName, + AccountFilterInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, filterName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String filterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String filterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String filterName) { + return deleteWithResponseAsync(resourceGroupName, accountName, filterName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String filterName) { + deleteAsync(resourceGroupName, accountName, filterName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String filterName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, filterName, context).block(); + } + + /** + * 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 An Account Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 An Account Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String filterName, + AccountFilterInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 An Account Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, filterName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 An Account Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountFilterInner update( + String resourceGroupName, String accountName, String filterName, AccountFilterInner parameters) { + return updateAsync(resourceGroupName, accountName, filterName, parameters).block(); + } + + /** + * 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 An Account Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Account Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String filterName, + AccountFilterInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, filterName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersImpl.java new file mode 100644 index 000000000000..a95ae733191c --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.AccountFiltersClient; +import com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner; +import com.azure.resourcemanager.mediaservices.models.AccountFilter; +import com.azure.resourcemanager.mediaservices.models.AccountFilters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AccountFiltersImpl implements AccountFilters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountFiltersImpl.class); + + private final AccountFiltersClient innerClient; + + private final MediaservicesManager serviceManager; + + public AccountFiltersImpl(AccountFiltersClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new AccountFilterImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return inner.mapPage(inner1 -> new AccountFilterImpl(inner1, this.manager())); + } + + public AccountFilter get(String resourceGroupName, String accountName, String filterName) { + AccountFilterInner inner = this.serviceClient().get(resourceGroupName, accountName, filterName); + if (inner != null) { + return new AccountFilterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String filterName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, filterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccountFilterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String filterName) { + this.serviceClient().delete(resourceGroupName, accountName, filterName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String filterName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, filterName, context); + } + + public AccountFilter getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String filterName = Utils.getValueFromIdByName(id, "accountFilters"); + if (filterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'accountFilters'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, filterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String filterName = Utils.getValueFromIdByName(id, "accountFilters"); + if (filterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'accountFilters'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, filterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String filterName = Utils.getValueFromIdByName(id, "accountFilters"); + if (filterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'accountFilters'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, filterName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String filterName = Utils.getValueFromIdByName(id, "accountFilters"); + if (filterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'accountFilters'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, filterName, context); + } + + private AccountFiltersClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public AccountFilterImpl define(String name) { + return new AccountFilterImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetContainerSasImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetContainerSasImpl.java new file mode 100644 index 000000000000..d4bed291699b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetContainerSasImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetContainerSasInner; +import com.azure.resourcemanager.mediaservices.models.AssetContainerSas; +import java.util.Collections; +import java.util.List; + +public final class AssetContainerSasImpl implements AssetContainerSas { + private AssetContainerSasInner innerObject; + + private final MediaservicesManager serviceManager; + + public AssetContainerSasImpl(AssetContainerSasInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List assetContainerSasUrls() { + List inner = this.innerModel().assetContainerSasUrls(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AssetContainerSasInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFilterImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFilterImpl.java new file mode 100644 index 000000000000..8e19fcc688bb --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFilterImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner; +import com.azure.resourcemanager.mediaservices.models.AssetFilter; +import com.azure.resourcemanager.mediaservices.models.FilterTrackSelection; +import com.azure.resourcemanager.mediaservices.models.FirstQuality; +import com.azure.resourcemanager.mediaservices.models.PresentationTimeRange; +import java.util.Collections; +import java.util.List; + +public final class AssetFilterImpl implements AssetFilter, AssetFilter.Definition, AssetFilter.Update { + private AssetFilterInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PresentationTimeRange presentationTimeRange() { + return this.innerModel().presentationTimeRange(); + } + + public FirstQuality firstQuality() { + return this.innerModel().firstQuality(); + } + + public List tracks() { + List inner = this.innerModel().tracks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AssetFilterInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String assetName; + + private String filterName; + + public AssetFilterImpl withExistingAsset(String resourceGroupName, String accountName, String assetName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.assetName = assetName; + return this; + } + + public AssetFilter create() { + this.innerObject = + serviceManager + .serviceClient() + .getAssetFilters() + .createOrUpdateWithResponse( + resourceGroupName, accountName, assetName, filterName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AssetFilter create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAssetFilters() + .createOrUpdateWithResponse( + resourceGroupName, accountName, assetName, filterName, this.innerModel(), context) + .getValue(); + return this; + } + + public AssetFilterImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new AssetFilterInner(); + this.serviceManager = serviceManager; + this.filterName = name; + } + + public AssetFilterImpl update() { + return this; + } + + public AssetFilter apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAssetFilters() + .updateWithResponse( + resourceGroupName, accountName, assetName, filterName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AssetFilter apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAssetFilters() + .updateWithResponse(resourceGroupName, accountName, assetName, filterName, this.innerModel(), context) + .getValue(); + return this; + } + + public AssetFilterImpl(AssetFilterInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaServices"); + this.assetName = Utils.getValueFromIdByName(innerObject.id(), "assets"); + this.filterName = Utils.getValueFromIdByName(innerObject.id(), "assetFilters"); + } + + public AssetFilter refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAssetFilters() + .getWithResponse(resourceGroupName, accountName, assetName, filterName, Context.NONE) + .getValue(); + return this; + } + + public AssetFilter refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAssetFilters() + .getWithResponse(resourceGroupName, accountName, assetName, filterName, context) + .getValue(); + return this; + } + + public AssetFilterImpl withPresentationTimeRange(PresentationTimeRange presentationTimeRange) { + this.innerModel().withPresentationTimeRange(presentationTimeRange); + return this; + } + + public AssetFilterImpl withFirstQuality(FirstQuality firstQuality) { + this.innerModel().withFirstQuality(firstQuality); + return this; + } + + public AssetFilterImpl withTracks(List tracks) { + this.innerModel().withTracks(tracks); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersClientImpl.java new file mode 100644 index 000000000000..284732c38680 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersClientImpl.java @@ -0,0 +1,1205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.AssetFiltersClient; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner; +import com.azure.resourcemanager.mediaservices.models.AssetFilterCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AssetFiltersClient. */ +public final class AssetFiltersClientImpl implements AssetFiltersClient { + private final ClientLogger logger = new ClientLogger(AssetFiltersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AssetFiltersService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of AssetFiltersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssetFiltersClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(AssetFiltersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesAssetFilters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesAs") + private interface AssetFiltersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}/assetFilters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}/assetFilters/{filterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @PathParam("filterName") String filterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}/assetFilters/{filterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @PathParam("filterName") String filterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AssetFilterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}/assetFilters/{filterName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @PathParam("filterName") String filterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}/assetFilters/{filterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @PathParam("filterName") String filterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AssetFilterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String assetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String assetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String assetName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, assetName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String assetName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, assetName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String assetName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, assetName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String assetName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, assetName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String assetName, String filterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + filterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String assetName, String filterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + filterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String assetName, String filterName) { + return getWithResponseAsync(resourceGroupName, accountName, assetName, filterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssetFilterInner get(String resourceGroupName, String accountName, String assetName, String filterName) { + return getAsync(resourceGroupName, accountName, assetName, filterName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String assetName, String filterName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, assetName, filterName, context).block(); + } + + /** + * 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 An Asset Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + filterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 An Asset Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + filterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 An Asset Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 An Asset Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssetFilterInner createOrUpdate( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters) { + return createOrUpdateAsync(resourceGroupName, accountName, assetName, filterName, parameters).block(); + } + + /** + * 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 An Asset Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, assetName, filterName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String assetName, String filterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + filterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String assetName, String filterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + filterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String assetName, String filterName) { + return deleteWithResponseAsync(resourceGroupName, accountName, assetName, filterName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String assetName, String filterName) { + deleteAsync(resourceGroupName, accountName, assetName, filterName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String assetName, String filterName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, assetName, filterName, context).block(); + } + + /** + * 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 An Asset Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + filterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 An Asset Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (filterName == null) { + return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + filterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 An Asset Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 An Asset Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssetFilterInner update( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters) { + return updateAsync(resourceGroupName, accountName, assetName, filterName, parameters).block(); + } + + /** + * 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 An Asset Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset Filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String assetName, + String filterName, + AssetFilterInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, assetName, filterName, parameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersImpl.java new file mode 100644 index 000000000000..5ac9c832cadc --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersImpl.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.AssetFiltersClient; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner; +import com.azure.resourcemanager.mediaservices.models.AssetFilter; +import com.azure.resourcemanager.mediaservices.models.AssetFilters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AssetFiltersImpl implements AssetFilters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssetFiltersImpl.class); + + private final AssetFiltersClient innerClient; + + private final MediaservicesManager serviceManager; + + public AssetFiltersImpl(AssetFiltersClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName, String assetName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, assetName); + return inner.mapPage(inner1 -> new AssetFilterImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String assetName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, assetName, context); + return inner.mapPage(inner1 -> new AssetFilterImpl(inner1, this.manager())); + } + + public AssetFilter get(String resourceGroupName, String accountName, String assetName, String filterName) { + AssetFilterInner inner = this.serviceClient().get(resourceGroupName, accountName, assetName, filterName); + if (inner != null) { + return new AssetFilterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String assetName, String filterName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, assetName, filterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AssetFilterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String assetName, String filterName) { + this.serviceClient().delete(resourceGroupName, accountName, assetName, filterName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String assetName, String filterName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, assetName, filterName, context); + } + + public AssetFilter getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String assetName = Utils.getValueFromIdByName(id, "assets"); + if (assetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assets'.", id))); + } + String filterName = Utils.getValueFromIdByName(id, "assetFilters"); + if (filterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assetFilters'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, assetName, filterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String assetName = Utils.getValueFromIdByName(id, "assets"); + if (assetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assets'.", id))); + } + String filterName = Utils.getValueFromIdByName(id, "assetFilters"); + if (filterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assetFilters'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, assetName, filterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String assetName = Utils.getValueFromIdByName(id, "assets"); + if (assetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assets'.", id))); + } + String filterName = Utils.getValueFromIdByName(id, "assetFilters"); + if (filterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assetFilters'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, assetName, filterName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String assetName = Utils.getValueFromIdByName(id, "assets"); + if (assetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assets'.", id))); + } + String filterName = Utils.getValueFromIdByName(id, "assetFilters"); + if (filterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assetFilters'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, assetName, filterName, context); + } + + private AssetFiltersClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public AssetFilterImpl define(String name) { + return new AssetFilterImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetImpl.java new file mode 100644 index 000000000000..7752bbba3391 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetInner; +import com.azure.resourcemanager.mediaservices.models.Asset; +import com.azure.resourcemanager.mediaservices.models.AssetStorageEncryptionFormat; +import java.time.OffsetDateTime; +import java.util.UUID; + +public final class AssetImpl implements Asset, Asset.Definition, Asset.Update { + private AssetInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public UUID assetId() { + return this.innerModel().assetId(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public String alternateId() { + return this.innerModel().alternateId(); + } + + public String description() { + return this.innerModel().description(); + } + + public String container() { + return this.innerModel().container(); + } + + public String storageAccountName() { + return this.innerModel().storageAccountName(); + } + + public AssetStorageEncryptionFormat storageEncryptionFormat() { + return this.innerModel().storageEncryptionFormat(); + } + + public AssetInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String assetName; + + public AssetImpl withExistingMediaService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public Asset create() { + this.innerObject = + serviceManager + .serviceClient() + .getAssets() + .createOrUpdateWithResponse(resourceGroupName, accountName, assetName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Asset create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAssets() + .createOrUpdateWithResponse(resourceGroupName, accountName, assetName, this.innerModel(), context) + .getValue(); + return this; + } + + public AssetImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new AssetInner(); + this.serviceManager = serviceManager; + this.assetName = name; + } + + public AssetImpl update() { + return this; + } + + public Asset apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAssets() + .updateWithResponse(resourceGroupName, accountName, assetName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Asset apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAssets() + .updateWithResponse(resourceGroupName, accountName, assetName, this.innerModel(), context) + .getValue(); + return this; + } + + public AssetImpl(AssetInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaServices"); + this.assetName = Utils.getValueFromIdByName(innerObject.id(), "assets"); + } + + public Asset refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAssets() + .getWithResponse(resourceGroupName, accountName, assetName, Context.NONE) + .getValue(); + return this; + } + + public Asset refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAssets() + .getWithResponse(resourceGroupName, accountName, assetName, context) + .getValue(); + return this; + } + + public AssetImpl withAlternateId(String alternateId) { + this.innerModel().withAlternateId(alternateId); + return this; + } + + public AssetImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public AssetImpl withContainer(String container) { + this.innerModel().withContainer(container); + return this; + } + + public AssetImpl withStorageAccountName(String storageAccountName) { + this.innerModel().withStorageAccountName(storageAccountName); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsClientImpl.java new file mode 100644 index 000000000000..90ce184a7926 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsClientImpl.java @@ -0,0 +1,1714 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.AssetsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetContainerSasInner; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetInner; +import com.azure.resourcemanager.mediaservices.fluent.models.ListStreamingLocatorsResponseInner; +import com.azure.resourcemanager.mediaservices.fluent.models.StorageEncryptedAssetDecryptionDataInner; +import com.azure.resourcemanager.mediaservices.models.AssetCollection; +import com.azure.resourcemanager.mediaservices.models.ListContainerSasInput; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AssetsClient. */ +public final class AssetsClientImpl implements AssetsClient { + private final ClientLogger logger = new ClientLogger(AssetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AssetsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of AssetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssetsClientImpl(AzureMediaServicesImpl client) { + this.service = RestProxy.create(AssetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesAssets to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesAs") + private interface AssetsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AssetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AssetInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}/listContainerSas") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listContainerSas( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ListContainerSasInput parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}/getEncryptionKey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getEncryptionKey( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/assets/{assetName}/listStreamingLocators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listStreamingLocators( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("assetName") String assetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + top, + orderby, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + top, + orderby, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * 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 key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, top, orderby)); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, top, orderby, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String assetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String assetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String assetName) { + return getWithResponseAsync(resourceGroupName, accountName, assetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssetInner get(String resourceGroupName, String accountName, String assetName) { + return getAsync(resourceGroupName, accountName, assetName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String assetName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, assetName, context).block(); + } + + /** + * 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 An Asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 An Asset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String assetName, AssetInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 An Asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, assetName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 An Asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssetInner createOrUpdate( + String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return createOrUpdateAsync(resourceGroupName, accountName, assetName, parameters).block(); + } + + /** + * 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 An Asset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, String assetName, AssetInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, assetName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String assetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String assetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String assetName) { + return deleteWithResponseAsync(resourceGroupName, accountName, assetName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String assetName) { + deleteAsync(resourceGroupName, accountName, assetName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String assetName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, assetName, context).block(); + } + + /** + * 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 An Asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 An Asset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String assetName, AssetInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 An Asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, assetName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 An Asset. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssetInner update(String resourceGroupName, String accountName, String assetName, AssetInner parameters) { + return updateAsync(resourceGroupName, accountName, assetName, parameters).block(); + } + + /** + * 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 An Asset. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String accountName, String assetName, AssetInner parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, assetName, parameters, context).block(); + } + + /** + * 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 parameters to the list SAS request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset Storage container SAS URLs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listContainerSasWithResponseAsync( + String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listContainerSas( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 parameters to the list SAS request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset Storage container SAS URLs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listContainerSasWithResponseAsync( + String resourceGroupName, + String accountName, + String assetName, + ListContainerSasInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listContainerSas( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 parameters to the list SAS request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset Storage container SAS URLs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listContainerSasAsync( + String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + return listContainerSasWithResponseAsync(resourceGroupName, accountName, assetName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 parameters to the list SAS request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset Storage container SAS URLs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssetContainerSasInner listContainerSas( + String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + return listContainerSasAsync(resourceGroupName, accountName, assetName, parameters).block(); + } + + /** + * 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 parameters to the list SAS request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset Storage container SAS URLs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listContainerSasWithResponse( + String resourceGroupName, + String accountName, + String assetName, + ListContainerSasInput parameters, + Context context) { + return listContainerSasWithResponseAsync(resourceGroupName, accountName, assetName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEncryptionKeyWithResponseAsync( + String resourceGroupName, String accountName, String assetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEncryptionKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getEncryptionKeyWithResponseAsync( + String resourceGroupName, String accountName, String assetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEncryptionKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEncryptionKeyAsync( + String resourceGroupName, String accountName, String assetName) { + return getEncryptionKeyWithResponseAsync(resourceGroupName, accountName, assetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageEncryptedAssetDecryptionDataInner getEncryptionKey( + String resourceGroupName, String accountName, String assetName) { + return getEncryptionKeyAsync(resourceGroupName, accountName, assetName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEncryptionKeyWithResponse( + String resourceGroupName, String accountName, String assetName, Context context) { + return getEncryptionKeyWithResponseAsync(resourceGroupName, accountName, assetName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Streaming Locators associated with this Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listStreamingLocatorsWithResponseAsync( + String resourceGroupName, String accountName, String assetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listStreamingLocators( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Streaming Locators associated with this Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listStreamingLocatorsWithResponseAsync( + String resourceGroupName, String accountName, String assetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (assetName == null) { + return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listStreamingLocators( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + assetName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Streaming Locators associated with this Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listStreamingLocatorsAsync( + String resourceGroupName, String accountName, String assetName) { + return listStreamingLocatorsWithResponseAsync(resourceGroupName, accountName, assetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Streaming Locators associated with this Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListStreamingLocatorsResponseInner listStreamingLocators( + String resourceGroupName, String accountName, String assetName) { + return listStreamingLocatorsAsync(resourceGroupName, accountName, assetName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Streaming Locators associated with this Asset. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listStreamingLocatorsWithResponse( + String resourceGroupName, String accountName, String assetName, Context context) { + return listStreamingLocatorsWithResponseAsync(resourceGroupName, accountName, assetName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsImpl.java new file mode 100644 index 000000000000..d8b668eca4f8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsImpl.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.AssetsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetContainerSasInner; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetInner; +import com.azure.resourcemanager.mediaservices.fluent.models.ListStreamingLocatorsResponseInner; +import com.azure.resourcemanager.mediaservices.fluent.models.StorageEncryptedAssetDecryptionDataInner; +import com.azure.resourcemanager.mediaservices.models.Asset; +import com.azure.resourcemanager.mediaservices.models.AssetContainerSas; +import com.azure.resourcemanager.mediaservices.models.Assets; +import com.azure.resourcemanager.mediaservices.models.ListContainerSasInput; +import com.azure.resourcemanager.mediaservices.models.ListStreamingLocatorsResponse; +import com.azure.resourcemanager.mediaservices.models.StorageEncryptedAssetDecryptionData; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AssetsImpl implements Assets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssetsImpl.class); + + private final AssetsClient innerClient; + + private final MediaservicesManager serviceManager; + + public AssetsImpl(AssetsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new AssetImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, filter, top, orderby, context); + return inner.mapPage(inner1 -> new AssetImpl(inner1, this.manager())); + } + + public Asset get(String resourceGroupName, String accountName, String assetName) { + AssetInner inner = this.serviceClient().get(resourceGroupName, accountName, assetName); + if (inner != null) { + return new AssetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String assetName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, assetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AssetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String assetName) { + this.serviceClient().delete(resourceGroupName, accountName, assetName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String assetName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, assetName, context); + } + + public AssetContainerSas listContainerSas( + String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) { + AssetContainerSasInner inner = + this.serviceClient().listContainerSas(resourceGroupName, accountName, assetName, parameters); + if (inner != null) { + return new AssetContainerSasImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listContainerSasWithResponse( + String resourceGroupName, + String accountName, + String assetName, + ListContainerSasInput parameters, + Context context) { + Response inner = + this + .serviceClient() + .listContainerSasWithResponse(resourceGroupName, accountName, assetName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AssetContainerSasImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageEncryptedAssetDecryptionData getEncryptionKey( + String resourceGroupName, String accountName, String assetName) { + StorageEncryptedAssetDecryptionDataInner inner = + this.serviceClient().getEncryptionKey(resourceGroupName, accountName, assetName); + if (inner != null) { + return new StorageEncryptedAssetDecryptionDataImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getEncryptionKeyWithResponse( + String resourceGroupName, String accountName, String assetName, Context context) { + Response inner = + this.serviceClient().getEncryptionKeyWithResponse(resourceGroupName, accountName, assetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageEncryptedAssetDecryptionDataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListStreamingLocatorsResponse listStreamingLocators( + String resourceGroupName, String accountName, String assetName) { + ListStreamingLocatorsResponseInner inner = + this.serviceClient().listStreamingLocators(resourceGroupName, accountName, assetName); + if (inner != null) { + return new ListStreamingLocatorsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listStreamingLocatorsWithResponse( + String resourceGroupName, String accountName, String assetName, Context context) { + Response inner = + this.serviceClient().listStreamingLocatorsWithResponse(resourceGroupName, accountName, assetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ListStreamingLocatorsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Asset getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String assetName = Utils.getValueFromIdByName(id, "assets"); + if (assetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assets'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, assetName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String assetName = Utils.getValueFromIdByName(id, "assets"); + if (assetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assets'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, assetName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String assetName = Utils.getValueFromIdByName(id, "assets"); + if (assetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assets'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, assetName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String assetName = Utils.getValueFromIdByName(id, "assets"); + if (assetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assets'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, assetName, context); + } + + private AssetsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public AssetImpl define(String name) { + return new AssetImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesBuilder.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesBuilder.java new file mode 100644 index 000000000000..68129cf63d6a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the AzureMediaServicesImpl type. */ +@ServiceClientBuilder(serviceClients = {AzureMediaServicesImpl.class}) +public final class AzureMediaServicesBuilder { + /* + * The unique identifier for a Microsoft Azure subscription. + */ + private String subscriptionId; + + /** + * Sets The unique identifier for a Microsoft Azure subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AzureMediaServicesBuilder. + */ + public AzureMediaServicesBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AzureMediaServicesBuilder. + */ + public AzureMediaServicesBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the AzureMediaServicesBuilder. + */ + public AzureMediaServicesBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the AzureMediaServicesBuilder. + */ + public AzureMediaServicesBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureMediaServicesBuilder. + */ + public AzureMediaServicesBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the AzureMediaServicesBuilder. + */ + public AzureMediaServicesBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AzureMediaServicesImpl with the provided parameters. + * + * @return an instance of AzureMediaServicesImpl. + */ + public AzureMediaServicesImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + AzureMediaServicesImpl client = + new AzureMediaServicesImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesImpl.java new file mode 100644 index 000000000000..9ddb5d8f86ad --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesImpl.java @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.mediaservices.fluent.AccountFiltersClient; +import com.azure.resourcemanager.mediaservices.fluent.AssetFiltersClient; +import com.azure.resourcemanager.mediaservices.fluent.AssetsClient; +import com.azure.resourcemanager.mediaservices.fluent.AzureMediaServices; +import com.azure.resourcemanager.mediaservices.fluent.ContentKeyPoliciesClient; +import com.azure.resourcemanager.mediaservices.fluent.JobsClient; +import com.azure.resourcemanager.mediaservices.fluent.LiveEventsClient; +import com.azure.resourcemanager.mediaservices.fluent.LiveOutputsClient; +import com.azure.resourcemanager.mediaservices.fluent.LocationsClient; +import com.azure.resourcemanager.mediaservices.fluent.MediaservicesClient; +import com.azure.resourcemanager.mediaservices.fluent.OperationsClient; +import com.azure.resourcemanager.mediaservices.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.mediaservices.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.mediaservices.fluent.StreamingEndpointsClient; +import com.azure.resourcemanager.mediaservices.fluent.StreamingLocatorsClient; +import com.azure.resourcemanager.mediaservices.fluent.StreamingPoliciesClient; +import com.azure.resourcemanager.mediaservices.fluent.TransformsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the AzureMediaServicesImpl type. */ +@ServiceClient(builder = AzureMediaServicesBuilder.class) +public final class AzureMediaServicesImpl implements AzureMediaServices { + private final ClientLogger logger = new ClientLogger(AzureMediaServicesImpl.class); + + /** The unique identifier for a Microsoft Azure subscription. */ + private final String subscriptionId; + + /** + * Gets The unique identifier for a Microsoft Azure subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The AccountFiltersClient object to access its operations. */ + private final AccountFiltersClient accountFilters; + + /** + * Gets the AccountFiltersClient object to access its operations. + * + * @return the AccountFiltersClient object. + */ + public AccountFiltersClient getAccountFilters() { + return this.accountFilters; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The MediaservicesClient object to access its operations. */ + private final MediaservicesClient mediaservices; + + /** + * Gets the MediaservicesClient object to access its operations. + * + * @return the MediaservicesClient object. + */ + public MediaservicesClient getMediaservices() { + return this.mediaservices; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The LocationsClient object to access its operations. */ + private final LocationsClient locations; + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + public LocationsClient getLocations() { + return this.locations; + } + + /** The AssetsClient object to access its operations. */ + private final AssetsClient assets; + + /** + * Gets the AssetsClient object to access its operations. + * + * @return the AssetsClient object. + */ + public AssetsClient getAssets() { + return this.assets; + } + + /** The AssetFiltersClient object to access its operations. */ + private final AssetFiltersClient assetFilters; + + /** + * Gets the AssetFiltersClient object to access its operations. + * + * @return the AssetFiltersClient object. + */ + public AssetFiltersClient getAssetFilters() { + return this.assetFilters; + } + + /** The ContentKeyPoliciesClient object to access its operations. */ + private final ContentKeyPoliciesClient contentKeyPolicies; + + /** + * Gets the ContentKeyPoliciesClient object to access its operations. + * + * @return the ContentKeyPoliciesClient object. + */ + public ContentKeyPoliciesClient getContentKeyPolicies() { + return this.contentKeyPolicies; + } + + /** The TransformsClient object to access its operations. */ + private final TransformsClient transforms; + + /** + * Gets the TransformsClient object to access its operations. + * + * @return the TransformsClient object. + */ + public TransformsClient getTransforms() { + return this.transforms; + } + + /** The JobsClient object to access its operations. */ + private final JobsClient jobs; + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + public JobsClient getJobs() { + return this.jobs; + } + + /** The StreamingPoliciesClient object to access its operations. */ + private final StreamingPoliciesClient streamingPolicies; + + /** + * Gets the StreamingPoliciesClient object to access its operations. + * + * @return the StreamingPoliciesClient object. + */ + public StreamingPoliciesClient getStreamingPolicies() { + return this.streamingPolicies; + } + + /** The StreamingLocatorsClient object to access its operations. */ + private final StreamingLocatorsClient streamingLocators; + + /** + * Gets the StreamingLocatorsClient object to access its operations. + * + * @return the StreamingLocatorsClient object. + */ + public StreamingLocatorsClient getStreamingLocators() { + return this.streamingLocators; + } + + /** The LiveEventsClient object to access its operations. */ + private final LiveEventsClient liveEvents; + + /** + * Gets the LiveEventsClient object to access its operations. + * + * @return the LiveEventsClient object. + */ + public LiveEventsClient getLiveEvents() { + return this.liveEvents; + } + + /** The LiveOutputsClient object to access its operations. */ + private final LiveOutputsClient liveOutputs; + + /** + * Gets the LiveOutputsClient object to access its operations. + * + * @return the LiveOutputsClient object. + */ + public LiveOutputsClient getLiveOutputs() { + return this.liveOutputs; + } + + /** The StreamingEndpointsClient object to access its operations. */ + private final StreamingEndpointsClient streamingEndpoints; + + /** + * Gets the StreamingEndpointsClient object to access its operations. + * + * @return the StreamingEndpointsClient object. + */ + public StreamingEndpointsClient getStreamingEndpoints() { + return this.streamingEndpoints; + } + + /** + * Initializes an instance of AzureMediaServices client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The unique identifier for a Microsoft Azure subscription. + * @param endpoint server parameter. + */ + AzureMediaServicesImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-05-01"; + this.accountFilters = new AccountFiltersClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.mediaservices = new MediaservicesClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.locations = new LocationsClientImpl(this); + this.assets = new AssetsClientImpl(this); + this.assetFilters = new AssetFiltersClientImpl(this); + this.contentKeyPolicies = new ContentKeyPoliciesClientImpl(this); + this.transforms = new TransformsClientImpl(this); + this.jobs = new JobsClientImpl(this); + this.streamingPolicies = new StreamingPoliciesClientImpl(this); + this.streamingLocators = new StreamingLocatorsClientImpl(this); + this.liveEvents = new LiveEventsClientImpl(this); + this.liveOutputs = new LiveOutputsClientImpl(this); + this.streamingEndpoints = new StreamingEndpointsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesClientImpl.java new file mode 100644 index 000000000000..f5908d1785be --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesClientImpl.java @@ -0,0 +1,1353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.ContentKeyPoliciesClient; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyPropertiesInner; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContentKeyPoliciesClient. */ +public final class ContentKeyPoliciesClientImpl implements ContentKeyPoliciesClient { + private final ClientLogger logger = new ClientLogger(ContentKeyPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContentKeyPoliciesService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of ContentKeyPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentKeyPoliciesClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(ContentKeyPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesContentKeyPolicies to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesCo") + private interface ContentKeyPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/contentKeyPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("contentKeyPolicyName") String contentKeyPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("contentKeyPolicyName") String contentKeyPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContentKeyPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("contentKeyPolicyName") String contentKeyPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/contentKeyPolicies/{contentKeyPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("contentKeyPolicyName") String contentKeyPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContentKeyPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/contentKeyPolicies/{contentKeyPolicyName}/getPolicyPropertiesWithSecrets") + @ExpectedResponses({200, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPolicyPropertiesWithSecrets( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("contentKeyPolicyName") String contentKeyPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + top, + orderby, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + top, + orderby, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * 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 key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, top, orderby)); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, top, orderby, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, contentKeyPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContentKeyPolicyInner get(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getAsync(resourceGroupName, accountName, contentKeyPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, context).block(); + } + + /** + * 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 A Content Key Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 A Content Key Policy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String contentKeyPolicyName, + ContentKeyPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 A Content Key Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 A Content Key Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContentKeyPolicyInner createOrUpdate( + String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).block(); + } + + /** + * 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 A Content Key Policy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String contentKeyPolicyName, + ContentKeyPolicyInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, contentKeyPolicyName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, contentKeyPolicyName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String contentKeyPolicyName) { + deleteAsync(resourceGroupName, accountName, contentKeyPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, context).block(); + } + + /** + * 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 A Content Key Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 A Content Key Policy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String contentKeyPolicyName, + ContentKeyPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 A Content Key Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 A Content Key Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContentKeyPolicyInner update( + String resourceGroupName, String accountName, String contentKeyPolicyName, ContentKeyPolicyInner parameters) { + return updateAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters).block(); + } + + /** + * 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 A Content Key Policy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String contentKeyPolicyName, + ContentKeyPolicyInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, contentKeyPolicyName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy including secret values. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPolicyPropertiesWithSecretsWithResponseAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPolicyPropertiesWithSecrets( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy including secret values. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPolicyPropertiesWithSecretsWithResponseAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (contentKeyPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPolicyPropertiesWithSecrets( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + contentKeyPolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy including secret values. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPolicyPropertiesWithSecretsAsync( + String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getPolicyPropertiesWithSecretsWithResponseAsync(resourceGroupName, accountName, contentKeyPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy including secret values. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContentKeyPolicyPropertiesInner getPolicyPropertiesWithSecrets( + String resourceGroupName, String accountName, String contentKeyPolicyName) { + return getPolicyPropertiesWithSecretsAsync(resourceGroupName, accountName, contentKeyPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy including secret values. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPolicyPropertiesWithSecretsWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context) { + return getPolicyPropertiesWithSecretsWithResponseAsync( + resourceGroupName, accountName, contentKeyPolicyName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesImpl.java new file mode 100644 index 000000000000..22c6dced929d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.ContentKeyPoliciesClient; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyPropertiesInner; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicies; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicy; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContentKeyPoliciesImpl implements ContentKeyPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPoliciesImpl.class); + + private final ContentKeyPoliciesClient innerClient; + + private final MediaservicesManager serviceManager; + + public ContentKeyPoliciesImpl(ContentKeyPoliciesClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new ContentKeyPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, filter, top, orderby, context); + return inner.mapPage(inner1 -> new ContentKeyPolicyImpl(inner1, this.manager())); + } + + public ContentKeyPolicy get(String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPolicyInner inner = this.serviceClient().get(resourceGroupName, accountName, contentKeyPolicyName); + if (inner != null) { + return new ContentKeyPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, contentKeyPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContentKeyPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String contentKeyPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, contentKeyPolicyName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, contentKeyPolicyName, context); + } + + public ContentKeyPolicyProperties getPolicyPropertiesWithSecrets( + String resourceGroupName, String accountName, String contentKeyPolicyName) { + ContentKeyPolicyPropertiesInner inner = + this.serviceClient().getPolicyPropertiesWithSecrets(resourceGroupName, accountName, contentKeyPolicyName); + if (inner != null) { + return new ContentKeyPolicyPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPolicyPropertiesWithSecretsWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context) { + Response inner = + this + .serviceClient() + .getPolicyPropertiesWithSecretsWithResponse( + resourceGroupName, accountName, contentKeyPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContentKeyPolicyPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContentKeyPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String contentKeyPolicyName = Utils.getValueFromIdByName(id, "contentKeyPolicies"); + if (contentKeyPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'contentKeyPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, contentKeyPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String contentKeyPolicyName = Utils.getValueFromIdByName(id, "contentKeyPolicies"); + if (contentKeyPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'contentKeyPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, contentKeyPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String contentKeyPolicyName = Utils.getValueFromIdByName(id, "contentKeyPolicies"); + if (contentKeyPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'contentKeyPolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, contentKeyPolicyName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String contentKeyPolicyName = Utils.getValueFromIdByName(id, "contentKeyPolicies"); + if (contentKeyPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'contentKeyPolicies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, contentKeyPolicyName, context); + } + + private ContentKeyPoliciesClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public ContentKeyPolicyImpl define(String name) { + return new ContentKeyPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyImpl.java new file mode 100644 index 000000000000..967014ab4a0e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicy; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +public final class ContentKeyPolicyImpl + implements ContentKeyPolicy, ContentKeyPolicy.Definition, ContentKeyPolicy.Update { + private ContentKeyPolicyInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public UUID policyId() { + return this.innerModel().policyId(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public String description() { + return this.innerModel().description(); + } + + public List options() { + List inner = this.innerModel().options(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContentKeyPolicyInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String contentKeyPolicyName; + + public ContentKeyPolicyImpl withExistingMediaService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public ContentKeyPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getContentKeyPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, contentKeyPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ContentKeyPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContentKeyPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, contentKeyPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + public ContentKeyPolicyImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new ContentKeyPolicyInner(); + this.serviceManager = serviceManager; + this.contentKeyPolicyName = name; + } + + public ContentKeyPolicyImpl update() { + return this; + } + + public ContentKeyPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContentKeyPolicies() + .updateWithResponse( + resourceGroupName, accountName, contentKeyPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ContentKeyPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContentKeyPolicies() + .updateWithResponse(resourceGroupName, accountName, contentKeyPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + public ContentKeyPolicyImpl(ContentKeyPolicyInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaServices"); + this.contentKeyPolicyName = Utils.getValueFromIdByName(innerObject.id(), "contentKeyPolicies"); + } + + public ContentKeyPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContentKeyPolicies() + .getWithResponse(resourceGroupName, accountName, contentKeyPolicyName, Context.NONE) + .getValue(); + return this; + } + + public ContentKeyPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContentKeyPolicies() + .getWithResponse(resourceGroupName, accountName, contentKeyPolicyName, context) + .getValue(); + return this; + } + + public ContentKeyPolicyImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public ContentKeyPolicyImpl withOptions(List options) { + this.innerModel().withOptions(options); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyPropertiesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyPropertiesImpl.java new file mode 100644 index 000000000000..4301724a57dd --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyPropertiesImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyPropertiesInner; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption; +import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyProperties; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +public final class ContentKeyPolicyPropertiesImpl implements ContentKeyPolicyProperties { + private ContentKeyPolicyPropertiesInner innerObject; + + private final MediaservicesManager serviceManager; + + public ContentKeyPolicyPropertiesImpl( + ContentKeyPolicyPropertiesInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public UUID policyId() { + return this.innerModel().policyId(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public String description() { + return this.innerModel().description(); + } + + public List options() { + List inner = this.innerModel().options(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContentKeyPolicyPropertiesInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EdgePoliciesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EdgePoliciesImpl.java new file mode 100644 index 000000000000..84faea247da5 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EdgePoliciesImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.EdgePoliciesInner; +import com.azure.resourcemanager.mediaservices.models.EdgePolicies; +import com.azure.resourcemanager.mediaservices.models.EdgeUsageDataCollectionPolicy; + +public final class EdgePoliciesImpl implements EdgePolicies { + private EdgePoliciesInner innerObject; + + private final MediaservicesManager serviceManager; + + public EdgePoliciesImpl(EdgePoliciesInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public EdgeUsageDataCollectionPolicy usageDataCollectionPolicy() { + return this.innerModel().usageDataCollectionPolicy(); + } + + public EdgePoliciesInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EntityNameAvailabilityCheckOutputImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EntityNameAvailabilityCheckOutputImpl.java new file mode 100644 index 000000000000..cfe5ade3bfbd --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EntityNameAvailabilityCheckOutputImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.EntityNameAvailabilityCheckOutputInner; +import com.azure.resourcemanager.mediaservices.models.EntityNameAvailabilityCheckOutput; + +public final class EntityNameAvailabilityCheckOutputImpl implements EntityNameAvailabilityCheckOutput { + private EntityNameAvailabilityCheckOutputInner innerObject; + + private final MediaservicesManager serviceManager; + + public EntityNameAvailabilityCheckOutputImpl( + EntityNameAvailabilityCheckOutputInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public EntityNameAvailabilityCheckOutputInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobImpl.java new file mode 100644 index 000000000000..c4e2a8192597 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.JobInner; +import com.azure.resourcemanager.mediaservices.models.Job; +import com.azure.resourcemanager.mediaservices.models.JobInput; +import com.azure.resourcemanager.mediaservices.models.JobOutput; +import com.azure.resourcemanager.mediaservices.models.JobState; +import com.azure.resourcemanager.mediaservices.models.Priority; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class JobImpl implements Job, Job.Definition, Job.Update { + private JobInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public JobState state() { + return this.innerModel().state(); + } + + public String description() { + return this.innerModel().description(); + } + + public JobInput input() { + return this.innerModel().input(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public List outputs() { + List inner = this.innerModel().outputs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Priority priority() { + return this.innerModel().priority(); + } + + public Map correlationData() { + Map inner = this.innerModel().correlationData(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public JobInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String transformName; + + private String jobName; + + public JobImpl withExistingTransform(String resourceGroupName, String accountName, String transformName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.transformName = transformName; + return this; + } + + public Job create() { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .createWithResponse( + resourceGroupName, accountName, transformName, jobName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Job create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .createWithResponse(resourceGroupName, accountName, transformName, jobName, this.innerModel(), context) + .getValue(); + return this; + } + + public JobImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new JobInner(); + this.serviceManager = serviceManager; + this.jobName = name; + } + + public JobImpl update() { + return this; + } + + public Job apply() { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .updateWithResponse( + resourceGroupName, accountName, transformName, jobName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Job apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .updateWithResponse(resourceGroupName, accountName, transformName, jobName, this.innerModel(), context) + .getValue(); + return this; + } + + public JobImpl(JobInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaServices"); + this.transformName = Utils.getValueFromIdByName(innerObject.id(), "transforms"); + this.jobName = Utils.getValueFromIdByName(innerObject.id(), "jobs"); + } + + public Job refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .getWithResponse(resourceGroupName, accountName, transformName, jobName, Context.NONE) + .getValue(); + return this; + } + + public Job refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .getWithResponse(resourceGroupName, accountName, transformName, jobName, context) + .getValue(); + return this; + } + + public JobImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public JobImpl withInput(JobInput input) { + this.innerModel().withInput(input); + return this; + } + + public JobImpl withOutputs(List outputs) { + this.innerModel().withOutputs(outputs); + return this; + } + + public JobImpl withPriority(Priority priority) { + this.innerModel().withPriority(priority); + return this; + } + + public JobImpl withCorrelationData(Map correlationData) { + this.innerModel().withCorrelationData(correlationData); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsClientImpl.java new file mode 100644 index 000000000000..a21400df3cb0 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsClientImpl.java @@ -0,0 +1,1434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.JobsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.JobInner; +import com.azure.resourcemanager.mediaservices.models.JobCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in JobsClient. */ +public final class JobsClientImpl implements JobsClient { + private final ClientLogger logger = new ClientLogger(JobsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final JobsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of JobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobsClientImpl(AzureMediaServicesImpl client) { + this.service = RestProxy.create(JobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesJobs to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesJo") + private interface JobsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}/jobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}/jobs/{jobName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}/jobs/{jobName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") JobInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}/jobs/{jobName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}/jobs/{jobName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") JobInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}/jobs/{jobName}/cancelJob") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancelJob( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String transformName, String filter, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + filter, + orderby, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String accountName, + String transformName, + String filter, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + filter, + orderby, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String transformName, String filter, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, transformName, filter, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String transformName) { + final String filter = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, transformName, filter, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String accountName, + String transformName, + String filter, + String orderby, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, transformName, filter, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String transformName) { + final String filter = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, transformName, filter, orderby)); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String accountName, + String transformName, + String filter, + String orderby, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, transformName, filter, orderby, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String transformName, String jobName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String transformName, String jobName) { + return getWithResponseAsync(resourceGroupName, accountName, transformName, jobName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner get(String resourceGroupName, String accountName, String transformName, String jobName) { + return getAsync(resourceGroupName, accountName, transformName, jobName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, transformName, jobName, context).block(); + } + + /** + * 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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String accountName, + String transformName, + String jobName, + JobInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return createWithResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner create( + String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return createAsync(resourceGroupName, accountName, transformName, jobName, parameters).block(); + } + + /** + * 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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String accountName, + String transformName, + String jobName, + JobInner parameters, + Context context) { + return createWithResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String transformName, String jobName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String transformName, String jobName) { + return deleteWithResponseAsync(resourceGroupName, accountName, transformName, jobName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String transformName, String jobName) { + deleteAsync(resourceGroupName, accountName, transformName, jobName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, transformName, jobName, context).block(); + } + + /** + * Update is only supported for description and priority. Updating Priority will take effect when the Job state is + * Queued or Scheduled and depending on the timing the priority update may be ignored. + * + * @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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update is only supported for description and priority. Updating Priority will take effect when the Job state is + * Queued or Scheduled and depending on the timing the priority update may be ignored. + * + * @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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String transformName, + String jobName, + JobInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update is only supported for description and priority. Updating Priority will take effect when the Job state is + * Queued or Scheduled and depending on the timing the priority update may be ignored. + * + * @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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update is only supported for description and priority. Updating Priority will take effect when the Job state is + * Queued or Scheduled and depending on the timing the priority update may be ignored. + * + * @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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner update( + String resourceGroupName, String accountName, String transformName, String jobName, JobInner parameters) { + return updateAsync(resourceGroupName, accountName, transformName, jobName, parameters).block(); + } + + /** + * Update is only supported for description and priority. Updating Priority will take effect when the Job state is + * Queued or Scheduled and depending on the timing the priority update may be ignored. + * + * @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 A Job resource type. The progress and state can be obtained by polling a Job or subscribing to + * events using EventGrid. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String transformName, + String jobName, + JobInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, transformName, jobName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelJobWithResponseAsync( + String resourceGroupName, String accountName, String transformName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancelJob( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelJobWithResponseAsync( + String resourceGroupName, String accountName, String transformName, String jobName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancelJob( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + jobName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelJobAsync( + String resourceGroupName, String accountName, String transformName, String jobName) { + return cancelJobWithResponseAsync(resourceGroupName, accountName, transformName, jobName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancelJob(String resourceGroupName, String accountName, String transformName, String jobName) { + cancelJobAsync(resourceGroupName, accountName, transformName, jobName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelJobWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context) { + return cancelJobWithResponseAsync(resourceGroupName, accountName, transformName, jobName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsImpl.java new file mode 100644 index 000000000000..436f99e5ec89 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.JobsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.JobInner; +import com.azure.resourcemanager.mediaservices.models.Job; +import com.azure.resourcemanager.mediaservices.models.Jobs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class JobsImpl implements Jobs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobsImpl.class); + + private final JobsClient innerClient; + + private final MediaservicesManager serviceManager; + + public JobsImpl(JobsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName, String transformName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, transformName); + return inner.mapPage(inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String accountName, + String transformName, + String filter, + String orderby, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, transformName, filter, orderby, context); + return inner.mapPage(inner1 -> new JobImpl(inner1, this.manager())); + } + + public Job get(String resourceGroupName, String accountName, String transformName, String jobName) { + JobInner inner = this.serviceClient().get(resourceGroupName, accountName, transformName, jobName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, transformName, jobName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String transformName, String jobName) { + this.serviceClient().delete(resourceGroupName, accountName, transformName, jobName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, transformName, jobName, context); + } + + public void cancelJob(String resourceGroupName, String accountName, String transformName, String jobName) { + this.serviceClient().cancelJob(resourceGroupName, accountName, transformName, jobName); + } + + public Response cancelJobWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context) { + return this + .serviceClient() + .cancelJobWithResponse(resourceGroupName, accountName, transformName, jobName, context); + } + + public Job getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String transformName = Utils.getValueFromIdByName(id, "transforms"); + if (transformName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'transforms'.", id))); + } + String jobName = Utils.getValueFromIdByName(id, "jobs"); + if (jobName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, transformName, jobName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String transformName = Utils.getValueFromIdByName(id, "transforms"); + if (transformName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'transforms'.", id))); + } + String jobName = Utils.getValueFromIdByName(id, "jobs"); + if (jobName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, transformName, jobName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String transformName = Utils.getValueFromIdByName(id, "transforms"); + if (transformName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'transforms'.", id))); + } + String jobName = Utils.getValueFromIdByName(id, "jobs"); + if (jobName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, transformName, jobName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String transformName = Utils.getValueFromIdByName(id, "transforms"); + if (transformName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'transforms'.", id))); + } + String jobName = Utils.getValueFromIdByName(id, "jobs"); + if (jobName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, transformName, jobName, context); + } + + private JobsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public JobImpl define(String name) { + return new JobImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListContentKeysResponseImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListContentKeysResponseImpl.java new file mode 100644 index 000000000000..1d02b763a604 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListContentKeysResponseImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.ListContentKeysResponseInner; +import com.azure.resourcemanager.mediaservices.models.ListContentKeysResponse; +import com.azure.resourcemanager.mediaservices.models.StreamingLocatorContentKey; +import java.util.Collections; +import java.util.List; + +public final class ListContentKeysResponseImpl implements ListContentKeysResponse { + private ListContentKeysResponseInner innerObject; + + private final MediaservicesManager serviceManager; + + public ListContentKeysResponseImpl(ListContentKeysResponseInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List contentKeys() { + List inner = this.innerModel().contentKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ListContentKeysResponseInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListPathsResponseImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListPathsResponseImpl.java new file mode 100644 index 000000000000..f4b76e4ff1ee --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListPathsResponseImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.ListPathsResponseInner; +import com.azure.resourcemanager.mediaservices.models.ListPathsResponse; +import com.azure.resourcemanager.mediaservices.models.StreamingPath; +import java.util.Collections; +import java.util.List; + +public final class ListPathsResponseImpl implements ListPathsResponse { + private ListPathsResponseInner innerObject; + + private final MediaservicesManager serviceManager; + + public ListPathsResponseImpl(ListPathsResponseInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List streamingPaths() { + List inner = this.innerModel().streamingPaths(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List downloadPaths() { + List inner = this.innerModel().downloadPaths(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ListPathsResponseInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListStreamingLocatorsResponseImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListStreamingLocatorsResponseImpl.java new file mode 100644 index 000000000000..f9bf7a6bf1c9 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListStreamingLocatorsResponseImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.ListStreamingLocatorsResponseInner; +import com.azure.resourcemanager.mediaservices.models.AssetStreamingLocator; +import com.azure.resourcemanager.mediaservices.models.ListStreamingLocatorsResponse; +import java.util.Collections; +import java.util.List; + +public final class ListStreamingLocatorsResponseImpl implements ListStreamingLocatorsResponse { + private ListStreamingLocatorsResponseInner innerObject; + + private final MediaservicesManager serviceManager; + + public ListStreamingLocatorsResponseImpl( + ListStreamingLocatorsResponseInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List streamingLocators() { + List inner = this.innerModel().streamingLocators(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ListStreamingLocatorsResponseInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventImpl.java new file mode 100644 index 000000000000..ddc1a154f379 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventImpl.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner; +import com.azure.resourcemanager.mediaservices.models.CrossSiteAccessPolicies; +import com.azure.resourcemanager.mediaservices.models.LiveEvent; +import com.azure.resourcemanager.mediaservices.models.LiveEventEncoding; +import com.azure.resourcemanager.mediaservices.models.LiveEventInput; +import com.azure.resourcemanager.mediaservices.models.LiveEventPreview; +import com.azure.resourcemanager.mediaservices.models.LiveEventResourceState; +import com.azure.resourcemanager.mediaservices.models.LiveEventTranscription; +import com.azure.resourcemanager.mediaservices.models.StreamOptionsFlag; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class LiveEventImpl implements LiveEvent, LiveEvent.Definition, LiveEvent.Update { + private LiveEventInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String description() { + return this.innerModel().description(); + } + + public LiveEventInput input() { + return this.innerModel().input(); + } + + public LiveEventPreview preview() { + return this.innerModel().preview(); + } + + public LiveEventEncoding encoding() { + return this.innerModel().encoding(); + } + + public List transcriptions() { + List inner = this.innerModel().transcriptions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public LiveEventResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.innerModel().crossSiteAccessPolicies(); + } + + public Boolean useStaticHostname() { + return this.innerModel().useStaticHostname(); + } + + public String hostnamePrefix() { + return this.innerModel().hostnamePrefix(); + } + + public List streamOptions() { + List inner = this.innerModel().streamOptions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public LiveEventInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String liveEventName; + + private Boolean createAutoStart; + + public LiveEventImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public LiveEvent create() { + this.innerObject = + serviceManager + .serviceClient() + .getLiveEvents() + .create( + resourceGroupName, accountName, liveEventName, this.innerModel(), createAutoStart, Context.NONE); + return this; + } + + public LiveEvent create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLiveEvents() + .create(resourceGroupName, accountName, liveEventName, this.innerModel(), createAutoStart, context); + return this; + } + + public LiveEventImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new LiveEventInner(); + this.serviceManager = serviceManager; + this.liveEventName = name; + this.createAutoStart = null; + } + + public LiveEventImpl update() { + return this; + } + + public LiveEvent apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLiveEvents() + .update(resourceGroupName, accountName, liveEventName, this.innerModel(), Context.NONE); + return this; + } + + public LiveEvent apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLiveEvents() + .update(resourceGroupName, accountName, liveEventName, this.innerModel(), context); + return this; + } + + public LiveEventImpl(LiveEventInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaservices"); + this.liveEventName = Utils.getValueFromIdByName(innerObject.id(), "liveEvents"); + } + + public LiveEvent refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLiveEvents() + .getWithResponse(resourceGroupName, accountName, liveEventName, Context.NONE) + .getValue(); + return this; + } + + public LiveEvent refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLiveEvents() + .getWithResponse(resourceGroupName, accountName, liveEventName, context) + .getValue(); + return this; + } + + public LiveEventImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LiveEventImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LiveEventImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public LiveEventImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public LiveEventImpl withInput(LiveEventInput input) { + this.innerModel().withInput(input); + return this; + } + + public LiveEventImpl withPreview(LiveEventPreview preview) { + this.innerModel().withPreview(preview); + return this; + } + + public LiveEventImpl withEncoding(LiveEventEncoding encoding) { + this.innerModel().withEncoding(encoding); + return this; + } + + public LiveEventImpl withTranscriptions(List transcriptions) { + this.innerModel().withTranscriptions(transcriptions); + return this; + } + + public LiveEventImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.innerModel().withCrossSiteAccessPolicies(crossSiteAccessPolicies); + return this; + } + + public LiveEventImpl withUseStaticHostname(Boolean useStaticHostname) { + this.innerModel().withUseStaticHostname(useStaticHostname); + return this; + } + + public LiveEventImpl withHostnamePrefix(String hostnamePrefix) { + this.innerModel().withHostnamePrefix(hostnamePrefix); + return this; + } + + public LiveEventImpl withStreamOptions(List streamOptions) { + this.innerModel().withStreamOptions(streamOptions); + return this; + } + + public LiveEventImpl withAutoStart(Boolean autoStart) { + this.createAutoStart = autoStart; + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsClientImpl.java new file mode 100644 index 000000000000..59cfa717f375 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsClientImpl.java @@ -0,0 +1,2639 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mediaservices.fluent.LiveEventsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner; +import com.azure.resourcemanager.mediaservices.models.LiveEventActionInput; +import com.azure.resourcemanager.mediaservices.models.LiveEventListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LiveEventsClient. */ +public final class LiveEventsClientImpl implements LiveEventsClient { + private final ClientLogger logger = new ClientLogger(LiveEventsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LiveEventsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of LiveEventsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LiveEventsClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(LiveEventsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesLiveEvents to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesLi") + private interface LiveEventsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @QueryParam("api-version") String apiVersion, + @QueryParam("autoStart") Boolean autoStart, + @BodyParam("application/json") LiveEventInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LiveEventInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}/allocate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> allocate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LiveEventActionInput parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}/reset") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reset( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * Lists all 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Lists all 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets properties of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets properties of 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets properties of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String liveEventName) { + return getWithResponseAsync(resourceGroupName, accountName, liveEventName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets properties of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveEventInner get(String resourceGroupName, String accountName, String liveEventName) { + return getAsync(resourceGroupName, accountName, liveEventName).block(); + } + + /** + * Gets properties of 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String liveEventName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, liveEventName, context).block(); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + autoStart, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + autoStart, + parameters, + accept, + context); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LiveEventInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LiveEventInner.class, LiveEventInner.class, Context.NONE); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LiveEventInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LiveEventInner.class, LiveEventInner.class, context); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LiveEventInner> beginCreate( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart) { + return beginCreateAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).getSyncPoller(); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LiveEventInner> beginCreate( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart, context) + .getSyncPoller(); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart) { + return beginCreateAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + final Boolean autoStart = null; + return beginCreateAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveEventInner create( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart) { + return createAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).block(); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveEventInner create( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + final Boolean autoStart = null; + return createAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart).block(); + } + + /** + * Creates a new 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, maximum length is 32. + * @param parameters The live event. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveEventInner create( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Boolean autoStart, + Context context) { + return createAsync(resourceGroupName, accountName, liveEventName, parameters, autoStart, context).block(); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LiveEventInner> beginUpdateAsync( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, liveEventName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LiveEventInner.class, LiveEventInner.class, Context.NONE); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LiveEventInner> beginUpdateAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, liveEventName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LiveEventInner.class, LiveEventInner.class, context); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LiveEventInner> beginUpdate( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginUpdateAsync(resourceGroupName, accountName, liveEventName, parameters).getSyncPoller(); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LiveEventInner> beginUpdate( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, liveEventName, parameters, context).getSyncPoller(); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return beginUpdateAsync(resourceGroupName, accountName, liveEventName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, liveEventName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveEventInner update( + String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) { + return updateAsync(resourceGroupName, accountName, liveEventName, parameters).block(); + } + + /** + * Updates settings on 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, maximum length is 32. + * @param parameters The live event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the live event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveEventInner update( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventInner parameters, + Context context) { + return updateAsync(resourceGroupName, accountName, liveEventName, parameters, context).block(); + } + + /** + * 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String liveEventName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, liveEventName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, liveEventName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String liveEventName) { + return beginDeleteAsync(resourceGroupName, accountName, liveEventName).getSyncPoller(); + } + + /** + * 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String liveEventName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, liveEventName, context).getSyncPoller(); + } + + /** + * 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginDeleteAsync(resourceGroupName, accountName, liveEventName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, liveEventName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String liveEventName) { + deleteAsync(resourceGroupName, accountName, liveEventName).block(); + } + + /** + * 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String liveEventName, Context context) { + deleteAsync(resourceGroupName, accountName, liveEventName, context).block(); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> allocateWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .allocate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> allocateWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .allocate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginAllocateAsync( + String resourceGroupName, String accountName, String liveEventName) { + Mono>> mono = + allocateWithResponseAsync(resourceGroupName, accountName, liveEventName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginAllocateAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + allocateWithResponseAsync(resourceGroupName, accountName, liveEventName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginAllocate( + String resourceGroupName, String accountName, String liveEventName) { + return beginAllocateAsync(resourceGroupName, accountName, liveEventName).getSyncPoller(); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginAllocate( + String resourceGroupName, String accountName, String liveEventName, Context context) { + return beginAllocateAsync(resourceGroupName, accountName, liveEventName, context).getSyncPoller(); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono allocateAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginAllocateAsync(resourceGroupName, accountName, liveEventName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono allocateAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + return beginAllocateAsync(resourceGroupName, accountName, liveEventName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void allocate(String resourceGroupName, String accountName, String liveEventName) { + allocateAsync(resourceGroupName, accountName, liveEventName).block(); + } + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void allocate(String resourceGroupName, String accountName, String liveEventName, Context context) { + allocateAsync(resourceGroupName, accountName, liveEventName, context).block(); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String accountName, String liveEventName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, accountName, liveEventName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, accountName, liveEventName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String accountName, String liveEventName) { + return beginStartAsync(resourceGroupName, accountName, liveEventName).getSyncPoller(); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String accountName, String liveEventName, Context context) { + return beginStartAsync(resourceGroupName, accountName, liveEventName, context).getSyncPoller(); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginStartAsync(resourceGroupName, accountName, liveEventName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String accountName, String liveEventName, Context context) { + return beginStartAsync(resourceGroupName, accountName, liveEventName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String accountName, String liveEventName) { + startAsync(resourceGroupName, accountName, liveEventName).block(); + } + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String accountName, String liveEventName, Context context) { + startAsync(resourceGroupName, accountName, liveEventName, context).block(); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, LiveEventActionInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventActionInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String accountName, String liveEventName, LiveEventActionInput parameters) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, accountName, liveEventName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventActionInput parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, accountName, liveEventName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String accountName, String liveEventName, LiveEventActionInput parameters) { + return beginStopAsync(resourceGroupName, accountName, liveEventName, parameters).getSyncPoller(); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventActionInput parameters, + Context context) { + return beginStopAsync(resourceGroupName, accountName, liveEventName, parameters, context).getSyncPoller(); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String resourceGroupName, String accountName, String liveEventName, LiveEventActionInput parameters) { + return beginStopAsync(resourceGroupName, accountName, liveEventName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventActionInput parameters, + Context context) { + return beginStopAsync(resourceGroupName, accountName, liveEventName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop( + String resourceGroupName, String accountName, String liveEventName, LiveEventActionInput parameters) { + stopAsync(resourceGroupName, accountName, liveEventName, parameters).block(); + } + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventActionInput parameters, + Context context) { + stopAsync(resourceGroupName, accountName, liveEventName, parameters, context).block(); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reset( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reset( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResetAsync( + String resourceGroupName, String accountName, String liveEventName) { + Mono>> mono = resetWithResponseAsync(resourceGroupName, accountName, liveEventName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResetAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetWithResponseAsync(resourceGroupName, accountName, liveEventName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReset( + String resourceGroupName, String accountName, String liveEventName) { + return beginResetAsync(resourceGroupName, accountName, liveEventName).getSyncPoller(); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReset( + String resourceGroupName, String accountName, String liveEventName, Context context) { + return beginResetAsync(resourceGroupName, accountName, liveEventName, context).getSyncPoller(); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String accountName, String liveEventName) { + return beginResetAsync(resourceGroupName, accountName, liveEventName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String accountName, String liveEventName, Context context) { + return beginResetAsync(resourceGroupName, accountName, liveEventName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reset(String resourceGroupName, String accountName, String liveEventName) { + resetAsync(resourceGroupName, accountName, liveEventName).block(); + } + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reset(String resourceGroupName, String accountName, String liveEventName, Context context) { + resetAsync(resourceGroupName, accountName, liveEventName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsImpl.java new file mode 100644 index 000000000000..43a46b2ef1c7 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.LiveEventsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner; +import com.azure.resourcemanager.mediaservices.models.LiveEvent; +import com.azure.resourcemanager.mediaservices.models.LiveEventActionInput; +import com.azure.resourcemanager.mediaservices.models.LiveEvents; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LiveEventsImpl implements LiveEvents { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventsImpl.class); + + private final LiveEventsClient innerClient; + + private final MediaservicesManager serviceManager; + + public LiveEventsImpl(LiveEventsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new LiveEventImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return inner.mapPage(inner1 -> new LiveEventImpl(inner1, this.manager())); + } + + public LiveEvent get(String resourceGroupName, String accountName, String liveEventName) { + LiveEventInner inner = this.serviceClient().get(resourceGroupName, accountName, liveEventName); + if (inner != null) { + return new LiveEventImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String liveEventName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, liveEventName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LiveEventImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String liveEventName) { + this.serviceClient().delete(resourceGroupName, accountName, liveEventName); + } + + public void delete(String resourceGroupName, String accountName, String liveEventName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, liveEventName, context); + } + + public void allocate(String resourceGroupName, String accountName, String liveEventName) { + this.serviceClient().allocate(resourceGroupName, accountName, liveEventName); + } + + public void allocate(String resourceGroupName, String accountName, String liveEventName, Context context) { + this.serviceClient().allocate(resourceGroupName, accountName, liveEventName, context); + } + + public void start(String resourceGroupName, String accountName, String liveEventName) { + this.serviceClient().start(resourceGroupName, accountName, liveEventName); + } + + public void start(String resourceGroupName, String accountName, String liveEventName, Context context) { + this.serviceClient().start(resourceGroupName, accountName, liveEventName, context); + } + + public void stop( + String resourceGroupName, String accountName, String liveEventName, LiveEventActionInput parameters) { + this.serviceClient().stop(resourceGroupName, accountName, liveEventName, parameters); + } + + public void stop( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventActionInput parameters, + Context context) { + this.serviceClient().stop(resourceGroupName, accountName, liveEventName, parameters, context); + } + + public void reset(String resourceGroupName, String accountName, String liveEventName) { + this.serviceClient().reset(resourceGroupName, accountName, liveEventName); + } + + public void reset(String resourceGroupName, String accountName, String liveEventName, Context context) { + this.serviceClient().reset(resourceGroupName, accountName, liveEventName, context); + } + + public LiveEvent getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String liveEventName = Utils.getValueFromIdByName(id, "liveEvents"); + if (liveEventName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveEvents'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, liveEventName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String liveEventName = Utils.getValueFromIdByName(id, "liveEvents"); + if (liveEventName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveEvents'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, liveEventName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String liveEventName = Utils.getValueFromIdByName(id, "liveEvents"); + if (liveEventName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveEvents'.", id))); + } + this.delete(resourceGroupName, accountName, liveEventName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String liveEventName = Utils.getValueFromIdByName(id, "liveEvents"); + if (liveEventName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveEvents'.", id))); + } + this.delete(resourceGroupName, accountName, liveEventName, context); + } + + private LiveEventsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public LiveEventImpl define(String name) { + return new LiveEventImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputImpl.java new file mode 100644 index 000000000000..4a27dd25a348 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveOutputInner; +import com.azure.resourcemanager.mediaservices.models.Hls; +import com.azure.resourcemanager.mediaservices.models.LiveOutput; +import com.azure.resourcemanager.mediaservices.models.LiveOutputResourceState; +import java.time.Duration; +import java.time.OffsetDateTime; + +public final class LiveOutputImpl implements LiveOutput, LiveOutput.Definition { + private LiveOutputInner innerObject; + + private final MediaservicesManager serviceManager; + + public LiveOutputImpl(LiveOutputInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public String assetName() { + return this.innerModel().assetName(); + } + + public Duration archiveWindowLength() { + return this.innerModel().archiveWindowLength(); + } + + public String manifestName() { + return this.innerModel().manifestName(); + } + + public Hls hls() { + return this.innerModel().hls(); + } + + public Long outputSnapTime() { + return this.innerModel().outputSnapTime(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public LiveOutputResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public LiveOutputInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String liveEventName; + + private String liveOutputName; + + public LiveOutputImpl withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.liveEventName = liveEventName; + return this; + } + + public LiveOutput create() { + this.innerObject = + serviceManager + .serviceClient() + .getLiveOutputs() + .create(resourceGroupName, accountName, liveEventName, liveOutputName, this.innerModel(), Context.NONE); + return this; + } + + public LiveOutput create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLiveOutputs() + .create(resourceGroupName, accountName, liveEventName, liveOutputName, this.innerModel(), context); + return this; + } + + public LiveOutputImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new LiveOutputInner(); + this.serviceManager = serviceManager; + this.liveOutputName = name; + } + + public LiveOutput refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLiveOutputs() + .getWithResponse(resourceGroupName, accountName, liveEventName, liveOutputName, Context.NONE) + .getValue(); + return this; + } + + public LiveOutput refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLiveOutputs() + .getWithResponse(resourceGroupName, accountName, liveEventName, liveOutputName, context) + .getValue(); + return this; + } + + public LiveOutputImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public LiveOutputImpl withAssetName(String assetName) { + this.innerModel().withAssetName(assetName); + return this; + } + + public LiveOutputImpl withArchiveWindowLength(Duration archiveWindowLength) { + this.innerModel().withArchiveWindowLength(archiveWindowLength); + return this; + } + + public LiveOutputImpl withManifestName(String manifestName) { + this.innerModel().withManifestName(manifestName); + return this; + } + + public LiveOutputImpl withHls(Hls hls) { + this.innerModel().withHls(hls); + return this; + } + + public LiveOutputImpl withOutputSnapTime(Long outputSnapTime) { + this.innerModel().withOutputSnapTime(outputSnapTime); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsClientImpl.java new file mode 100644 index 000000000000..cb8f2e1e8dd8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsClientImpl.java @@ -0,0 +1,1208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mediaservices.fluent.LiveOutputsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveOutputInner; +import com.azure.resourcemanager.mediaservices.models.LiveOutputListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LiveOutputsClient. */ +public final class LiveOutputsClientImpl implements LiveOutputsClient { + private final ClientLogger logger = new ClientLogger(LiveOutputsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LiveOutputsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of LiveOutputsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LiveOutputsClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(LiveOutputsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesLiveOutputs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesLi") + private interface LiveOutputsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}/liveOutputs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @PathParam("liveOutputName") String liveOutputName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @PathParam("liveOutputName") String liveOutputName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LiveOutputInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("liveEventName") String liveEventName, + @PathParam("liveOutputName") String liveOutputName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the live outputs of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String liveEventName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the live outputs of 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * Lists the live outputs of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String liveEventName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, liveEventName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the live outputs of 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String liveEventName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, liveEventName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the live outputs of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String liveEventName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, liveEventName)); + } + + /** + * Lists the live outputs of 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String liveEventName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, liveEventName, context)); + } + + /** + * 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (liveOutputName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + liveOutputName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (liveOutputName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + liveOutputName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return getWithResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveOutputInner get( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return getAsync(resourceGroupName, accountName, liveEventName, liveOutputName).block(); + } + + /** + * 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, context).block(); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (liveOutputName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + liveOutputName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (liveOutputName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + liveOutputName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LiveOutputInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LiveOutputInner.class, LiveOutputInner.class, Context.NONE); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, LiveOutputInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), LiveOutputInner.class, LiveOutputInner.class, context); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LiveOutputInner> beginCreate( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters) { + return beginCreateAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters) + .getSyncPoller(); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, LiveOutputInner> beginCreate( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters) { + return beginCreateAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveOutputInner create( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters) { + return createAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).block(); + } + + /** + * Creates a new 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param parameters The Live Output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Live Output. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LiveOutputInner create( + String resourceGroupName, + String accountName, + String liveEventName, + String liveOutputName, + LiveOutputInner parameters, + Context context) { + return createAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters, context).block(); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (liveOutputName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + liveOutputName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (liveEventName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); + } + if (liveOutputName == null) { + return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + liveEventName, + liveOutputName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return beginDeleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName).getSyncPoller(); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName, context).getSyncPoller(); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + return beginDeleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + deleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName).block(); + } + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context) { + deleteAsync(resourceGroupName, accountName, liveEventName, liveOutputName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsImpl.java new file mode 100644 index 000000000000..58a1f5a6b8a3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.LiveOutputsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveOutputInner; +import com.azure.resourcemanager.mediaservices.models.LiveOutput; +import com.azure.resourcemanager.mediaservices.models.LiveOutputs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LiveOutputsImpl implements LiveOutputs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveOutputsImpl.class); + + private final LiveOutputsClient innerClient; + + private final MediaservicesManager serviceManager; + + public LiveOutputsImpl(LiveOutputsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName, String liveEventName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, liveEventName); + return inner.mapPage(inner1 -> new LiveOutputImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String liveEventName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, liveEventName, context); + return inner.mapPage(inner1 -> new LiveOutputImpl(inner1, this.manager())); + } + + public LiveOutput get(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + LiveOutputInner inner = this.serviceClient().get(resourceGroupName, accountName, liveEventName, liveOutputName); + if (inner != null) { + return new LiveOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, accountName, liveEventName, liveOutputName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LiveOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) { + this.serviceClient().delete(resourceGroupName, accountName, liveEventName, liveOutputName); + } + + public void delete( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, liveEventName, liveOutputName, context); + } + + public LiveOutput getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String liveEventName = Utils.getValueFromIdByName(id, "liveEvents"); + if (liveEventName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveEvents'.", id))); + } + String liveOutputName = Utils.getValueFromIdByName(id, "liveOutputs"); + if (liveOutputName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveOutputs'.", id))); + } + return this + .getWithResponse(resourceGroupName, accountName, liveEventName, liveOutputName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String liveEventName = Utils.getValueFromIdByName(id, "liveEvents"); + if (liveEventName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveEvents'.", id))); + } + String liveOutputName = Utils.getValueFromIdByName(id, "liveOutputs"); + if (liveOutputName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveOutputs'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, liveEventName, liveOutputName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String liveEventName = Utils.getValueFromIdByName(id, "liveEvents"); + if (liveEventName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveEvents'.", id))); + } + String liveOutputName = Utils.getValueFromIdByName(id, "liveOutputs"); + if (liveOutputName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveOutputs'.", id))); + } + this.delete(resourceGroupName, accountName, liveEventName, liveOutputName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String liveEventName = Utils.getValueFromIdByName(id, "liveEvents"); + if (liveEventName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveEvents'.", id))); + } + String liveOutputName = Utils.getValueFromIdByName(id, "liveOutputs"); + if (liveOutputName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'liveOutputs'.", id))); + } + this.delete(resourceGroupName, accountName, liveEventName, liveOutputName, context); + } + + private LiveOutputsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public LiveOutputImpl define(String name) { + return new LiveOutputImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsClientImpl.java new file mode 100644 index 000000000000..ad33e8148b9e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsClientImpl.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.LocationsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.EntityNameAvailabilityCheckOutputInner; +import com.azure.resourcemanager.mediaservices.models.CheckNameAvailabilityInput; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public final class LocationsClientImpl implements LocationsClient { + private final ClientLogger logger = new ClientLogger(LocationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LocationsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of LocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationsClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesLocations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesLo") + private interface LocationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("locationName") String locationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityInput parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location. + * @param parameters The input to the check name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String locationName, CheckNameAvailabilityInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + locationName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location. + * @param parameters The input to the check name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String locationName, CheckNameAvailabilityInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + locationName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location. + * @param parameters The input to the check name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String locationName, CheckNameAvailabilityInput parameters) { + return checkNameAvailabilityWithResponseAsync(locationName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location. + * @param parameters The input to the check name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EntityNameAvailabilityCheckOutputInner checkNameAvailability( + String locationName, CheckNameAvailabilityInput parameters) { + return checkNameAvailabilityAsync(locationName, parameters).block(); + } + + /** + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location. + * @param parameters The input to the check name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String locationName, CheckNameAvailabilityInput parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(locationName, parameters, context).block(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsImpl.java new file mode 100644 index 000000000000..eb3fa3ca4147 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.LocationsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.EntityNameAvailabilityCheckOutputInner; +import com.azure.resourcemanager.mediaservices.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.mediaservices.models.EntityNameAvailabilityCheckOutput; +import com.azure.resourcemanager.mediaservices.models.Locations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LocationsImpl implements Locations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationsImpl.class); + + private final LocationsClient innerClient; + + private final MediaservicesManager serviceManager; + + public LocationsImpl(LocationsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EntityNameAvailabilityCheckOutput checkNameAvailability( + String locationName, CheckNameAvailabilityInput parameters) { + EntityNameAvailabilityCheckOutputInner inner = + this.serviceClient().checkNameAvailability(locationName, parameters); + if (inner != null) { + return new EntityNameAvailabilityCheckOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String locationName, CheckNameAvailabilityInput parameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(locationName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EntityNameAvailabilityCheckOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LocationsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaServiceImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaServiceImpl.java new file mode 100644 index 000000000000..b9ec365c10a2 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaServiceImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; +import com.azure.resourcemanager.mediaservices.models.AccountEncryption; +import com.azure.resourcemanager.mediaservices.models.MediaService; +import com.azure.resourcemanager.mediaservices.models.MediaServiceIdentity; +import com.azure.resourcemanager.mediaservices.models.StorageAccount; +import com.azure.resourcemanager.mediaservices.models.StorageAuthentication; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +public final class MediaServiceImpl implements MediaService, MediaService.Definition, MediaService.Update { + private MediaServiceInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public MediaServiceIdentity identity() { + return this.innerModel().identity(); + } + + public UUID mediaServiceId() { + return this.innerModel().mediaServiceId(); + } + + public List storageAccounts() { + List inner = this.innerModel().storageAccounts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public StorageAuthentication storageAuthentication() { + return this.innerModel().storageAuthentication(); + } + + public AccountEncryption encryption() { + return this.innerModel().encryption(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public MediaServiceInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public MediaServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public MediaService create() { + this.innerObject = + serviceManager + .serviceClient() + .getMediaservices() + .createOrUpdateWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MediaService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMediaservices() + .createOrUpdateWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + public MediaServiceImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new MediaServiceInner(); + this.serviceManager = serviceManager; + this.accountName = name; + } + + public MediaServiceImpl update() { + return this; + } + + public MediaService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMediaservices() + .updateWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MediaService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMediaservices() + .updateWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + public MediaServiceImpl(MediaServiceInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaservices"); + } + + public MediaService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMediaservices() + .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public MediaService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMediaservices() + .getByResourceGroupWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public MediaServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MediaServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MediaServiceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public MediaServiceImpl withIdentity(MediaServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public MediaServiceImpl withStorageAccounts(List storageAccounts) { + this.innerModel().withStorageAccounts(storageAccounts); + return this; + } + + public MediaServiceImpl withStorageAuthentication(StorageAuthentication storageAuthentication) { + this.innerModel().withStorageAuthentication(storageAuthentication); + return this; + } + + public MediaServiceImpl withEncryption(AccountEncryption encryption) { + this.innerModel().withEncryption(encryption); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesClientImpl.java new file mode 100644 index 000000000000..c07b8de20818 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesClientImpl.java @@ -0,0 +1,1748 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.MediaservicesClient; +import com.azure.resourcemanager.mediaservices.fluent.models.EdgePoliciesInner; +import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; +import com.azure.resourcemanager.mediaservices.models.ListEdgePoliciesInput; +import com.azure.resourcemanager.mediaservices.models.MediaServiceCollection; +import com.azure.resourcemanager.mediaservices.models.SyncStorageKeysInput; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MediaservicesClient. */ +public final class MediaservicesClientImpl implements MediaservicesClient { + private final ClientLogger logger = new ClientLogger(MediaservicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final MediaservicesService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of MediaservicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MediaservicesClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(MediaservicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesMediaservices to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesMe") + private interface MediaservicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media" + + "/mediaservices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MediaServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MediaServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/syncStorageKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> syncStorageKeys( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SyncStorageKeysInput parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/listEdgePolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listEdgePolicies( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ListEdgePoliciesInput parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBySubscription( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MediaServiceInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupAsync(resourceGroupName, accountName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * 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 A Media Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, MediaServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 A Media Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, MediaServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 A Media Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, MediaServiceInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 A Media Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MediaServiceInner createOrUpdate( + String resourceGroupName, String accountName, MediaServiceInner parameters) { + return createOrUpdateAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * 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 A Media Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, MediaServiceInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName) { + return deleteWithResponseAsync(resourceGroupName, accountName).flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName) { + deleteAsync(resourceGroupName, accountName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * 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 A Media Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, MediaServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 A Media Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, MediaServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 A Media Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, MediaServiceInner parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 A Media Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceInner parameters) { + return updateAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * 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 A Media Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String accountName, MediaServiceInner parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * 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 parameters The input to the sync storage keys request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> syncStorageKeysWithResponseAsync( + String resourceGroupName, String accountName, SyncStorageKeysInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .syncStorageKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 parameters The input to the sync storage keys request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> syncStorageKeysWithResponseAsync( + String resourceGroupName, String accountName, SyncStorageKeysInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .syncStorageKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 parameters The input to the sync storage keys request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono syncStorageKeysAsync( + String resourceGroupName, String accountName, SyncStorageKeysInput parameters) { + return syncStorageKeysWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 parameters The input to the sync storage keys request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void syncStorageKeys(String resourceGroupName, String accountName, SyncStorageKeysInput parameters) { + syncStorageKeysAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * 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 parameters The input to the sync storage keys request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response syncStorageKeysWithResponse( + String resourceGroupName, String accountName, SyncStorageKeysInput parameters, Context context) { + return syncStorageKeysWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * List the media edge policies associated with the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEdgePoliciesWithResponseAsync( + String resourceGroupName, String accountName, ListEdgePoliciesInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listEdgePolicies( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List the media edge policies associated with the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEdgePoliciesWithResponseAsync( + String resourceGroupName, String accountName, ListEdgePoliciesInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listEdgePolicies( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * List the media edge policies associated with the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listEdgePoliciesAsync( + String resourceGroupName, String accountName, ListEdgePoliciesInput parameters) { + return listEdgePoliciesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List the media edge policies associated with the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgePoliciesInner listEdgePolicies( + String resourceGroupName, String accountName, ListEdgePoliciesInput parameters) { + return listEdgePoliciesAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * List the media edge policies associated with the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listEdgePoliciesWithResponse( + String resourceGroupName, String accountName, ListEdgePoliciesInput parameters, Context context) { + return listEdgePoliciesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * List Media Services accounts in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List Media Services accounts in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * List Media Services accounts in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Media Services accounts in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Media Services accounts in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Media Services accounts in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBySubscriptionWithResponseAsync(String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBySubscription( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + accountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBySubscriptionWithResponseAsync(String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBySubscription( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBySubscriptionAsync(String accountName) { + return getBySubscriptionWithResponseAsync(accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MediaServiceInner getBySubscription(String accountName) { + return getBySubscriptionAsync(accountName).block(); + } + + /** + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBySubscriptionWithResponse(String accountName, Context context) { + return getBySubscriptionWithResponseAsync(accountName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesImpl.java new file mode 100644 index 000000000000..b49879b18ddf --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.MediaservicesClient; +import com.azure.resourcemanager.mediaservices.fluent.models.EdgePoliciesInner; +import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; +import com.azure.resourcemanager.mediaservices.models.EdgePolicies; +import com.azure.resourcemanager.mediaservices.models.ListEdgePoliciesInput; +import com.azure.resourcemanager.mediaservices.models.MediaService; +import com.azure.resourcemanager.mediaservices.models.Mediaservices; +import com.azure.resourcemanager.mediaservices.models.SyncStorageKeysInput; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MediaservicesImpl implements Mediaservices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MediaservicesImpl.class); + + private final MediaservicesClient innerClient; + + private final MediaservicesManager serviceManager; + + public MediaservicesImpl(MediaservicesClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new MediaServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new MediaServiceImpl(inner1, this.manager())); + } + + public MediaService getByResourceGroup(String resourceGroupName, String accountName) { + MediaServiceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new MediaServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MediaServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); + } + + public void syncStorageKeys(String resourceGroupName, String accountName, SyncStorageKeysInput parameters) { + this.serviceClient().syncStorageKeys(resourceGroupName, accountName, parameters); + } + + public Response syncStorageKeysWithResponse( + String resourceGroupName, String accountName, SyncStorageKeysInput parameters, Context context) { + return this.serviceClient().syncStorageKeysWithResponse(resourceGroupName, accountName, parameters, context); + } + + public EdgePolicies listEdgePolicies( + String resourceGroupName, String accountName, ListEdgePoliciesInput parameters) { + EdgePoliciesInner inner = this.serviceClient().listEdgePolicies(resourceGroupName, accountName, parameters); + if (inner != null) { + return new EdgePoliciesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listEdgePoliciesWithResponse( + String resourceGroupName, String accountName, ListEdgePoliciesInput parameters, Context context) { + Response inner = + this.serviceClient().listEdgePoliciesWithResponse(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EdgePoliciesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new MediaServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new MediaServiceImpl(inner1, this.manager())); + } + + public MediaService getBySubscription(String accountName) { + MediaServiceInner inner = this.serviceClient().getBySubscription(accountName); + if (inner != null) { + return new MediaServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getBySubscriptionWithResponse(String accountName, Context context) { + Response inner = this.serviceClient().getBySubscriptionWithResponse(accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MediaServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MediaService getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, context); + } + + private MediaservicesClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public MediaServiceImpl define(String name) { + return new MediaServiceImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationImpl.java new file mode 100644 index 000000000000..0ffede8c66b5 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.OperationInner; +import com.azure.resourcemanager.mediaservices.models.Operation; +import com.azure.resourcemanager.mediaservices.models.OperationDisplay; +import com.azure.resourcemanager.mediaservices.models.Properties; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final MediaservicesManager serviceManager; + + public OperationImpl(OperationInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Properties properties() { + return this.innerModel().properties(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..1ee219337001 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.OperationsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.OperationInner; +import com.azure.resourcemanager.mediaservices.models.OperationCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesOp") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Media/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the Media Services operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the Media Services operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * Lists all the Media Services operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Media Services operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the Media Services operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the Media Services operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsImpl.java new file mode 100644 index 000000000000..8d46e76fdf1e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.OperationsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.OperationInner; +import com.azure.resourcemanager.mediaservices.models.Operation; +import com.azure.resourcemanager.mediaservices.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final MediaservicesManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..e55d3fdb7735 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpoint; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnection; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.mediaservices.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String name; + + public PrivateEndpointConnectionImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, accountName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, accountName, name, this.innerModel(), context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, accountName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, accountName, name, this.innerModel(), context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaservices"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, accountName, name, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, accountName, name, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionListResultImpl.java new file mode 100644 index 000000000000..5f94cdb17dac --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionListResultImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnection; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnectionListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateEndpointConnectionListResultImpl implements PrivateEndpointConnectionListResult { + private PrivateEndpointConnectionListResultInner innerObject; + + private final MediaservicesManager serviceManager; + + public PrivateEndpointConnectionListResultImpl( + PrivateEndpointConnectionListResultInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpointConnectionListResultInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..679c654ac6f9 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,780 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesPrivateEndpointConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesPr") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/privateEndpointConnections/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/privateEndpointConnections/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/privateEndpointConnections/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all private endpoint connections. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get all private endpoint connections. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get all private endpoint connections. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get all private endpoint connections. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionListResultInner list(String resourceGroupName, String accountName) { + return listAsync(resourceGroupName, accountName).block(); + } + + /** + * Get all private endpoint connections. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Get private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + name, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String name) { + return getWithResponseAsync(resourceGroupName, accountName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String accountName, String name) { + return getAsync(resourceGroupName, accountName, name).block(); + } + + /** + * Get private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, name, context).block(); + } + + /** + * Update private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param parameters The Private Endpoint Connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String name, PrivateEndpointConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + name, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param parameters The Private Endpoint Connection resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String name, + PrivateEndpointConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + name, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param parameters The Private Endpoint Connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String name, PrivateEndpointConnectionInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, name, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param parameters The Private Endpoint Connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, String accountName, String name, PrivateEndpointConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, accountName, name, parameters).block(); + } + + /** + * Update private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param parameters The Private Endpoint Connection resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String name, + PrivateEndpointConnectionInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, name, parameters, context).block(); + } + + /** + * Delete private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + name, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String name) { + return deleteWithResponseAsync(resourceGroupName, accountName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String name) { + deleteAsync(resourceGroupName, accountName, name).block(); + } + + /** + * Delete private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, name, context).block(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..4dc501f6d270 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnection; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final MediaservicesManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnectionListResult list(String resourceGroupName, String accountName) { + PrivateEndpointConnectionListResultInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new PrivateEndpointConnectionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get(String resourceGroupName, String accountName, String name) { + PrivateEndpointConnectionInner inner = this.serviceClient().get(resourceGroupName, accountName, name); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String name) { + this.serviceClient().delete(resourceGroupName, accountName, name); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, name, context); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, accountName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, accountName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.deleteWithResponse(resourceGroupName, accountName, name, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, name, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..cdf3599f9a51 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mediaservices.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final MediaservicesManager serviceManager; + + public PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceListResultImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 000000000000..48e7e7049aa7 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.mediaservices.models.PrivateLinkResource; +import com.azure.resourcemanager.mediaservices.models.PrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; + + private final MediaservicesManager serviceManager; + + public PrivateLinkResourceListResultImpl( + PrivateLinkResourceListResultInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..ab45bbd0a212 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesPr") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/privateLinkResources/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get list of group IDs. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of group IDs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get list of group IDs. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of group IDs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get list of group IDs. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of group IDs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get list of group IDs. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of group IDs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner list(String resourceGroupName, String accountName) { + return listAsync(resourceGroupName, accountName).block(); + } + + /** + * Get list of group IDs. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of group IDs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Get group ID. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return group ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + name, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get group ID. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return group ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get group ID. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return group ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String name) { + return getWithResponseAsync(resourceGroupName, accountName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get group ID. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return group ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String accountName, String name) { + return getAsync(resourceGroupName, accountName, name).block(); + } + + /** + * Get group ID. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return group ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, name, context).block(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..b04f768a2221 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.mediaservices.models.PrivateLinkResource; +import com.azure.resourcemanager.mediaservices.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.mediaservices.models.PrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final MediaservicesManager serviceManager; + + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateLinkResourceListResult list(String resourceGroupName, String accountName) { + PrivateLinkResourceListResultInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResource get(String resourceGroupName, String accountName, String name) { + PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, accountName, name); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StorageEncryptedAssetDecryptionDataImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StorageEncryptedAssetDecryptionDataImpl.java new file mode 100644 index 000000000000..749f1b909d7e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StorageEncryptedAssetDecryptionDataImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.StorageEncryptedAssetDecryptionDataInner; +import com.azure.resourcemanager.mediaservices.models.AssetFileEncryptionMetadata; +import com.azure.resourcemanager.mediaservices.models.StorageEncryptedAssetDecryptionData; +import java.util.Collections; +import java.util.List; + +public final class StorageEncryptedAssetDecryptionDataImpl implements StorageEncryptedAssetDecryptionData { + private StorageEncryptedAssetDecryptionDataInner innerObject; + + private final MediaservicesManager serviceManager; + + public StorageEncryptedAssetDecryptionDataImpl( + StorageEncryptedAssetDecryptionDataInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public byte[] key() { + return this.innerModel().key(); + } + + public List assetFileEncryptionMetadata() { + List inner = this.innerModel().assetFileEncryptionMetadata(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public StorageEncryptedAssetDecryptionDataInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointImpl.java new file mode 100644 index 000000000000..7298ef9c87cf --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointImpl.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner; +import com.azure.resourcemanager.mediaservices.models.CrossSiteAccessPolicies; +import com.azure.resourcemanager.mediaservices.models.StreamingEndpoint; +import com.azure.resourcemanager.mediaservices.models.StreamingEndpointAccessControl; +import com.azure.resourcemanager.mediaservices.models.StreamingEndpointResourceState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class StreamingEndpointImpl + implements StreamingEndpoint, StreamingEndpoint.Definition, StreamingEndpoint.Update { + private StreamingEndpointInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String description() { + return this.innerModel().description(); + } + + public Integer scaleUnits() { + return this.innerModel().scaleUnits(); + } + + public String availabilitySetName() { + return this.innerModel().availabilitySetName(); + } + + public StreamingEndpointAccessControl accessControl() { + return this.innerModel().accessControl(); + } + + public Long maxCacheAge() { + return this.innerModel().maxCacheAge(); + } + + public List customHostNames() { + List inner = this.innerModel().customHostNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Boolean cdnEnabled() { + return this.innerModel().cdnEnabled(); + } + + public String cdnProvider() { + return this.innerModel().cdnProvider(); + } + + public String cdnProfile() { + return this.innerModel().cdnProfile(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public StreamingEndpointResourceState resourceState() { + return this.innerModel().resourceState(); + } + + public CrossSiteAccessPolicies crossSiteAccessPolicies() { + return this.innerModel().crossSiteAccessPolicies(); + } + + public OffsetDateTime freeTrialEndTime() { + return this.innerModel().freeTrialEndTime(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public StreamingEndpointInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String streamingEndpointName; + + private Boolean createAutoStart; + + public StreamingEndpointImpl withExistingMediaservice(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public StreamingEndpoint create() { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingEndpoints() + .create( + resourceGroupName, + accountName, + streamingEndpointName, + this.innerModel(), + createAutoStart, + Context.NONE); + return this; + } + + public StreamingEndpoint create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingEndpoints() + .create( + resourceGroupName, accountName, streamingEndpointName, this.innerModel(), createAutoStart, context); + return this; + } + + public StreamingEndpointImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new StreamingEndpointInner(); + this.serviceManager = serviceManager; + this.streamingEndpointName = name; + this.createAutoStart = null; + } + + public StreamingEndpointImpl update() { + return this; + } + + public StreamingEndpoint apply() { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingEndpoints() + .update(resourceGroupName, accountName, streamingEndpointName, this.innerModel(), Context.NONE); + return this; + } + + public StreamingEndpoint apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingEndpoints() + .update(resourceGroupName, accountName, streamingEndpointName, this.innerModel(), context); + return this; + } + + public StreamingEndpointImpl(StreamingEndpointInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaservices"); + this.streamingEndpointName = Utils.getValueFromIdByName(innerObject.id(), "streamingEndpoints"); + } + + public StreamingEndpoint refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingEndpoints() + .getWithResponse(resourceGroupName, accountName, streamingEndpointName, Context.NONE) + .getValue(); + return this; + } + + public StreamingEndpoint refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingEndpoints() + .getWithResponse(resourceGroupName, accountName, streamingEndpointName, context) + .getValue(); + return this; + } + + public StreamingEndpointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public StreamingEndpointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public StreamingEndpointImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public StreamingEndpointImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public StreamingEndpointImpl withScaleUnits(Integer scaleUnits) { + this.innerModel().withScaleUnits(scaleUnits); + return this; + } + + public StreamingEndpointImpl withAvailabilitySetName(String availabilitySetName) { + this.innerModel().withAvailabilitySetName(availabilitySetName); + return this; + } + + public StreamingEndpointImpl withAccessControl(StreamingEndpointAccessControl accessControl) { + this.innerModel().withAccessControl(accessControl); + return this; + } + + public StreamingEndpointImpl withMaxCacheAge(Long maxCacheAge) { + this.innerModel().withMaxCacheAge(maxCacheAge); + return this; + } + + public StreamingEndpointImpl withCustomHostNames(List customHostNames) { + this.innerModel().withCustomHostNames(customHostNames); + return this; + } + + public StreamingEndpointImpl withCdnEnabled(Boolean cdnEnabled) { + this.innerModel().withCdnEnabled(cdnEnabled); + return this; + } + + public StreamingEndpointImpl withCdnProvider(String cdnProvider) { + this.innerModel().withCdnProvider(cdnProvider); + return this; + } + + public StreamingEndpointImpl withCdnProfile(String cdnProfile) { + this.innerModel().withCdnProfile(cdnProfile); + return this; + } + + public StreamingEndpointImpl withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) { + this.innerModel().withCrossSiteAccessPolicies(crossSiteAccessPolicies); + return this; + } + + public StreamingEndpointImpl withAutoStart(Boolean autoStart) { + this.createAutoStart = autoStart; + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsClientImpl.java new file mode 100644 index 000000000000..b9da820681c9 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsClientImpl.java @@ -0,0 +1,2408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mediaservices.fluent.StreamingEndpointsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner; +import com.azure.resourcemanager.mediaservices.models.StreamingEndpointListResult; +import com.azure.resourcemanager.mediaservices.models.StreamingEntityScaleUnit; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in StreamingEndpointsClient. */ +public final class StreamingEndpointsClientImpl implements StreamingEndpointsClient { + private final ClientLogger logger = new ClientLogger(StreamingEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final StreamingEndpointsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StreamingEndpointsClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(StreamingEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesStreamingEndpoints to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesSt") + private interface StreamingEndpointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/streamingEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/streamingEndpoints/{streamingEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingEndpointName") String streamingEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/streamingEndpoints/{streamingEndpointName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingEndpointName") String streamingEndpointName, + @QueryParam("api-version") String apiVersion, + @QueryParam("autoStart") Boolean autoStart, + @BodyParam("application/json") StreamingEndpointInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/streamingEndpoints/{streamingEndpointName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingEndpointName") String streamingEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StreamingEndpointInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/streamingEndpoints/{streamingEndpointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingEndpointName") String streamingEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/streamingEndpoints/{streamingEndpointName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingEndpointName") String streamingEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/streamingEndpoints/{streamingEndpointName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingEndpointName") String streamingEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices" + + "/{accountName}/streamingEndpoints/{streamingEndpointName}/scale") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> scale( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingEndpointName") String streamingEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StreamingEntityScaleUnit parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the streaming endpoints 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the streaming endpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * Lists the streaming endpoints 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the streaming endpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the streaming endpoints 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Lists the streaming endpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String streamingEndpointName) { + return getWithResponseAsync(resourceGroupName, accountName, streamingEndpointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingEndpointInner get(String resourceGroupName, String accountName, String streamingEndpointName) { + return getAsync(resourceGroupName, accountName, streamingEndpointName).block(); + } + + /** + * Gets a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, streamingEndpointName, context).block(); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + autoStart, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + autoStart, + parameters, + accept, + context); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StreamingEndpointInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StreamingEndpointInner.class, + StreamingEndpointInner.class, + Context.NONE); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StreamingEndpointInner> beginCreateAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, accountName, streamingEndpointName, parameters, autoStart, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StreamingEndpointInner.class, + StreamingEndpointInner.class, + context); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StreamingEndpointInner> beginCreate( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart) { + return beginCreateAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart) + .getSyncPoller(); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StreamingEndpointInner> beginCreate( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart, context) + .getSyncPoller(); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart) { + return beginCreateAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + final Boolean autoStart = null; + return beginCreateAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingEndpointInner create( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart) { + return createAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).block(); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingEndpointInner create( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + final Boolean autoStart = null; + return createAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).block(); + } + + /** + * Creates a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingEndpointInner create( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Boolean autoStart, + Context context) { + return createAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart, context) + .block(); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StreamingEndpointInner> beginUpdateAsync( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StreamingEndpointInner.class, + StreamingEndpointInner.class, + Context.NONE); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StreamingEndpointInner> beginUpdateAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StreamingEndpointInner.class, + StreamingEndpointInner.class, + context); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StreamingEndpointInner> beginUpdate( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginUpdateAsync(resourceGroupName, accountName, streamingEndpointName, parameters).getSyncPoller(); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StreamingEndpointInner> beginUpdate( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, streamingEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return beginUpdateAsync(resourceGroupName, accountName, streamingEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, streamingEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingEndpointInner update( + String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { + return updateAsync(resourceGroupName, accountName, streamingEndpointName, parameters).block(); + } + + /** + * Updates a existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters The streaming endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingEndpointInner update( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEndpointInner parameters, + Context context) { + return updateAsync(resourceGroupName, accountName, streamingEndpointName, parameters, context).block(); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String streamingEndpointName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, streamingEndpointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, accountName, streamingEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String streamingEndpointName) { + return beginDeleteAsync(resourceGroupName, accountName, streamingEndpointName).getSyncPoller(); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, streamingEndpointName, context).getSyncPoller(); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginDeleteAsync(resourceGroupName, accountName, streamingEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, streamingEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String streamingEndpointName) { + deleteAsync(resourceGroupName, accountName, streamingEndpointName).block(); + } + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + deleteAsync(resourceGroupName, accountName, streamingEndpointName, context).block(); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String accountName, String streamingEndpointName) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, accountName, streamingEndpointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, accountName, streamingEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStartAsync(resourceGroupName, accountName, streamingEndpointName).getSyncPoller(); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + return beginStartAsync(resourceGroupName, accountName, streamingEndpointName, context).getSyncPoller(); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStartAsync(resourceGroupName, accountName, streamingEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + return beginStartAsync(resourceGroupName, accountName, streamingEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String accountName, String streamingEndpointName) { + startAsync(resourceGroupName, accountName, streamingEndpointName).block(); + } + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + startAsync(resourceGroupName, accountName, streamingEndpointName, context).block(); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String accountName, String streamingEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String accountName, String streamingEndpointName) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, accountName, streamingEndpointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, accountName, streamingEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStopAsync(resourceGroupName, accountName, streamingEndpointName).getSyncPoller(); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + return beginStopAsync(resourceGroupName, accountName, streamingEndpointName, context).getSyncPoller(); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String accountName, String streamingEndpointName) { + return beginStopAsync(resourceGroupName, accountName, streamingEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + return beginStopAsync(resourceGroupName, accountName, streamingEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String accountName, String streamingEndpointName) { + stopAsync(resourceGroupName, accountName, streamingEndpointName).block(); + } + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + stopAsync(resourceGroupName, accountName, streamingEndpointName, context).block(); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> scaleWithResponseAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .scale( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> scaleWithResponseAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .scale( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingEndpointName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginScaleAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters) { + Mono>> mono = + scaleWithResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginScaleAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + scaleWithResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginScale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters) { + return beginScaleAsync(resourceGroupName, accountName, streamingEndpointName, parameters).getSyncPoller(); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginScale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters, + Context context) { + return beginScaleAsync(resourceGroupName, accountName, streamingEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scaleAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters) { + return beginScaleAsync(resourceGroupName, accountName, streamingEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scaleAsync( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters, + Context context) { + return beginScaleAsync(resourceGroupName, accountName, streamingEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void scale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters) { + scaleAsync(resourceGroupName, accountName, streamingEndpointName, parameters).block(); + } + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void scale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters, + Context context) { + scaleAsync(resourceGroupName, accountName, streamingEndpointName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsImpl.java new file mode 100644 index 000000000000..15be958df4fa --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsImpl.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.StreamingEndpointsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner; +import com.azure.resourcemanager.mediaservices.models.StreamingEndpoint; +import com.azure.resourcemanager.mediaservices.models.StreamingEndpoints; +import com.azure.resourcemanager.mediaservices.models.StreamingEntityScaleUnit; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class StreamingEndpointsImpl implements StreamingEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingEndpointsImpl.class); + + private final StreamingEndpointsClient innerClient; + + private final MediaservicesManager serviceManager; + + public StreamingEndpointsImpl(StreamingEndpointsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new StreamingEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, context); + return inner.mapPage(inner1 -> new StreamingEndpointImpl(inner1, this.manager())); + } + + public StreamingEndpoint get(String resourceGroupName, String accountName, String streamingEndpointName) { + StreamingEndpointInner inner = this.serviceClient().get(resourceGroupName, accountName, streamingEndpointName); + if (inner != null) { + return new StreamingEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, streamingEndpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StreamingEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String streamingEndpointName) { + this.serviceClient().delete(resourceGroupName, accountName, streamingEndpointName); + } + + public void delete(String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, streamingEndpointName, context); + } + + public void start(String resourceGroupName, String accountName, String streamingEndpointName) { + this.serviceClient().start(resourceGroupName, accountName, streamingEndpointName); + } + + public void start(String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + this.serviceClient().start(resourceGroupName, accountName, streamingEndpointName, context); + } + + public void stop(String resourceGroupName, String accountName, String streamingEndpointName) { + this.serviceClient().stop(resourceGroupName, accountName, streamingEndpointName); + } + + public void stop(String resourceGroupName, String accountName, String streamingEndpointName, Context context) { + this.serviceClient().stop(resourceGroupName, accountName, streamingEndpointName, context); + } + + public void scale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters) { + this.serviceClient().scale(resourceGroupName, accountName, streamingEndpointName, parameters); + } + + public void scale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters, + Context context) { + this.serviceClient().scale(resourceGroupName, accountName, streamingEndpointName, parameters, context); + } + + public StreamingEndpoint getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String streamingEndpointName = Utils.getValueFromIdByName(id, "streamingEndpoints"); + if (streamingEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingEndpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, streamingEndpointName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String streamingEndpointName = Utils.getValueFromIdByName(id, "streamingEndpoints"); + if (streamingEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingEndpoints'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, streamingEndpointName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String streamingEndpointName = Utils.getValueFromIdByName(id, "streamingEndpoints"); + if (streamingEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingEndpoints'.", id))); + } + this.delete(resourceGroupName, accountName, streamingEndpointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaservices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaservices'.", id))); + } + String streamingEndpointName = Utils.getValueFromIdByName(id, "streamingEndpoints"); + if (streamingEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingEndpoints'.", id))); + } + this.delete(resourceGroupName, accountName, streamingEndpointName, context); + } + + private StreamingEndpointsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public StreamingEndpointImpl define(String name) { + return new StreamingEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorImpl.java new file mode 100644 index 000000000000..a900b182af74 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingLocatorInner; +import com.azure.resourcemanager.mediaservices.models.StreamingLocator; +import com.azure.resourcemanager.mediaservices.models.StreamingLocatorContentKey; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +public final class StreamingLocatorImpl implements StreamingLocator, StreamingLocator.Definition { + private StreamingLocatorInner innerObject; + + private final MediaservicesManager serviceManager; + + public StreamingLocatorImpl(StreamingLocatorInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String assetName() { + return this.innerModel().assetName(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public UUID streamingLocatorId() { + return this.innerModel().streamingLocatorId(); + } + + public String streamingPolicyName() { + return this.innerModel().streamingPolicyName(); + } + + public String defaultContentKeyPolicyName() { + return this.innerModel().defaultContentKeyPolicyName(); + } + + public List contentKeys() { + List inner = this.innerModel().contentKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String alternativeMediaId() { + return this.innerModel().alternativeMediaId(); + } + + public List filters() { + List inner = this.innerModel().filters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public StreamingLocatorInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String streamingLocatorName; + + public StreamingLocatorImpl withExistingMediaService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public StreamingLocator create() { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingLocators() + .createWithResponse( + resourceGroupName, accountName, streamingLocatorName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public StreamingLocator create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingLocators() + .createWithResponse(resourceGroupName, accountName, streamingLocatorName, this.innerModel(), context) + .getValue(); + return this; + } + + public StreamingLocatorImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new StreamingLocatorInner(); + this.serviceManager = serviceManager; + this.streamingLocatorName = name; + } + + public StreamingLocator refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingLocators() + .getWithResponse(resourceGroupName, accountName, streamingLocatorName, Context.NONE) + .getValue(); + return this; + } + + public StreamingLocator refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingLocators() + .getWithResponse(resourceGroupName, accountName, streamingLocatorName, context) + .getValue(); + return this; + } + + public StreamingLocatorImpl withAssetName(String assetName) { + this.innerModel().withAssetName(assetName); + return this; + } + + public StreamingLocatorImpl withStartTime(OffsetDateTime startTime) { + this.innerModel().withStartTime(startTime); + return this; + } + + public StreamingLocatorImpl withEndTime(OffsetDateTime endTime) { + this.innerModel().withEndTime(endTime); + return this; + } + + public StreamingLocatorImpl withStreamingLocatorId(UUID streamingLocatorId) { + this.innerModel().withStreamingLocatorId(streamingLocatorId); + return this; + } + + public StreamingLocatorImpl withStreamingPolicyName(String streamingPolicyName) { + this.innerModel().withStreamingPolicyName(streamingPolicyName); + return this; + } + + public StreamingLocatorImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.innerModel().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); + return this; + } + + public StreamingLocatorImpl withContentKeys(List contentKeys) { + this.innerModel().withContentKeys(contentKeys); + return this; + } + + public StreamingLocatorImpl withAlternativeMediaId(String alternativeMediaId) { + this.innerModel().withAlternativeMediaId(alternativeMediaId); + return this; + } + + public StreamingLocatorImpl withFilters(List filters) { + this.innerModel().withFilters(filters); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsClientImpl.java new file mode 100644 index 000000000000..517b26373e36 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsClientImpl.java @@ -0,0 +1,1322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.StreamingLocatorsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.ListContentKeysResponseInner; +import com.azure.resourcemanager.mediaservices.fluent.models.ListPathsResponseInner; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingLocatorInner; +import com.azure.resourcemanager.mediaservices.models.StreamingLocatorCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in StreamingLocatorsClient. */ +public final class StreamingLocatorsClientImpl implements StreamingLocatorsClient { + private final ClientLogger logger = new ClientLogger(StreamingLocatorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final StreamingLocatorsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingLocatorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StreamingLocatorsClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(StreamingLocatorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesStreamingLocators to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesSt") + private interface StreamingLocatorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingLocators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingLocators/{streamingLocatorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingLocatorName") String streamingLocatorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingLocators/{streamingLocatorName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingLocatorName") String streamingLocatorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StreamingLocatorInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingLocators/{streamingLocatorName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingLocatorName") String streamingLocatorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingLocators/{streamingLocatorName}/listContentKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listContentKeys( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingLocatorName") String streamingLocatorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingLocators/{streamingLocatorName}/listPaths") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPaths( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingLocatorName") String streamingLocatorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + top, + orderby, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + top, + orderby, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * 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 key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, top, orderby)); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, top, orderby, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String streamingLocatorName) { + return getWithResponseAsync(resourceGroupName, accountName, streamingLocatorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingLocatorInner get(String resourceGroupName, String accountName, String streamingLocatorName) { + return getAsync(resourceGroupName, accountName, streamingLocatorName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, streamingLocatorName, context).block(); + } + + /** + * 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 A Streaming Locator resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Locator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 A Streaming Locator resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Locator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String accountName, + String streamingLocatorName, + StreamingLocatorInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 A Streaming Locator resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Locator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + return createWithResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 A Streaming Locator resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Locator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingLocatorInner create( + String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { + return createAsync(resourceGroupName, accountName, streamingLocatorName, parameters).block(); + } + + /** + * 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 A Streaming Locator resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Locator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String accountName, + String streamingLocatorName, + StreamingLocatorInner parameters, + Context context) { + return createWithResponseAsync(resourceGroupName, accountName, streamingLocatorName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String streamingLocatorName) { + return deleteWithResponseAsync(resourceGroupName, accountName, streamingLocatorName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String streamingLocatorName) { + deleteAsync(resourceGroupName, accountName, streamingLocatorName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, streamingLocatorName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listContentKeys action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listContentKeysWithResponseAsync( + String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listContentKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listContentKeys action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listContentKeysWithResponseAsync( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listContentKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listContentKeys action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listContentKeysAsync( + String resourceGroupName, String accountName, String streamingLocatorName) { + return listContentKeysWithResponseAsync(resourceGroupName, accountName, streamingLocatorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listContentKeys action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListContentKeysResponseInner listContentKeys( + String resourceGroupName, String accountName, String streamingLocatorName) { + return listContentKeysAsync(resourceGroupName, accountName, streamingLocatorName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listContentKeys action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listContentKeysWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + return listContentKeysWithResponseAsync(resourceGroupName, accountName, streamingLocatorName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listPaths action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPathsWithResponseAsync( + String resourceGroupName, String accountName, String streamingLocatorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPaths( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listPaths action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPathsWithResponseAsync( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingLocatorName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPaths( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingLocatorName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listPaths action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listPathsAsync( + String resourceGroupName, String accountName, String streamingLocatorName) { + return listPathsWithResponseAsync(resourceGroupName, accountName, streamingLocatorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listPaths action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListPathsResponseInner listPaths(String resourceGroupName, String accountName, String streamingLocatorName) { + return listPathsAsync(resourceGroupName, accountName, streamingLocatorName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listPaths action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listPathsWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + return listPathsWithResponseAsync(resourceGroupName, accountName, streamingLocatorName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsImpl.java new file mode 100644 index 000000000000..29e47ec942b8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsImpl.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.StreamingLocatorsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.ListContentKeysResponseInner; +import com.azure.resourcemanager.mediaservices.fluent.models.ListPathsResponseInner; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingLocatorInner; +import com.azure.resourcemanager.mediaservices.models.ListContentKeysResponse; +import com.azure.resourcemanager.mediaservices.models.ListPathsResponse; +import com.azure.resourcemanager.mediaservices.models.StreamingLocator; +import com.azure.resourcemanager.mediaservices.models.StreamingLocators; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class StreamingLocatorsImpl implements StreamingLocators { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingLocatorsImpl.class); + + private final StreamingLocatorsClient innerClient; + + private final MediaservicesManager serviceManager; + + public StreamingLocatorsImpl(StreamingLocatorsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new StreamingLocatorImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, filter, top, orderby, context); + return inner.mapPage(inner1 -> new StreamingLocatorImpl(inner1, this.manager())); + } + + public StreamingLocator get(String resourceGroupName, String accountName, String streamingLocatorName) { + StreamingLocatorInner inner = this.serviceClient().get(resourceGroupName, accountName, streamingLocatorName); + if (inner != null) { + return new StreamingLocatorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, streamingLocatorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StreamingLocatorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String streamingLocatorName) { + this.serviceClient().delete(resourceGroupName, accountName, streamingLocatorName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, streamingLocatorName, context); + } + + public ListContentKeysResponse listContentKeys( + String resourceGroupName, String accountName, String streamingLocatorName) { + ListContentKeysResponseInner inner = + this.serviceClient().listContentKeys(resourceGroupName, accountName, streamingLocatorName); + if (inner != null) { + return new ListContentKeysResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listContentKeysWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + Response inner = + this + .serviceClient() + .listContentKeysWithResponse(resourceGroupName, accountName, streamingLocatorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ListContentKeysResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListPathsResponse listPaths(String resourceGroupName, String accountName, String streamingLocatorName) { + ListPathsResponseInner inner = + this.serviceClient().listPaths(resourceGroupName, accountName, streamingLocatorName); + if (inner != null) { + return new ListPathsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listPathsWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context) { + Response inner = + this.serviceClient().listPathsWithResponse(resourceGroupName, accountName, streamingLocatorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ListPathsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StreamingLocator getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String streamingLocatorName = Utils.getValueFromIdByName(id, "streamingLocators"); + if (streamingLocatorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingLocators'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, streamingLocatorName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String streamingLocatorName = Utils.getValueFromIdByName(id, "streamingLocators"); + if (streamingLocatorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingLocators'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, streamingLocatorName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String streamingLocatorName = Utils.getValueFromIdByName(id, "streamingLocators"); + if (streamingLocatorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingLocators'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, streamingLocatorName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String streamingLocatorName = Utils.getValueFromIdByName(id, "streamingLocators"); + if (streamingLocatorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingLocators'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, streamingLocatorName, context); + } + + private StreamingLocatorsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public StreamingLocatorImpl define(String name) { + return new StreamingLocatorImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesClientImpl.java new file mode 100644 index 000000000000..2b061676781b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesClientImpl.java @@ -0,0 +1,956 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.StreamingPoliciesClient; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner; +import com.azure.resourcemanager.mediaservices.models.StreamingPolicyCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in StreamingPoliciesClient. */ +public final class StreamingPoliciesClientImpl implements StreamingPoliciesClient { + private final ClientLogger logger = new ClientLogger(StreamingPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final StreamingPoliciesService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of StreamingPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StreamingPoliciesClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(StreamingPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesStreamingPolicies to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesSt") + private interface StreamingPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$orderby") String orderby, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingPolicies/{streamingPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingPolicyName") String streamingPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingPolicies/{streamingPolicyName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingPolicyName") String streamingPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StreamingPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/streamingPolicies/{streamingPolicyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("streamingPolicyName") String streamingPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + top, + orderby, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + top, + orderby, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * 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 key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, top, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, top, orderby)); + } + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, top, orderby, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String streamingPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingPolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String streamingPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingPolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String streamingPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, streamingPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingPolicyInner get(String resourceGroupName, String accountName, String streamingPolicyName) { + return getAsync(resourceGroupName, accountName, streamingPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String streamingPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, streamingPolicyName, context).block(); + } + + /** + * 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 A Streaming Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingPolicyName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 A Streaming Policy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String accountName, + String streamingPolicyName, + StreamingPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingPolicyName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 A Streaming Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + return createWithResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 A Streaming Policy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamingPolicyInner create( + String resourceGroupName, String accountName, String streamingPolicyName, StreamingPolicyInner parameters) { + return createAsync(resourceGroupName, accountName, streamingPolicyName, parameters).block(); + } + + /** + * 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 A Streaming Policy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Streaming Policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String accountName, + String streamingPolicyName, + StreamingPolicyInner parameters, + Context context) { + return createWithResponseAsync(resourceGroupName, accountName, streamingPolicyName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String streamingPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingPolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String streamingPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (streamingPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + streamingPolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String streamingPolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, streamingPolicyName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String streamingPolicyName) { + deleteAsync(resourceGroupName, accountName, streamingPolicyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String streamingPolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, streamingPolicyName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesImpl.java new file mode 100644 index 000000000000..e81317d8d5f5 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.StreamingPoliciesClient; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner; +import com.azure.resourcemanager.mediaservices.models.StreamingPolicies; +import com.azure.resourcemanager.mediaservices.models.StreamingPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class StreamingPoliciesImpl implements StreamingPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingPoliciesImpl.class); + + private final StreamingPoliciesClient innerClient; + + private final MediaservicesManager serviceManager; + + public StreamingPoliciesImpl(StreamingPoliciesClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new StreamingPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, filter, top, orderby, context); + return inner.mapPage(inner1 -> new StreamingPolicyImpl(inner1, this.manager())); + } + + public StreamingPolicy get(String resourceGroupName, String accountName, String streamingPolicyName) { + StreamingPolicyInner inner = this.serviceClient().get(resourceGroupName, accountName, streamingPolicyName); + if (inner != null) { + return new StreamingPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String streamingPolicyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, streamingPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StreamingPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String streamingPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, streamingPolicyName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String streamingPolicyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, streamingPolicyName, context); + } + + public StreamingPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String streamingPolicyName = Utils.getValueFromIdByName(id, "streamingPolicies"); + if (streamingPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, streamingPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String streamingPolicyName = Utils.getValueFromIdByName(id, "streamingPolicies"); + if (streamingPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, streamingPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String streamingPolicyName = Utils.getValueFromIdByName(id, "streamingPolicies"); + if (streamingPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingPolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, streamingPolicyName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String streamingPolicyName = Utils.getValueFromIdByName(id, "streamingPolicies"); + if (streamingPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'streamingPolicies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, streamingPolicyName, context); + } + + private StreamingPoliciesClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public StreamingPolicyImpl define(String name) { + return new StreamingPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPolicyImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPolicyImpl.java new file mode 100644 index 000000000000..d29738af7dd1 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPolicyImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner; +import com.azure.resourcemanager.mediaservices.models.CommonEncryptionCbcs; +import com.azure.resourcemanager.mediaservices.models.CommonEncryptionCenc; +import com.azure.resourcemanager.mediaservices.models.EnvelopeEncryption; +import com.azure.resourcemanager.mediaservices.models.NoEncryption; +import com.azure.resourcemanager.mediaservices.models.StreamingPolicy; +import java.time.OffsetDateTime; + +public final class StreamingPolicyImpl implements StreamingPolicy, StreamingPolicy.Definition { + private StreamingPolicyInner innerObject; + + private final MediaservicesManager serviceManager; + + public StreamingPolicyImpl(StreamingPolicyInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public String defaultContentKeyPolicyName() { + return this.innerModel().defaultContentKeyPolicyName(); + } + + public EnvelopeEncryption envelopeEncryption() { + return this.innerModel().envelopeEncryption(); + } + + public CommonEncryptionCenc commonEncryptionCenc() { + return this.innerModel().commonEncryptionCenc(); + } + + public CommonEncryptionCbcs commonEncryptionCbcs() { + return this.innerModel().commonEncryptionCbcs(); + } + + public NoEncryption noEncryption() { + return this.innerModel().noEncryption(); + } + + public StreamingPolicyInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String streamingPolicyName; + + public StreamingPolicyImpl withExistingMediaService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public StreamingPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingPolicies() + .createWithResponse( + resourceGroupName, accountName, streamingPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public StreamingPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingPolicies() + .createWithResponse(resourceGroupName, accountName, streamingPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + public StreamingPolicyImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new StreamingPolicyInner(); + this.serviceManager = serviceManager; + this.streamingPolicyName = name; + } + + public StreamingPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingPolicies() + .getWithResponse(resourceGroupName, accountName, streamingPolicyName, Context.NONE) + .getValue(); + return this; + } + + public StreamingPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStreamingPolicies() + .getWithResponse(resourceGroupName, accountName, streamingPolicyName, context) + .getValue(); + return this; + } + + public StreamingPolicyImpl withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName) { + this.innerModel().withDefaultContentKeyPolicyName(defaultContentKeyPolicyName); + return this; + } + + public StreamingPolicyImpl withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption) { + this.innerModel().withEnvelopeEncryption(envelopeEncryption); + return this; + } + + public StreamingPolicyImpl withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc) { + this.innerModel().withCommonEncryptionCenc(commonEncryptionCenc); + return this; + } + + public StreamingPolicyImpl withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs) { + this.innerModel().withCommonEncryptionCbcs(commonEncryptionCbcs); + return this; + } + + public StreamingPolicyImpl withNoEncryption(NoEncryption noEncryption) { + this.innerModel().withNoEncryption(noEncryption); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformImpl.java new file mode 100644 index 000000000000..e29322b42421 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.models.TransformInner; +import com.azure.resourcemanager.mediaservices.models.Transform; +import com.azure.resourcemanager.mediaservices.models.TransformOutput; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class TransformImpl implements Transform, Transform.Definition, Transform.Update { + private TransformInner innerObject; + + private final MediaservicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public String description() { + return this.innerModel().description(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public List outputs() { + List inner = this.innerModel().outputs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TransformInner innerModel() { + return this.innerObject; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String transformName; + + public TransformImpl withExistingMediaService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public Transform create() { + this.innerObject = + serviceManager + .serviceClient() + .getTransforms() + .createOrUpdateWithResponse( + resourceGroupName, accountName, transformName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Transform create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTransforms() + .createOrUpdateWithResponse(resourceGroupName, accountName, transformName, this.innerModel(), context) + .getValue(); + return this; + } + + public TransformImpl(String name, MediaservicesManager serviceManager) { + this.innerObject = new TransformInner(); + this.serviceManager = serviceManager; + this.transformName = name; + } + + public TransformImpl update() { + return this; + } + + public Transform apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTransforms() + .updateWithResponse(resourceGroupName, accountName, transformName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Transform apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTransforms() + .updateWithResponse(resourceGroupName, accountName, transformName, this.innerModel(), context) + .getValue(); + return this; + } + + public TransformImpl(TransformInner innerObject, MediaservicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "mediaServices"); + this.transformName = Utils.getValueFromIdByName(innerObject.id(), "transforms"); + } + + public Transform refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTransforms() + .getWithResponse(resourceGroupName, accountName, transformName, Context.NONE) + .getValue(); + return this; + } + + public Transform refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTransforms() + .getWithResponse(resourceGroupName, accountName, transformName, context) + .getValue(); + return this; + } + + public TransformImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public TransformImpl withOutputs(List outputs) { + this.innerModel().withOutputs(outputs); + return this; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsClientImpl.java new file mode 100644 index 000000000000..dcd89fc92607 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsClientImpl.java @@ -0,0 +1,1171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.TransformsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.TransformInner; +import com.azure.resourcemanager.mediaservices.models.TransformCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TransformsClient. */ +public final class TransformsClientImpl implements TransformsClient { + private final ClientLogger logger = new ClientLogger(TransformsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TransformsService service; + + /** The service client containing this operation class. */ + private final AzureMediaServicesImpl client; + + /** + * Initializes an instance of TransformsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TransformsClientImpl(AzureMediaServicesImpl client) { + this.service = + RestProxy.create(TransformsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMediaServicesTransforms to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMediaServicesTr") + private interface TransformsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$orderby") String orderby, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TransformInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices" + + "/{accountName}/transforms/{transformName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("transformName") String transformName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TransformInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + orderby, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String filter, String orderby, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + filter, + orderby, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, String orderby) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String filter = null; + final String orderby = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, orderby), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String filter, String orderby, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, filter, orderby, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String filter = null; + final String orderby = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, orderby)); + } + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String filter, String orderby, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, filter, orderby, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String transformName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String transformName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String transformName) { + return getWithResponseAsync(resourceGroupName, accountName, transformName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransformInner get(String resourceGroupName, String accountName, String transformName) { + return getAsync(resourceGroupName, accountName, transformName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String transformName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, transformName, context).block(); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String transformName, + TransformInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, transformName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransformInner createOrUpdate( + String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return createOrUpdateAsync(resourceGroupName, accountName, transformName, parameters).block(); + } + + /** + * 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String transformName, + TransformInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, transformName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String transformName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String transformName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String transformName) { + return deleteWithResponseAsync(resourceGroupName, accountName, transformName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String transformName) { + deleteAsync(resourceGroupName, accountName, transformName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String transformName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, transformName, context).block(); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String transformName, + TransformInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (transformName == null) { + return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + transformName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, transformName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransformInner update( + String resourceGroupName, String accountName, String transformName, TransformInner parameters) { + return updateAsync(resourceGroupName, accountName, transformName, parameters).block(); + } + + /** + * 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform encapsulates the rules or instructions for generating desired outputs from input media, such + * as by transcoding or by extracting insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String transformName, + TransformInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, transformName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().odataNextLink(), + null)); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsImpl.java new file mode 100644 index 000000000000..7654fbfc744b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.MediaservicesManager; +import com.azure.resourcemanager.mediaservices.fluent.TransformsClient; +import com.azure.resourcemanager.mediaservices.fluent.models.TransformInner; +import com.azure.resourcemanager.mediaservices.models.Transform; +import com.azure.resourcemanager.mediaservices.models.Transforms; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TransformsImpl implements Transforms { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransformsImpl.class); + + private final TransformsClient innerClient; + + private final MediaservicesManager serviceManager; + + public TransformsImpl(TransformsClient innerClient, MediaservicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return inner.mapPage(inner1 -> new TransformImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String filter, String orderby, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, filter, orderby, context); + return inner.mapPage(inner1 -> new TransformImpl(inner1, this.manager())); + } + + public Transform get(String resourceGroupName, String accountName, String transformName) { + TransformInner inner = this.serviceClient().get(resourceGroupName, accountName, transformName); + if (inner != null) { + return new TransformImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String transformName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, transformName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TransformImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String transformName) { + this.serviceClient().delete(resourceGroupName, accountName, transformName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String transformName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, transformName, context); + } + + public Transform getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String transformName = Utils.getValueFromIdByName(id, "transforms"); + if (transformName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'transforms'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, transformName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String transformName = Utils.getValueFromIdByName(id, "transforms"); + if (transformName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'transforms'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, transformName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String transformName = Utils.getValueFromIdByName(id, "transforms"); + if (transformName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'transforms'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, transformName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "mediaServices"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id))); + } + String transformName = Utils.getValueFromIdByName(id, "transforms"); + if (transformName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'transforms'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, transformName, context); + } + + private TransformsClient serviceClient() { + return this.innerClient; + } + + private MediaservicesManager manager() { + return this.serviceManager; + } + + public TransformImpl define(String name) { + return new TransformImpl(name, this.manager()); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/Utils.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/Utils.java new file mode 100644 index 000000000000..e2a6c7628d11 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/Utils.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.implementation; + +import java.util.Arrays; +import java.util.Iterator; + +final class Utils { + 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().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/package-info.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/package-info.java new file mode 100644 index 000000000000..53a17e4282ef --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for AzureMediaServices. This Swagger was generated by the API Framework. */ +package com.azure.resourcemanager.mediaservices.implementation; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AacAudio.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AacAudio.java new file mode 100644 index 000000000000..3d1849b019f3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AacAudio.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Fluent +public class AacAudio extends Audio { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AacAudio.class); + + /* + * The encoding profile to be used when encoding audio with AAC. + */ + @JsonProperty(value = "profile") + private AacAudioProfile profile; + + /** + * Get the profile property: The encoding profile to be used when encoding audio with AAC. + * + * @return the profile value. + */ + public AacAudioProfile profile() { + return this.profile; + } + + /** + * Set the profile property: The encoding profile to be used when encoding audio with AAC. + * + * @param profile the profile value to set. + * @return the AacAudio object itself. + */ + public AacAudio withProfile(AacAudioProfile profile) { + this.profile = profile; + return this; + } + + /** {@inheritDoc} */ + @Override + public AacAudio withChannels(Integer channels) { + super.withChannels(channels); + return this; + } + + /** {@inheritDoc} */ + @Override + public AacAudio withSamplingRate(Integer samplingRate) { + super.withSamplingRate(samplingRate); + return this; + } + + /** {@inheritDoc} */ + @Override + public AacAudio withBitrate(Integer bitrate) { + super.withBitrate(bitrate); + return this; + } + + /** {@inheritDoc} */ + @Override + public AacAudio withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AacAudioProfile.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AacAudioProfile.java new file mode 100644 index 000000000000..25a1b3c2d7f8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AacAudioProfile.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AacAudioProfile. */ +public final class AacAudioProfile extends ExpandableStringEnum { + /** Static value AacLc for AacAudioProfile. */ + public static final AacAudioProfile AAC_LC = fromString("AacLc"); + + /** Static value HeAacV1 for AacAudioProfile. */ + public static final AacAudioProfile HE_AAC_V1 = fromString("HeAacV1"); + + /** Static value HeAacV2 for AacAudioProfile. */ + public static final AacAudioProfile HE_AAC_V2 = fromString("HeAacV2"); + + /** + * Creates or finds a AacAudioProfile from its string representation. + * + * @param name a name to look for. + * @return the corresponding AacAudioProfile. + */ + @JsonCreator + public static AacAudioProfile fromString(String name) { + return fromString(name, AacAudioProfile.class); + } + + /** @return known AacAudioProfile values. */ + public static Collection values() { + return values(AacAudioProfile.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AbsoluteClipTime.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AbsoluteClipTime.java new file mode 100644 index 000000000000..7ef886029bf9 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AbsoluteClipTime.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; + +/** + * Specifies the clip time as an absolute time position in the media file. The absolute time can point to a different + * position depending on whether the media file starts from a timestamp of zero or not. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.AbsoluteClipTime") +@JsonFlatten +@Fluent +public class AbsoluteClipTime extends ClipTime { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AbsoluteClipTime.class); + + /* + * The time position on the timeline of the input media. It is usually + * specified as an ISO8601 period. e.g PT30S for 30 seconds. + */ + @JsonProperty(value = "time", required = true) + private Duration time; + + /** + * Get the time property: The time position on the timeline of the input media. It is usually specified as an + * ISO8601 period. e.g PT30S for 30 seconds. + * + * @return the time value. + */ + public Duration time() { + return this.time; + } + + /** + * Set the time property: The time position on the timeline of the input media. It is usually specified as an + * ISO8601 period. e.g PT30S for 30 seconds. + * + * @param time the time value to set. + * @return the AbsoluteClipTime object itself. + */ + public AbsoluteClipTime withTime(Duration time) { + this.time = time; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (time() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property time in model AbsoluteClipTime")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountEncryption.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountEncryption.java new file mode 100644 index 000000000000..55456658f5c1 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountEncryption.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AccountEncryption model. */ +@Fluent +public final class AccountEncryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountEncryption.class); + + /* + * The type of key used to encrypt the Account Key. + */ + @JsonProperty(value = "type", required = true) + private AccountEncryptionKeyType type; + + /* + * The properties of the key used to encrypt the account. + */ + @JsonProperty(value = "keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Get the type property: The type of key used to encrypt the Account Key. + * + * @return the type value. + */ + public AccountEncryptionKeyType type() { + return this.type; + } + + /** + * Set the type property: The type of key used to encrypt the Account Key. + * + * @param type the type value to set. + * @return the AccountEncryption object itself. + */ + public AccountEncryption withType(AccountEncryptionKeyType type) { + this.type = type; + return this; + } + + /** + * Get the keyVaultProperties property: The properties of the key used to encrypt the account. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The properties of the key used to encrypt the account. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the AccountEncryption object itself. + */ + public AccountEncryption withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model AccountEncryption")); + } + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountEncryptionKeyType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountEncryptionKeyType.java new file mode 100644 index 000000000000..faa5b2250652 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountEncryptionKeyType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccountEncryptionKeyType. */ +public final class AccountEncryptionKeyType extends ExpandableStringEnum { + /** Static value SystemKey for AccountEncryptionKeyType. */ + public static final AccountEncryptionKeyType SYSTEM_KEY = fromString("SystemKey"); + + /** Static value CustomerKey for AccountEncryptionKeyType. */ + public static final AccountEncryptionKeyType CUSTOMER_KEY = fromString("CustomerKey"); + + /** + * Creates or finds a AccountEncryptionKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccountEncryptionKeyType. + */ + @JsonCreator + public static AccountEncryptionKeyType fromString(String name) { + return fromString(name, AccountEncryptionKeyType.class); + } + + /** @return known AccountEncryptionKeyType values. */ + public static Collection values() { + return values(AccountEncryptionKeyType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilter.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilter.java new file mode 100644 index 000000000000..5da931e30225 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilter.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner; +import java.util.List; + +/** An immutable client-side representation of AccountFilter. */ +public interface AccountFilter { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the presentationTimeRange property: The presentation time range. + * + * @return the presentationTimeRange value. + */ + PresentationTimeRange presentationTimeRange(); + + /** + * Gets the firstQuality property: The first quality. + * + * @return the firstQuality value. + */ + FirstQuality firstQuality(); + + /** + * Gets the tracks property: The tracks selection conditions. + * + * @return the tracks value. + */ + List tracks(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner object. + * + * @return the inner object. + */ + AccountFilterInner innerModel(); + + /** The entirety of the AccountFilter definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AccountFilter definition stages. */ + interface DefinitionStages { + /** The first stage of the AccountFilter definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AccountFilter definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @return the next definition stage. + */ + WithCreate withExistingMediaService(String resourceGroupName, String accountName); + } + /** + * The stage of the AccountFilter definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPresentationTimeRange, + DefinitionStages.WithFirstQuality, + DefinitionStages.WithTracks { + /** + * Executes the create request. + * + * @return the created resource. + */ + AccountFilter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AccountFilter create(Context context); + } + /** The stage of the AccountFilter definition allowing to specify presentationTimeRange. */ + interface WithPresentationTimeRange { + /** + * Specifies the presentationTimeRange property: The presentation time range.. + * + * @param presentationTimeRange The presentation time range. + * @return the next definition stage. + */ + WithCreate withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + /** The stage of the AccountFilter definition allowing to specify firstQuality. */ + interface WithFirstQuality { + /** + * Specifies the firstQuality property: The first quality.. + * + * @param firstQuality The first quality. + * @return the next definition stage. + */ + WithCreate withFirstQuality(FirstQuality firstQuality); + } + /** The stage of the AccountFilter definition allowing to specify tracks. */ + interface WithTracks { + /** + * Specifies the tracks property: The tracks selection conditions.. + * + * @param tracks The tracks selection conditions. + * @return the next definition stage. + */ + WithCreate withTracks(List tracks); + } + } + /** + * Begins update for the AccountFilter resource. + * + * @return the stage of resource update. + */ + AccountFilter.Update update(); + + /** The template for AccountFilter update. */ + interface Update + extends UpdateStages.WithPresentationTimeRange, UpdateStages.WithFirstQuality, UpdateStages.WithTracks { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AccountFilter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AccountFilter apply(Context context); + } + /** The AccountFilter update stages. */ + interface UpdateStages { + /** The stage of the AccountFilter update allowing to specify presentationTimeRange. */ + interface WithPresentationTimeRange { + /** + * Specifies the presentationTimeRange property: The presentation time range.. + * + * @param presentationTimeRange The presentation time range. + * @return the next definition stage. + */ + Update withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + /** The stage of the AccountFilter update allowing to specify firstQuality. */ + interface WithFirstQuality { + /** + * Specifies the firstQuality property: The first quality.. + * + * @param firstQuality The first quality. + * @return the next definition stage. + */ + Update withFirstQuality(FirstQuality firstQuality); + } + /** The stage of the AccountFilter update allowing to specify tracks. */ + interface WithTracks { + /** + * Specifies the tracks property: The tracks selection conditions.. + * + * @param tracks The tracks selection conditions. + * @return the next definition stage. + */ + Update withTracks(List tracks); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AccountFilter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AccountFilter refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilterCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilterCollection.java new file mode 100644 index 000000000000..b5a53517d832 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilterCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of AccountFilter items. */ +@Fluent +public final class AccountFilterCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountFilterCollection.class); + + /* + * A collection of AccountFilter items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of AccountFilter items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of AccountFilter items. + * + * @param value the value value to set. + * @return the AccountFilterCollection object itself. + */ + public AccountFilterCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the AccountFilterCollection object itself. + */ + public AccountFilterCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilters.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilters.java new file mode 100644 index 000000000000..f4f3f225c58d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilters.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AccountFilters. */ +public interface AccountFilters { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AccountFilter items. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + AccountFilter get(String resourceGroupName, String accountName, String filterName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String filterName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String filterName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String filterName, Context context); + + /** + * Get the details of an Account Filter in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + AccountFilter getById(String id); + + /** + * Get the details of an Account Filter in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Account Filter in the Media Services account. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Account Filter in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an Account Filter in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AccountFilter resource. + * + * @param name resource name. + * @return the first stage of the new AccountFilter definition. + */ + AccountFilter.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AkamaiAccessControl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AkamaiAccessControl.java new file mode 100644 index 000000000000..3bf0dae6f51f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AkamaiAccessControl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Akamai access control. */ +@Fluent +public final class AkamaiAccessControl { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AkamaiAccessControl.class); + + /* + * authentication key list + */ + @JsonProperty(value = "akamaiSignatureHeaderAuthenticationKeyList") + private List akamaiSignatureHeaderAuthenticationKeyList; + + /** + * Get the akamaiSignatureHeaderAuthenticationKeyList property: authentication key list. + * + * @return the akamaiSignatureHeaderAuthenticationKeyList value. + */ + public List akamaiSignatureHeaderAuthenticationKeyList() { + return this.akamaiSignatureHeaderAuthenticationKeyList; + } + + /** + * Set the akamaiSignatureHeaderAuthenticationKeyList property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (akamaiSignatureHeaderAuthenticationKeyList() != null) { + akamaiSignatureHeaderAuthenticationKeyList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AkamaiSignatureHeaderAuthenticationKey.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AkamaiSignatureHeaderAuthenticationKey.java new file mode 100644 index 000000000000..3414cedfea14 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AkamaiSignatureHeaderAuthenticationKey.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Akamai Signature Header authentication key. */ +@Fluent +public final class AkamaiSignatureHeaderAuthenticationKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AkamaiSignatureHeaderAuthenticationKey.class); + + /* + * 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 OffsetDateTime expiration; + + /** + * Get the identifier property: identifier of the key. + * + * @return the identifier value. + */ + public String identifier() { + return this.identifier; + } + + /** + * Set the identifier property: 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 the base64Key property: authentication key. + * + * @return the base64Key value. + */ + public String base64Key() { + return this.base64Key; + } + + /** + * Set the base64Key property: 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 property: The expiration time of the authentication key. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration property: The expiration time of the authentication key. + * + * @param expiration the expiration value to set. + * @return the AkamaiSignatureHeaderAuthenticationKey object itself. + */ + public AkamaiSignatureHeaderAuthenticationKey withExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AnalysisResolution.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AnalysisResolution.java new file mode 100644 index 000000000000..68631ad10811 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AnalysisResolution.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AnalysisResolution. */ +public final class AnalysisResolution extends ExpandableStringEnum { + /** Static value SourceResolution for AnalysisResolution. */ + public static final AnalysisResolution SOURCE_RESOLUTION = fromString("SourceResolution"); + + /** Static value StandardDefinition for AnalysisResolution. */ + public static final AnalysisResolution STANDARD_DEFINITION = fromString("StandardDefinition"); + + /** + * Creates or finds a AnalysisResolution from its string representation. + * + * @param name a name to look for. + * @return the corresponding AnalysisResolution. + */ + @JsonCreator + public static AnalysisResolution fromString(String name) { + return fromString(name, AnalysisResolution.class); + } + + /** @return known AnalysisResolution values. */ + public static Collection values() { + return values(AnalysisResolution.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Asset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Asset.java new file mode 100644 index 000000000000..8851a548f9ea --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Asset.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetInner; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** An immutable client-side representation of Asset. */ +public interface Asset { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the assetId property: The Asset ID. + * + * @return the assetId value. + */ + UUID assetId(); + + /** + * Gets the created property: The creation date of the Asset. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the lastModified property: The last modified date of the Asset. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the alternateId property: The alternate ID of the Asset. + * + * @return the alternateId value. + */ + String alternateId(); + + /** + * Gets the description property: The Asset description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the container property: The name of the asset blob container. + * + * @return the container value. + */ + String container(); + + /** + * Gets the storageAccountName property: The name of the storage account. + * + * @return the storageAccountName value. + */ + String storageAccountName(); + + /** + * Gets the storageEncryptionFormat property: The Asset encryption format. One of None or MediaStorageEncryption. + * + * @return the storageEncryptionFormat value. + */ + AssetStorageEncryptionFormat storageEncryptionFormat(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.AssetInner object. + * + * @return the inner object. + */ + AssetInner innerModel(); + + /** The entirety of the Asset definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Asset definition stages. */ + interface DefinitionStages { + /** The first stage of the Asset definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Asset definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @return the next definition stage. + */ + WithCreate withExistingMediaService(String resourceGroupName, String accountName); + } + /** + * The stage of the Asset definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithAlternateId, + DefinitionStages.WithDescription, + DefinitionStages.WithContainer, + DefinitionStages.WithStorageAccountName { + /** + * Executes the create request. + * + * @return the created resource. + */ + Asset create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Asset create(Context context); + } + /** The stage of the Asset definition allowing to specify alternateId. */ + interface WithAlternateId { + /** + * Specifies the alternateId property: The alternate ID of the Asset.. + * + * @param alternateId The alternate ID of the Asset. + * @return the next definition stage. + */ + WithCreate withAlternateId(String alternateId); + } + /** The stage of the Asset definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The Asset description.. + * + * @param description The Asset description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the Asset definition allowing to specify container. */ + interface WithContainer { + /** + * Specifies the container property: The name of the asset blob container.. + * + * @param container The name of the asset blob container. + * @return the next definition stage. + */ + WithCreate withContainer(String container); + } + /** The stage of the Asset definition allowing to specify storageAccountName. */ + interface WithStorageAccountName { + /** + * Specifies the storageAccountName property: The name of the storage account.. + * + * @param storageAccountName The name of the storage account. + * @return the next definition stage. + */ + WithCreate withStorageAccountName(String storageAccountName); + } + } + /** + * Begins update for the Asset resource. + * + * @return the stage of resource update. + */ + Asset.Update update(); + + /** The template for Asset update. */ + interface Update + extends UpdateStages.WithAlternateId, + UpdateStages.WithDescription, + UpdateStages.WithContainer, + UpdateStages.WithStorageAccountName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Asset apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Asset apply(Context context); + } + /** The Asset update stages. */ + interface UpdateStages { + /** The stage of the Asset update allowing to specify alternateId. */ + interface WithAlternateId { + /** + * Specifies the alternateId property: The alternate ID of the Asset.. + * + * @param alternateId The alternate ID of the Asset. + * @return the next definition stage. + */ + Update withAlternateId(String alternateId); + } + /** The stage of the Asset update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The Asset description.. + * + * @param description The Asset description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Asset update allowing to specify container. */ + interface WithContainer { + /** + * Specifies the container property: The name of the asset blob container.. + * + * @param container The name of the asset blob container. + * @return the next definition stage. + */ + Update withContainer(String container); + } + /** The stage of the Asset update allowing to specify storageAccountName. */ + interface WithStorageAccountName { + /** + * Specifies the storageAccountName property: The name of the storage account.. + * + * @param storageAccountName The name of the storage account. + * @return the next definition stage. + */ + Update withStorageAccountName(String storageAccountName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Asset refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Asset refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetCollection.java new file mode 100644 index 000000000000..af674385afbf --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of Asset items. */ +@Fluent +public final class AssetCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssetCollection.class); + + /* + * A collection of Asset items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of Asset items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of Asset items. + * + * @param value the value value to set. + * @return the AssetCollection object itself. + */ + public AssetCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the AssetCollection object itself. + */ + public AssetCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetContainerPermission.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetContainerPermission.java new file mode 100644 index 000000000000..5efe0036eb64 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetContainerPermission.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AssetContainerPermission. */ +public final class AssetContainerPermission extends ExpandableStringEnum { + /** Static value Read for AssetContainerPermission. */ + public static final AssetContainerPermission READ = fromString("Read"); + + /** Static value ReadWrite for AssetContainerPermission. */ + public static final AssetContainerPermission READ_WRITE = fromString("ReadWrite"); + + /** Static value ReadWriteDelete for AssetContainerPermission. */ + public static final AssetContainerPermission READ_WRITE_DELETE = fromString("ReadWriteDelete"); + + /** + * Creates or finds a AssetContainerPermission from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetContainerPermission. + */ + @JsonCreator + public static AssetContainerPermission fromString(String name) { + return fromString(name, AssetContainerPermission.class); + } + + /** @return known AssetContainerPermission values. */ + public static Collection values() { + return values(AssetContainerPermission.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetContainerSas.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetContainerSas.java new file mode 100644 index 000000000000..58f009b4f3b2 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetContainerSas.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.AssetContainerSasInner; +import java.util.List; + +/** An immutable client-side representation of AssetContainerSas. */ +public interface AssetContainerSas { + /** + * Gets the assetContainerSasUrls property: The list of Asset container SAS URLs. + * + * @return the assetContainerSasUrls value. + */ + List assetContainerSasUrls(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.AssetContainerSasInner object. + * + * @return the inner object. + */ + AssetContainerSasInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFileEncryptionMetadata.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFileEncryptionMetadata.java new file mode 100644 index 000000000000..9fe4388154ce --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFileEncryptionMetadata.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** The Asset File Storage encryption metadata. */ +@Fluent +public final class AssetFileEncryptionMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssetFileEncryptionMetadata.class); + + /* + * 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 initializationVector property: The Asset File initialization vector. + * + * @return the initializationVector value. + */ + public String initializationVector() { + return this.initializationVector; + } + + /** + * Set the initializationVector property: 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 assetFileName property: The Asset File name. + * + * @return the assetFileName value. + */ + public String assetFileName() { + return this.assetFileName; + } + + /** + * Set the assetFileName property: 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 assetFileId property: The Asset File Id. + * + * @return the assetFileId value. + */ + public UUID assetFileId() { + return this.assetFileId; + } + + /** + * Set the assetFileId property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (assetFileId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property assetFileId in model AssetFileEncryptionMetadata")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilter.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilter.java new file mode 100644 index 000000000000..f64361a152de --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilter.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner; +import java.util.List; + +/** An immutable client-side representation of AssetFilter. */ +public interface AssetFilter { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the presentationTimeRange property: The presentation time range. + * + * @return the presentationTimeRange value. + */ + PresentationTimeRange presentationTimeRange(); + + /** + * Gets the firstQuality property: The first quality. + * + * @return the firstQuality value. + */ + FirstQuality firstQuality(); + + /** + * Gets the tracks property: The tracks selection conditions. + * + * @return the tracks value. + */ + List tracks(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner object. + * + * @return the inner object. + */ + AssetFilterInner innerModel(); + + /** The entirety of the AssetFilter definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AssetFilter definition stages. */ + interface DefinitionStages { + /** The first stage of the AssetFilter definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AssetFilter definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName, assetName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param assetName The Asset name. + * @return the next definition stage. + */ + WithCreate withExistingAsset(String resourceGroupName, String accountName, String assetName); + } + /** + * The stage of the AssetFilter definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPresentationTimeRange, + DefinitionStages.WithFirstQuality, + DefinitionStages.WithTracks { + /** + * Executes the create request. + * + * @return the created resource. + */ + AssetFilter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AssetFilter create(Context context); + } + /** The stage of the AssetFilter definition allowing to specify presentationTimeRange. */ + interface WithPresentationTimeRange { + /** + * Specifies the presentationTimeRange property: The presentation time range.. + * + * @param presentationTimeRange The presentation time range. + * @return the next definition stage. + */ + WithCreate withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + /** The stage of the AssetFilter definition allowing to specify firstQuality. */ + interface WithFirstQuality { + /** + * Specifies the firstQuality property: The first quality.. + * + * @param firstQuality The first quality. + * @return the next definition stage. + */ + WithCreate withFirstQuality(FirstQuality firstQuality); + } + /** The stage of the AssetFilter definition allowing to specify tracks. */ + interface WithTracks { + /** + * Specifies the tracks property: The tracks selection conditions.. + * + * @param tracks The tracks selection conditions. + * @return the next definition stage. + */ + WithCreate withTracks(List tracks); + } + } + /** + * Begins update for the AssetFilter resource. + * + * @return the stage of resource update. + */ + AssetFilter.Update update(); + + /** The template for AssetFilter update. */ + interface Update + extends UpdateStages.WithPresentationTimeRange, UpdateStages.WithFirstQuality, UpdateStages.WithTracks { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AssetFilter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AssetFilter apply(Context context); + } + /** The AssetFilter update stages. */ + interface UpdateStages { + /** The stage of the AssetFilter update allowing to specify presentationTimeRange. */ + interface WithPresentationTimeRange { + /** + * Specifies the presentationTimeRange property: The presentation time range.. + * + * @param presentationTimeRange The presentation time range. + * @return the next definition stage. + */ + Update withPresentationTimeRange(PresentationTimeRange presentationTimeRange); + } + /** The stage of the AssetFilter update allowing to specify firstQuality. */ + interface WithFirstQuality { + /** + * Specifies the firstQuality property: The first quality.. + * + * @param firstQuality The first quality. + * @return the next definition stage. + */ + Update withFirstQuality(FirstQuality firstQuality); + } + /** The stage of the AssetFilter update allowing to specify tracks. */ + interface WithTracks { + /** + * Specifies the tracks property: The tracks selection conditions.. + * + * @param tracks The tracks selection conditions. + * @return the next definition stage. + */ + Update withTracks(List tracks); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AssetFilter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AssetFilter refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilterCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilterCollection.java new file mode 100644 index 000000000000..d3c919ac69e0 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilterCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of AssetFilter items. */ +@Fluent +public final class AssetFilterCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssetFilterCollection.class); + + /* + * A collection of AssetFilter items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of AssetFilter items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of AssetFilter items. + * + * @param value the value value to set. + * @return the AssetFilterCollection object itself. + */ + public AssetFilterCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the AssetFilterCollection object itself. + */ + public AssetFilterCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilters.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilters.java new file mode 100644 index 000000000000..92aa1e15d11b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilters.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AssetFilters. */ +public interface AssetFilters { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + PagedIterable list(String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of AssetFilter items. + */ + PagedIterable list(String resourceGroupName, String accountName, String assetName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + AssetFilter get(String resourceGroupName, String accountName, String assetName, String filterName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String assetName, String filterName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String assetName, String filterName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String assetName, String filterName, Context context); + + /** + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + AssetFilter getById(String id); + + /** + * Get the details of an Asset Filter associated with the specified Asset. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset Filter associated with the specified Asset. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Asset Filter associated with the specified Asset. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an Asset Filter associated with the specified Asset. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AssetFilter resource. + * + * @param name resource name. + * @return the first stage of the new AssetFilter definition. + */ + AssetFilter.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetStorageEncryptionFormat.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetStorageEncryptionFormat.java new file mode 100644 index 000000000000..4b4cbd3d2f2e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetStorageEncryptionFormat.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AssetStorageEncryptionFormat. */ +public final class AssetStorageEncryptionFormat extends ExpandableStringEnum { + /** Static value None for AssetStorageEncryptionFormat. */ + public static final AssetStorageEncryptionFormat NONE = fromString("None"); + + /** Static value MediaStorageClientEncryption for AssetStorageEncryptionFormat. */ + public static final AssetStorageEncryptionFormat MEDIA_STORAGE_CLIENT_ENCRYPTION = + fromString("MediaStorageClientEncryption"); + + /** + * Creates or finds a AssetStorageEncryptionFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssetStorageEncryptionFormat. + */ + @JsonCreator + public static AssetStorageEncryptionFormat fromString(String name) { + return fromString(name, AssetStorageEncryptionFormat.class); + } + + /** @return known AssetStorageEncryptionFormat values. */ + public static Collection values() { + return values(AssetStorageEncryptionFormat.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetStreamingLocator.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetStreamingLocator.java new file mode 100644 index 000000000000..b2724007fe89 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetStreamingLocator.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** Properties of the Streaming Locator. */ +@Immutable +public final class AssetStreamingLocator { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssetStreamingLocator.class); + + /* + * 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 OffsetDateTime created; + + /* + * The start time of the Streaming Locator. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The end time of the Streaming Locator. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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 the name property: Streaming Locator name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the assetName property: Asset Name. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Get the created property: The creation time of the Streaming Locator. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the startTime property: The start time of the Streaming Locator. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the Streaming Locator. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the streamingLocatorId property: StreamingLocatorId of the Streaming Locator. + * + * @return the streamingLocatorId value. + */ + public UUID streamingLocatorId() { + return this.streamingLocatorId; + } + + /** + * Get the streamingPolicyName property: Name of the Streaming Policy used by this Streaming Locator. + * + * @return the streamingPolicyName value. + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Get the defaultContentKeyPolicyName property: Name of the default ContentKeyPolicy used by this Streaming + * Locator. + * + * @return the defaultContentKeyPolicyName value. + */ + public String defaultContentKeyPolicyName() { + return this.defaultContentKeyPolicyName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Assets.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Assets.java new file mode 100644 index 000000000000..d0d089c64054 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Assets.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Assets. */ +public interface 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Asset items. + */ + PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + Asset get(String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + Response getWithResponse(String resourceGroupName, String accountName, String assetName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String assetName, Context context); + + /** + * 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 parameters to the list SAS request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset Storage container SAS URLs. + */ + AssetContainerSas listContainerSas( + String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters); + + /** + * 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 parameters to the list SAS request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset Storage container SAS URLs. + */ + Response listContainerSasWithResponse( + String resourceGroupName, + String accountName, + String assetName, + ListContainerSasInput parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + */ + StorageEncryptedAssetDecryptionData getEncryptionKey( + String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. + */ + Response getEncryptionKeyWithResponse( + String resourceGroupName, String accountName, String assetName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Streaming Locators associated with this Asset. + */ + ListStreamingLocatorsResponse listStreamingLocators(String resourceGroupName, String accountName, String assetName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Streaming Locators associated with this Asset. + */ + Response listStreamingLocatorsWithResponse( + String resourceGroupName, String accountName, String assetName, Context context); + + /** + * Get the details of an Asset in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + Asset getById(String id); + + /** + * Get the details of an Asset in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Asset in the Media Services account. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Asset in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an Asset in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Asset resource. + * + * @param name resource name. + * @return the first stage of the new Asset definition. + */ + Asset.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Audio.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Audio.java new file mode 100644 index 000000000000..e7bbd4fbaa27 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Audio.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the common properties for all audio codecs. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = Audio.class) +@JsonTypeName("#Microsoft.Media.Audio") +@JsonSubTypes({@JsonSubTypes.Type(name = "#Microsoft.Media.AacAudio", value = AacAudio.class)}) +@JsonFlatten +@Fluent +public class Audio extends Codec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Audio.class); + + /* + * 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 channels property: The number of channels in the audio. + * + * @return the channels value. + */ + public Integer channels() { + return this.channels; + } + + /** + * Set the channels property: 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 samplingRate property: The sampling rate to use for encoding in hertz. + * + * @return the samplingRate value. + */ + public Integer samplingRate() { + return this.samplingRate; + } + + /** + * Set the samplingRate property: 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 property: The bitrate, in bits per second, of the output encoded audio. + * + * @return the bitrate value. + */ + public Integer bitrate() { + return this.bitrate; + } + + /** + * Set the bitrate property: 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; + } + + /** {@inheritDoc} */ + @Override + public Audio withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AudioAnalysisMode.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AudioAnalysisMode.java new file mode 100644 index 000000000000..49f85e4a5913 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AudioAnalysisMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AudioAnalysisMode. */ +public final class AudioAnalysisMode extends ExpandableStringEnum { + /** Static value Standard for AudioAnalysisMode. */ + public static final AudioAnalysisMode STANDARD = fromString("Standard"); + + /** Static value Basic for AudioAnalysisMode. */ + public static final AudioAnalysisMode BASIC = fromString("Basic"); + + /** + * Creates or finds a AudioAnalysisMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AudioAnalysisMode. + */ + @JsonCreator + public static AudioAnalysisMode fromString(String name) { + return fromString(name, AudioAnalysisMode.class); + } + + /** @return known AudioAnalysisMode values. */ + public static Collection values() { + return values(AudioAnalysisMode.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AudioAnalyzerPreset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AudioAnalyzerPreset.java new file mode 100644 index 000000000000..74082352cb39 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AudioAnalyzerPreset.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** + * 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", + defaultImpl = AudioAnalyzerPreset.class) +@JsonTypeName("#Microsoft.Media.AudioAnalyzerPreset") +@JsonSubTypes({@JsonSubTypes.Type(name = "#Microsoft.Media.VideoAnalyzerPreset", value = VideoAnalyzerPreset.class)}) +@JsonFlatten +@Fluent +public class AudioAnalyzerPreset extends Preset { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AudioAnalyzerPreset.class); + + /* + * The language for the audio payload in the input using the BCP-47 format + * of 'language tag-region' (e.g: 'en-US'). If you know the language of + * your content, it is recommended that you specify it. The language must + * be specified explicitly for AudioAnalysisMode::Basic, since automatic + * language detection is not included in basic mode. If the language isn't + * specified or set to null, automatic language detection will choose the + * first language detected and process with the selected language for the + * duration of the file. It does not currently support dynamically + * switching between languages after the first language is detected. The + * automatic detection works best with audio recordings with clearly + * discernable speech. If automatic detection fails to find the language, + * transcription would fallback to 'en-US'." The list of supported + * languages is available here: + * https://go.microsoft.com/fwlink/?linkid=2109463 + */ + @JsonProperty(value = "audioLanguage") + private String audioLanguage; + + /* + * Determines the set of audio analysis operations to be performed. If + * unspecified, the Standard AudioAnalysisMode would be chosen. + */ + @JsonProperty(value = "mode") + private AudioAnalysisMode mode; + + /* + * Dictionary containing key value pairs for parameters not exposed in the + * preset itself + */ + @JsonProperty(value = "experimentalOptions") + private Map experimentalOptions; + + /** + * Get the audioLanguage property: The language for the audio payload in the input using the BCP-47 format of + * 'language tag-region' (e.g: 'en-US'). If you know the language of your content, it is recommended that you + * specify it. The language must be specified explicitly for AudioAnalysisMode::Basic, since automatic language + * detection is not included in basic mode. If the language isn't specified or set to null, automatic language + * detection will choose the first language detected and process with the selected language for the duration of the + * file. It does not currently support dynamically switching between languages after the first language is detected. + * The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection + * fails to find the language, transcription would fallback to 'en-US'." The list of supported languages is + * available here: https://go.microsoft.com/fwlink/?linkid=2109463. + * + * @return the audioLanguage value. + */ + public String audioLanguage() { + return this.audioLanguage; + } + + /** + * Set the audioLanguage property: The language for the audio payload in the input using the BCP-47 format of + * 'language tag-region' (e.g: 'en-US'). If you know the language of your content, it is recommended that you + * specify it. The language must be specified explicitly for AudioAnalysisMode::Basic, since automatic language + * detection is not included in basic mode. If the language isn't specified or set to null, automatic language + * detection will choose the first language detected and process with the selected language for the duration of the + * file. It does not currently support dynamically switching between languages after the first language is detected. + * The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection + * fails to find the language, transcription would fallback to 'en-US'." The list of supported languages is + * available here: https://go.microsoft.com/fwlink/?linkid=2109463. + * + * @param audioLanguage the audioLanguage value to set. + * @return the AudioAnalyzerPreset object itself. + */ + public AudioAnalyzerPreset withAudioLanguage(String audioLanguage) { + this.audioLanguage = audioLanguage; + return this; + } + + /** + * Get the mode property: Determines the set of audio analysis operations to be performed. If unspecified, the + * Standard AudioAnalysisMode would be chosen. + * + * @return the mode value. + */ + public AudioAnalysisMode mode() { + return this.mode; + } + + /** + * Set the mode property: Determines the set of audio analysis operations to be performed. If unspecified, the + * Standard AudioAnalysisMode would be chosen. + * + * @param mode the mode value to set. + * @return the AudioAnalyzerPreset object itself. + */ + public AudioAnalyzerPreset withMode(AudioAnalysisMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the experimentalOptions property: Dictionary containing key value pairs for parameters not exposed in the + * preset itself. + * + * @return the experimentalOptions value. + */ + public Map experimentalOptions() { + return this.experimentalOptions; + } + + /** + * Set the experimentalOptions property: Dictionary containing key value pairs for parameters not exposed in the + * preset itself. + * + * @param experimentalOptions the experimentalOptions value to set. + * @return the AudioAnalyzerPreset object itself. + */ + public AudioAnalyzerPreset withExperimentalOptions(Map experimentalOptions) { + this.experimentalOptions = experimentalOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AudioOverlay.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AudioOverlay.java new file mode 100644 index 000000000000..0fc5c84453f8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AudioOverlay.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; + +/** Describes the properties of an audio overlay. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.AudioOverlay") +@JsonFlatten +@Immutable +public class AudioOverlay extends Overlay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AudioOverlay.class); + + /** {@inheritDoc} */ + @Override + public AudioOverlay withInputLabel(String inputLabel) { + super.withInputLabel(inputLabel); + return this; + } + + /** {@inheritDoc} */ + @Override + public AudioOverlay withStart(Duration start) { + super.withStart(start); + return this; + } + + /** {@inheritDoc} */ + @Override + public AudioOverlay withEnd(Duration end) { + super.withEnd(end); + return this; + } + + /** {@inheritDoc} */ + @Override + public AudioOverlay withFadeInDuration(Duration fadeInDuration) { + super.withFadeInDuration(fadeInDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public AudioOverlay withFadeOutDuration(Duration fadeOutDuration) { + super.withFadeOutDuration(fadeOutDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public AudioOverlay withAudioGainLevel(Double audioGainLevel) { + super.withAudioGainLevel(audioGainLevel); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/BuiltInStandardEncoderPreset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/BuiltInStandardEncoderPreset.java new file mode 100644 index 000000000000..c6200610e55b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/BuiltInStandardEncoderPreset.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Fluent +public class BuiltInStandardEncoderPreset extends Preset { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuiltInStandardEncoderPreset.class); + + /* + * The built-in preset to be used for encoding videos. + */ + @JsonProperty(value = "presetName", required = true) + private EncoderNamedPreset presetName; + + /** + * Get the presetName property: The built-in preset to be used for encoding videos. + * + * @return the presetName value. + */ + public EncoderNamedPreset presetName() { + return this.presetName; + } + + /** + * Set the presetName property: The built-in preset to be used for encoding videos. + * + * @param presetName the presetName value to set. + * @return the BuiltInStandardEncoderPreset object itself. + */ + public BuiltInStandardEncoderPreset withPresetName(EncoderNamedPreset presetName) { + this.presetName = presetName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (presetName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property presetName in model BuiltInStandardEncoderPreset")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CbcsDrmConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CbcsDrmConfiguration.java new file mode 100644 index 000000000000..525bd4857650 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CbcsDrmConfiguration.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming Policy. */ +@Fluent +public final class CbcsDrmConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CbcsDrmConfiguration.class); + + /* + * 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 the fairPlay property: FairPlay configurations. + * + * @return the fairPlay value. + */ + public StreamingPolicyFairPlayConfiguration fairPlay() { + return this.fairPlay; + } + + /** + * Set the fairPlay property: 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 the playReady property: PlayReady configurations. + * + * @return the playReady value. + */ + public StreamingPolicyPlayReadyConfiguration playReady() { + return this.playReady; + } + + /** + * Set the playReady property: 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 the widevine property: Widevine configurations. + * + * @return the widevine value. + */ + public StreamingPolicyWidevineConfiguration widevine() { + return this.widevine; + } + + /** + * Set the widevine property: Widevine configurations. + * + * @param widevine the widevine value to set. + * @return the CbcsDrmConfiguration object itself. + */ + public CbcsDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { + this.widevine = widevine; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fairPlay() != null) { + fairPlay().validate(); + } + if (playReady() != null) { + playReady().validate(); + } + if (widevine() != null) { + widevine().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CencDrmConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CencDrmConfiguration.java new file mode 100644 index 000000000000..e1a69b188e47 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CencDrmConfiguration.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming Policy. */ +@Fluent +public final class CencDrmConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CencDrmConfiguration.class); + + /* + * PlayReady configurations + */ + @JsonProperty(value = "playReady") + private StreamingPolicyPlayReadyConfiguration playReady; + + /* + * Widevine configurations + */ + @JsonProperty(value = "widevine") + private StreamingPolicyWidevineConfiguration widevine; + + /** + * Get the playReady property: PlayReady configurations. + * + * @return the playReady value. + */ + public StreamingPolicyPlayReadyConfiguration playReady() { + return this.playReady; + } + + /** + * Set the playReady property: 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 the widevine property: Widevine configurations. + * + * @return the widevine value. + */ + public StreamingPolicyWidevineConfiguration widevine() { + return this.widevine; + } + + /** + * Set the widevine property: Widevine configurations. + * + * @param widevine the widevine value to set. + * @return the CencDrmConfiguration object itself. + */ + public CencDrmConfiguration withWidevine(StreamingPolicyWidevineConfiguration widevine) { + this.widevine = widevine; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (playReady() != null) { + playReady().validate(); + } + if (widevine() != null) { + widevine().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CheckNameAvailabilityInput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CheckNameAvailabilityInput.java new file mode 100644 index 000000000000..743b2e929356 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CheckNameAvailabilityInput.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The input to the check name availability request. */ +@Fluent +public final class CheckNameAvailabilityInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityInput.class); + + /* + * 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 name property: The account name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 type property: The account type. For a Media Services account, this should be 'MediaServices'. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ClipTime.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ClipTime.java new file mode 100644 index 000000000000..6de88134d1f7 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ClipTime.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = ClipTime.class) +@JsonTypeName("ClipTime") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AbsoluteClipTime", value = AbsoluteClipTime.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.UtcClipTime", value = UtcClipTime.class) +}) +@JsonFlatten +@Immutable +public class ClipTime { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClipTime.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Codec.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Codec.java new file mode 100644 index 000000000000..b7eb3c2e4d2d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Codec.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes the basic properties of all codecs. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = Codec.class) +@JsonTypeName("Codec") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Audio", value = Audio.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.Video", value = Video.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.CopyVideo", value = CopyVideo.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.CopyAudio", value = CopyAudio.class) +}) +@JsonFlatten +@Fluent +public class Codec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Codec.class); + + /* + * An optional label for the codec. The label can be used to control muxing + * behavior. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Get the label property: 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 the label property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CommonEncryptionCbcs.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CommonEncryptionCbcs.java new file mode 100644 index 000000000000..2ea3769cb926 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CommonEncryptionCbcs.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class for CommonEncryptionCbcs encryption scheme. */ +@Fluent +public final class CommonEncryptionCbcs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CommonEncryptionCbcs.class); + + /* + * 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 the enabledProtocols property: Representing supported protocols. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the enabledProtocols property: 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 the clearTracks property: Representing which tracks should not be encrypted. + * + * @return the clearTracks value. + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set the clearTracks property: 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 the contentKeys property: 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 the contentKeys property: 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 the drm property: Configuration of DRMs for current encryption scheme. + * + * @return the drm value. + */ + public CbcsDrmConfiguration drm() { + return this.drm; + } + + /** + * Set the drm property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (enabledProtocols() != null) { + enabledProtocols().validate(); + } + if (clearTracks() != null) { + clearTracks().forEach(e -> e.validate()); + } + if (contentKeys() != null) { + contentKeys().validate(); + } + if (drm() != null) { + drm().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CommonEncryptionCenc.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CommonEncryptionCenc.java new file mode 100644 index 000000000000..b7610104bf62 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CommonEncryptionCenc.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class for envelope encryption scheme. */ +@Fluent +public final class CommonEncryptionCenc { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CommonEncryptionCenc.class); + + /* + * 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 the enabledProtocols property: Representing supported protocols. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the enabledProtocols property: 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 the clearTracks property: Representing which tracks should not be encrypted. + * + * @return the clearTracks value. + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set the clearTracks property: 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 the contentKeys property: 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 the contentKeys property: 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 the drm property: Configuration of DRMs for CommonEncryptionCenc encryption scheme. + * + * @return the drm value. + */ + public CencDrmConfiguration drm() { + return this.drm; + } + + /** + * Set the drm property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (enabledProtocols() != null) { + enabledProtocols().validate(); + } + if (clearTracks() != null) { + clearTracks().forEach(e -> e.validate()); + } + if (contentKeys() != null) { + contentKeys().validate(); + } + if (drm() != null) { + drm().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicies.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicies.java new file mode 100644 index 000000000000..2da1fb425d8f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicies.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ContentKeyPolicies. */ +public interface ContentKeyPolicies { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of ContentKeyPolicy items. + */ + PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + ContentKeyPolicy get(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy including secret values. + */ + ContentKeyPolicyProperties getPolicyPropertiesWithSecrets( + String resourceGroupName, String accountName, String contentKeyPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Content Key Policy including secret values. + */ + Response getPolicyPropertiesWithSecretsWithResponse( + String resourceGroupName, String accountName, String contentKeyPolicyName, Context context); + + /** + * Get the details of a Content Key Policy in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + ContentKeyPolicy getById(String id); + + /** + * Get the details of a Content Key Policy in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Content Key Policy in the Media Services account. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Content Key Policy in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Content Key Policy in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ContentKeyPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ContentKeyPolicy definition. + */ + ContentKeyPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicy.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicy.java new file mode 100644 index 000000000000..cb106ad9391f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicy.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** An immutable client-side representation of ContentKeyPolicy. */ +public interface ContentKeyPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the policyId property: The legacy Policy ID. + * + * @return the policyId value. + */ + UUID policyId(); + + /** + * Gets the created property: The creation date of the Policy. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the lastModified property: The last modified date of the Policy. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the description property: A description for the Policy. + * + * @return the description value. + */ + String description(); + + /** + * Gets the options property: The Key Policy options. + * + * @return the options value. + */ + List options(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner object. + * + * @return the inner object. + */ + ContentKeyPolicyInner innerModel(); + + /** The entirety of the ContentKeyPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ContentKeyPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ContentKeyPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ContentKeyPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @return the next definition stage. + */ + WithCreate withExistingMediaService(String resourceGroupName, String accountName); + } + /** + * The stage of the ContentKeyPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithDescription, DefinitionStages.WithOptions { + /** + * Executes the create request. + * + * @return the created resource. + */ + ContentKeyPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ContentKeyPolicy create(Context context); + } + /** The stage of the ContentKeyPolicy definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description for the Policy.. + * + * @param description A description for the Policy. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the ContentKeyPolicy definition allowing to specify options. */ + interface WithOptions { + /** + * Specifies the options property: The Key Policy options.. + * + * @param options The Key Policy options. + * @return the next definition stage. + */ + WithCreate withOptions(List options); + } + } + /** + * Begins update for the ContentKeyPolicy resource. + * + * @return the stage of resource update. + */ + ContentKeyPolicy.Update update(); + + /** The template for ContentKeyPolicy update. */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithOptions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ContentKeyPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ContentKeyPolicy apply(Context context); + } + /** The ContentKeyPolicy update stages. */ + interface UpdateStages { + /** The stage of the ContentKeyPolicy update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description for the Policy.. + * + * @param description A description for the Policy. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the ContentKeyPolicy update allowing to specify options. */ + interface WithOptions { + /** + * Specifies the options property: The Key Policy options.. + * + * @param options The Key Policy options. + * @return the next definition stage. + */ + Update withOptions(List options); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ContentKeyPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ContentKeyPolicy refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyClearKeyConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyClearKeyConfiguration.java new file mode 100644 index 000000000000..52c83649e53a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyClearKeyConfiguration.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class ContentKeyPolicyClearKeyConfiguration extends ContentKeyPolicyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyClearKeyConfiguration.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyCollection.java new file mode 100644 index 000000000000..58d63a59727a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of ContentKeyPolicy items. */ +@Fluent +public final class ContentKeyPolicyCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyCollection.class); + + /* + * A collection of ContentKeyPolicy items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of ContentKeyPolicy items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of ContentKeyPolicy items. + * + * @param value the value value to set. + * @return the ContentKeyPolicyCollection object itself. + */ + public ContentKeyPolicyCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the ContentKeyPolicyCollection object itself. + */ + public ContentKeyPolicyCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyConfiguration.java new file mode 100644 index 000000000000..12e5de21c8de --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyConfiguration.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** 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", + defaultImpl = ContentKeyPolicyConfiguration.class) +@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) +}) +@JsonFlatten +@Immutable +public class ContentKeyPolicyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyConfiguration.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyFairPlayConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyFairPlayConfiguration.java new file mode 100644 index 000000000000..db2ca40c32b6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyFairPlayConfiguration.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Fluent +public class ContentKeyPolicyFairPlayConfiguration extends ContentKeyPolicyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyFairPlayConfiguration.class); + + /* + * 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. + */ + @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; + + /* + * Offline rental policy + */ + @JsonProperty(value = "offlineRentalConfiguration") + private ContentKeyPolicyFairPlayOfflineRentalConfiguration offlineRentalConfiguration; + + /** + * Get the ask property: The key that must be used as FairPlay Application Secret key. + * + * @return the ask value. + */ + public byte[] ask() { + return CoreUtils.clone(this.ask); + } + + /** + * Set the ask property: 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 = CoreUtils.clone(ask); + return this; + } + + /** + * Get the fairPlayPfxPassword property: The password encrypting FairPlay certificate in PKCS 12 (pfx) format. + * + * @return the fairPlayPfxPassword value. + */ + public String fairPlayPfxPassword() { + return this.fairPlayPfxPassword; + } + + /** + * Set the fairPlayPfxPassword property: 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 fairPlayPfx property: 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 fairPlayPfx property: 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 rentalAndLeaseKeyType property: The rental and lease key type. + * + * @return the rentalAndLeaseKeyType value. + */ + public ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType() { + return this.rentalAndLeaseKeyType; + } + + /** + * Set the rentalAndLeaseKeyType property: The rental and lease key type. + * + * @param rentalAndLeaseKeyType the rentalAndLeaseKeyType value to set. + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withRentalAndLeaseKeyType( + ContentKeyPolicyFairPlayRentalAndLeaseKeyType rentalAndLeaseKeyType) { + this.rentalAndLeaseKeyType = rentalAndLeaseKeyType; + return this; + } + + /** + * Get the rentalDuration property: The rental duration. Must be greater than or equal to 0. + * + * @return the rentalDuration value. + */ + public long rentalDuration() { + return this.rentalDuration; + } + + /** + * Set the rentalDuration property: 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; + } + + /** + * Get the offlineRentalConfiguration property: Offline rental policy. + * + * @return the offlineRentalConfiguration value. + */ + public ContentKeyPolicyFairPlayOfflineRentalConfiguration offlineRentalConfiguration() { + return this.offlineRentalConfiguration; + } + + /** + * Set the offlineRentalConfiguration property: Offline rental policy. + * + * @param offlineRentalConfiguration the offlineRentalConfiguration value to set. + * @return the ContentKeyPolicyFairPlayConfiguration object itself. + */ + public ContentKeyPolicyFairPlayConfiguration withOfflineRentalConfiguration( + ContentKeyPolicyFairPlayOfflineRentalConfiguration offlineRentalConfiguration) { + this.offlineRentalConfiguration = offlineRentalConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ask() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ask in model ContentKeyPolicyFairPlayConfiguration")); + } + if (fairPlayPfxPassword() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fairPlayPfxPassword in model" + + " ContentKeyPolicyFairPlayConfiguration")); + } + if (fairPlayPfx() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fairPlayPfx in model ContentKeyPolicyFairPlayConfiguration")); + } + if (rentalAndLeaseKeyType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rentalAndLeaseKeyType in model" + + " ContentKeyPolicyFairPlayConfiguration")); + } + if (offlineRentalConfiguration() != null) { + offlineRentalConfiguration().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyFairPlayOfflineRentalConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyFairPlayOfflineRentalConfiguration.java new file mode 100644 index 000000000000..21d0e664367b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyFairPlayOfflineRentalConfiguration.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ContentKeyPolicyFairPlayOfflineRentalConfiguration model. */ +@Fluent +public final class ContentKeyPolicyFairPlayOfflineRentalConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ContentKeyPolicyFairPlayOfflineRentalConfiguration.class); + + /* + * Playback duration + */ + @JsonProperty(value = "playbackDurationSeconds", required = true) + private long playbackDurationSeconds; + + /* + * Storage duration + */ + @JsonProperty(value = "storageDurationSeconds", required = true) + private long storageDurationSeconds; + + /** + * Get the playbackDurationSeconds property: Playback duration. + * + * @return the playbackDurationSeconds value. + */ + public long playbackDurationSeconds() { + return this.playbackDurationSeconds; + } + + /** + * Set the playbackDurationSeconds property: Playback duration. + * + * @param playbackDurationSeconds the playbackDurationSeconds value to set. + * @return the ContentKeyPolicyFairPlayOfflineRentalConfiguration object itself. + */ + public ContentKeyPolicyFairPlayOfflineRentalConfiguration withPlaybackDurationSeconds( + long playbackDurationSeconds) { + this.playbackDurationSeconds = playbackDurationSeconds; + return this; + } + + /** + * Get the storageDurationSeconds property: Storage duration. + * + * @return the storageDurationSeconds value. + */ + public long storageDurationSeconds() { + return this.storageDurationSeconds; + } + + /** + * Set the storageDurationSeconds property: Storage duration. + * + * @param storageDurationSeconds the storageDurationSeconds value to set. + * @return the ContentKeyPolicyFairPlayOfflineRentalConfiguration object itself. + */ + public ContentKeyPolicyFairPlayOfflineRentalConfiguration withStorageDurationSeconds(long storageDurationSeconds) { + this.storageDurationSeconds = storageDurationSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java new file mode 100644 index 000000000000..e613cfa85055 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyFairPlayRentalAndLeaseKeyType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. */ +public final class ContentKeyPolicyFairPlayRentalAndLeaseKeyType + extends ExpandableStringEnum { + /** Static value Unknown for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. */ + public static final ContentKeyPolicyFairPlayRentalAndLeaseKeyType UNKNOWN = fromString("Unknown"); + + /** Static value Undefined for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. */ + public static final ContentKeyPolicyFairPlayRentalAndLeaseKeyType UNDEFINED = fromString("Undefined"); + + /** Static value DualExpiry for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. */ + public static final ContentKeyPolicyFairPlayRentalAndLeaseKeyType DUAL_EXPIRY = fromString("DualExpiry"); + + /** Static value PersistentUnlimited for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. */ + public static final ContentKeyPolicyFairPlayRentalAndLeaseKeyType PERSISTENT_UNLIMITED = + fromString("PersistentUnlimited"); + + /** Static value PersistentLimited for ContentKeyPolicyFairPlayRentalAndLeaseKeyType. */ + public static final ContentKeyPolicyFairPlayRentalAndLeaseKeyType PERSISTENT_LIMITED = + fromString("PersistentLimited"); + + /** + * Creates or finds a ContentKeyPolicyFairPlayRentalAndLeaseKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentKeyPolicyFairPlayRentalAndLeaseKeyType. + */ + @JsonCreator + public static ContentKeyPolicyFairPlayRentalAndLeaseKeyType fromString(String name) { + return fromString(name, ContentKeyPolicyFairPlayRentalAndLeaseKeyType.class); + } + + /** @return known ContentKeyPolicyFairPlayRentalAndLeaseKeyType values. */ + public static Collection values() { + return values(ContentKeyPolicyFairPlayRentalAndLeaseKeyType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyOpenRestriction.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyOpenRestriction.java new file mode 100644 index 000000000000..9ae3f2cf0aab --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyOpenRestriction.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class ContentKeyPolicyOpenRestriction extends ContentKeyPolicyRestriction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyOpenRestriction.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyOption.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyOption.java new file mode 100644 index 000000000000..f29ce1bc9b90 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyOption.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Represents a policy option. */ +@Fluent +public final class ContentKeyPolicyOption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyOption.class); + + /* + * 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 policyOptionId property: The legacy Policy Option ID. + * + * @return the policyOptionId value. + */ + public UUID policyOptionId() { + return this.policyOptionId; + } + + /** + * Get the name property: The Policy Option description. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 configuration property: The key delivery configuration. + * + * @return the configuration value. + */ + public ContentKeyPolicyConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: 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 restriction property: The requirements that must be met to deliver keys with this configuration. + * + * @return the restriction value. + */ + public ContentKeyPolicyRestriction restriction() { + return this.restriction; + } + + /** + * Set the restriction property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property configuration in model ContentKeyPolicyOption")); + } else { + configuration().validate(); + } + if (restriction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property restriction in model ContentKeyPolicyOption")); + } else { + restriction().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyConfiguration.java new file mode 100644 index 000000000000..21b29e5d3c38 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyConfiguration.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Specifies a configuration for PlayReady licenses. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration") +@JsonFlatten +@Fluent +public class ContentKeyPolicyPlayReadyConfiguration extends ContentKeyPolicyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyPlayReadyConfiguration.class); + + /* + * The PlayReady licenses. + */ + @JsonProperty(value = "licenses", required = true) + private List licenses; + + /* + * The custom response data. + */ + @JsonProperty(value = "responseCustomData") + private String responseCustomData; + + /** + * Get the licenses property: The PlayReady licenses. + * + * @return the licenses value. + */ + public List licenses() { + return this.licenses; + } + + /** + * Set the licenses property: 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 responseCustomData property: The custom response data. + * + * @return the responseCustomData value. + */ + public String responseCustomData() { + return this.responseCustomData; + } + + /** + * Set the responseCustomData property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (licenses() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property licenses in model ContentKeyPolicyPlayReadyConfiguration")); + } else { + licenses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java new file mode 100644 index 000000000000..4a507ba25f8d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader + extends ContentKeyPolicyPlayReadyContentKeyLocation { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java new file mode 100644 index 000000000000..f738b5307cfe --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.UUID; + +/** 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") +@JsonFlatten +@Fluent +public class ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier + extends ContentKeyPolicyPlayReadyContentKeyLocation { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.class); + + /* + * The content key ID. + */ + @JsonProperty(value = "keyId", required = true) + private UUID keyId; + + /** + * Get the keyId property: The content key ID. + * + * @return the keyId value. + */ + public UUID keyId() { + return this.keyId; + } + + /** + * Set the keyId property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (keyId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyId in model" + + " ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentKeyLocation.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentKeyLocation.java new file mode 100644 index 000000000000..23077fb7f2a6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentKeyLocation.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** 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", + defaultImpl = ContentKeyPolicyPlayReadyContentKeyLocation.class) +@JsonTypeName("ContentKeyPolicyPlayReadyContentKeyLocation") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader", + value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader.class), + @JsonSubTypes.Type( + name = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier", + value = ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.class) +}) +@JsonFlatten +@Immutable +public class ContentKeyPolicyPlayReadyContentKeyLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyPlayReadyContentKeyLocation.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentType.java new file mode 100644 index 000000000000..ebd818e0e4c0 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyContentType.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContentKeyPolicyPlayReadyContentType. */ +public final class ContentKeyPolicyPlayReadyContentType + extends ExpandableStringEnum { + /** Static value Unknown for ContentKeyPolicyPlayReadyContentType. */ + public static final ContentKeyPolicyPlayReadyContentType UNKNOWN = fromString("Unknown"); + + /** Static value Unspecified for ContentKeyPolicyPlayReadyContentType. */ + public static final ContentKeyPolicyPlayReadyContentType UNSPECIFIED = fromString("Unspecified"); + + /** Static value UltraVioletDownload for ContentKeyPolicyPlayReadyContentType. */ + public static final ContentKeyPolicyPlayReadyContentType ULTRA_VIOLET_DOWNLOAD = fromString("UltraVioletDownload"); + + /** Static value UltraVioletStreaming for ContentKeyPolicyPlayReadyContentType. */ + public static final ContentKeyPolicyPlayReadyContentType ULTRA_VIOLET_STREAMING = + fromString("UltraVioletStreaming"); + + /** + * Creates or finds a ContentKeyPolicyPlayReadyContentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentKeyPolicyPlayReadyContentType. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyContentType fromString(String name) { + return fromString(name, ContentKeyPolicyPlayReadyContentType.class); + } + + /** @return known ContentKeyPolicyPlayReadyContentType values. */ + public static Collection values() { + return values(ContentKeyPolicyPlayReadyContentType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java new file mode 100644 index 000000000000..1140848c8303 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configures the Explicit Analog Television Output Restriction control bits. For further details see the PlayReady + * Compliance Rules. + */ +@Fluent +public final class ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction.class); + + /* + * 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 the bestEffort property: Indicates whether this restriction is enforced on a Best Effort basis. + * + * @return the bestEffort value. + */ + public boolean bestEffort() { + return this.bestEffort; + } + + /** + * Set the bestEffort property: 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 the configurationData property: Configures the restriction control bits. Must be between 0 and 3 inclusive. + * + * @return the configurationData value. + */ + public int configurationData() { + return this.configurationData; + } + + /** + * Set the configurationData property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyLicense.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyLicense.java new file mode 100644 index 000000000000..e406e169afb4 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyLicense.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** The PlayReady license. */ +@Fluent +public final class ContentKeyPolicyPlayReadyLicense { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyPlayReadyLicense.class); + + /* + * 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 OffsetDateTime beginDate; + + /* + * The expiration date of license. + */ + @JsonProperty(value = "expirationDate") + private OffsetDateTime expirationDate; + + /* + * The relative begin date of license. + */ + @JsonProperty(value = "relativeBeginDate") + private Duration relativeBeginDate; + + /* + * The relative expiration date of license. + */ + @JsonProperty(value = "relativeExpirationDate") + private Duration relativeExpirationDate; + + /* + * The grace period of license. + */ + @JsonProperty(value = "gracePeriod") + private Duration gracePeriod; + + /* + * The license PlayRight + */ + @JsonProperty(value = "playRight") + private ContentKeyPolicyPlayReadyPlayRight playRight; + + /* + * The license type. + */ + @JsonProperty(value = "licenseType", required = true) + private ContentKeyPolicyPlayReadyLicenseType licenseType; + + /* + * The content key location. + */ + @JsonProperty(value = "contentKeyLocation", required = true) + private ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation; + + /* + * The PlayReady content type. + */ + @JsonProperty(value = "contentType", required = true) + private ContentKeyPolicyPlayReadyContentType contentType; + + /** + * Get the allowTestDevices property: A flag indicating whether test devices can use the license. + * + * @return the allowTestDevices value. + */ + public boolean allowTestDevices() { + return this.allowTestDevices; + } + + /** + * Set the allowTestDevices property: 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 beginDate property: The begin date of license. + * + * @return the beginDate value. + */ + public OffsetDateTime beginDate() { + return this.beginDate; + } + + /** + * Set the beginDate property: The begin date of license. + * + * @param beginDate the beginDate value to set. + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withBeginDate(OffsetDateTime beginDate) { + this.beginDate = beginDate; + return this; + } + + /** + * Get the expirationDate property: The expiration date of license. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: The expiration date of license. + * + * @param expirationDate the expirationDate value to set. + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withExpirationDate(OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the relativeBeginDate property: The relative begin date of license. + * + * @return the relativeBeginDate value. + */ + public Duration relativeBeginDate() { + return this.relativeBeginDate; + } + + /** + * Set the relativeBeginDate property: The relative begin date of license. + * + * @param relativeBeginDate the relativeBeginDate value to set. + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withRelativeBeginDate(Duration relativeBeginDate) { + this.relativeBeginDate = relativeBeginDate; + return this; + } + + /** + * Get the relativeExpirationDate property: The relative expiration date of license. + * + * @return the relativeExpirationDate value. + */ + public Duration relativeExpirationDate() { + return this.relativeExpirationDate; + } + + /** + * Set the relativeExpirationDate property: The relative expiration date of license. + * + * @param relativeExpirationDate the relativeExpirationDate value to set. + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withRelativeExpirationDate(Duration relativeExpirationDate) { + this.relativeExpirationDate = relativeExpirationDate; + return this; + } + + /** + * Get the gracePeriod property: The grace period of license. + * + * @return the gracePeriod value. + */ + public Duration gracePeriod() { + return this.gracePeriod; + } + + /** + * Set the gracePeriod property: The grace period of license. + * + * @param gracePeriod the gracePeriod value to set. + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withGracePeriod(Duration gracePeriod) { + this.gracePeriod = gracePeriod; + return this; + } + + /** + * Get the playRight property: The license PlayRight. + * + * @return the playRight value. + */ + public ContentKeyPolicyPlayReadyPlayRight playRight() { + return this.playRight; + } + + /** + * Set the playRight property: 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 licenseType property: The license type. + * + * @return the licenseType value. + */ + public ContentKeyPolicyPlayReadyLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The license type. + * + * @param licenseType the licenseType value to set. + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withLicenseType(ContentKeyPolicyPlayReadyLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the contentKeyLocation property: The content key location. + * + * @return the contentKeyLocation value. + */ + public ContentKeyPolicyPlayReadyContentKeyLocation contentKeyLocation() { + return this.contentKeyLocation; + } + + /** + * Set the contentKeyLocation property: 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 contentType property: The PlayReady content type. + * + * @return the contentType value. + */ + public ContentKeyPolicyPlayReadyContentType contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The PlayReady content type. + * + * @param contentType the contentType value to set. + * @return the ContentKeyPolicyPlayReadyLicense object itself. + */ + public ContentKeyPolicyPlayReadyLicense withContentType(ContentKeyPolicyPlayReadyContentType contentType) { + this.contentType = contentType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (playRight() != null) { + playRight().validate(); + } + if (licenseType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property licenseType in model ContentKeyPolicyPlayReadyLicense")); + } + if (contentKeyLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property contentKeyLocation in model ContentKeyPolicyPlayReadyLicense")); + } else { + contentKeyLocation().validate(); + } + if (contentType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property contentType in model ContentKeyPolicyPlayReadyLicense")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyLicenseType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyLicenseType.java new file mode 100644 index 000000000000..3a171b1e58e7 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyLicenseType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContentKeyPolicyPlayReadyLicenseType. */ +public final class ContentKeyPolicyPlayReadyLicenseType + extends ExpandableStringEnum { + /** Static value Unknown for ContentKeyPolicyPlayReadyLicenseType. */ + public static final ContentKeyPolicyPlayReadyLicenseType UNKNOWN = fromString("Unknown"); + + /** Static value NonPersistent for ContentKeyPolicyPlayReadyLicenseType. */ + public static final ContentKeyPolicyPlayReadyLicenseType NON_PERSISTENT = fromString("NonPersistent"); + + /** Static value Persistent for ContentKeyPolicyPlayReadyLicenseType. */ + public static final ContentKeyPolicyPlayReadyLicenseType PERSISTENT = fromString("Persistent"); + + /** + * Creates or finds a ContentKeyPolicyPlayReadyLicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentKeyPolicyPlayReadyLicenseType. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyLicenseType fromString(String name) { + return fromString(name, ContentKeyPolicyPlayReadyLicenseType.class); + } + + /** @return known ContentKeyPolicyPlayReadyLicenseType values. */ + public static Collection values() { + return values(ContentKeyPolicyPlayReadyLicenseType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyPlayRight.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyPlayRight.java new file mode 100644 index 000000000000..ad13599c52d5 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyPlayRight.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** Configures the Play Right in the PlayReady license. */ +@Fluent +public final class ContentKeyPolicyPlayReadyPlayRight { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyPlayReadyPlayRight.class); + + /* + * The amount of time that the license is valid after the license is first + * used to play content. + */ + @JsonProperty(value = "firstPlayExpiration") + private Duration 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. + */ + @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 firstPlayExpiration property: The amount of time that the license is valid after the license is first + * used to play content. + * + * @return the firstPlayExpiration value. + */ + public Duration firstPlayExpiration() { + return this.firstPlayExpiration; + } + + /** + * Set the firstPlayExpiration property: 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(Duration firstPlayExpiration) { + this.firstPlayExpiration = firstPlayExpiration; + return this; + } + + /** + * Get the scmsRestriction property: 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 the scmsRestriction property: 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 the agcAndColorStripeRestriction property: 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 the agcAndColorStripeRestriction property: 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 the explicitAnalogTelevisionOutputRestriction property: 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 the explicitAnalogTelevisionOutputRestriction property: 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 the digitalVideoOnlyContentRestriction property: Enables the Image Constraint For Analog Component Video + * Restriction in the license. + * + * @return the digitalVideoOnlyContentRestriction value. + */ + public boolean digitalVideoOnlyContentRestriction() { + return this.digitalVideoOnlyContentRestriction; + } + + /** + * Set the digitalVideoOnlyContentRestriction property: 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 the imageConstraintForAnalogComponentVideoRestriction property: Enables the Image Constraint For Analog + * Component Video Restriction in the license. + * + * @return the imageConstraintForAnalogComponentVideoRestriction value. + */ + public boolean imageConstraintForAnalogComponentVideoRestriction() { + return this.imageConstraintForAnalogComponentVideoRestriction; + } + + /** + * Set the imageConstraintForAnalogComponentVideoRestriction property: 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 the imageConstraintForAnalogComputerMonitorRestriction property: Enables the Image Constraint For Analog + * Component Video Restriction in the license. + * + * @return the imageConstraintForAnalogComputerMonitorRestriction value. + */ + public boolean imageConstraintForAnalogComputerMonitorRestriction() { + return this.imageConstraintForAnalogComputerMonitorRestriction; + } + + /** + * Set the imageConstraintForAnalogComputerMonitorRestriction property: 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 the allowPassingVideoContentToUnknownOutput property: Configures Unknown output handling settings of the + * license. + * + * @return the allowPassingVideoContentToUnknownOutput value. + */ + public ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput() { + return this.allowPassingVideoContentToUnknownOutput; + } + + /** + * Set the allowPassingVideoContentToUnknownOutput property: Configures Unknown output handling settings of the + * license. + * + * @param allowPassingVideoContentToUnknownOutput the allowPassingVideoContentToUnknownOutput value to set. + * @return the ContentKeyPolicyPlayReadyPlayRight object itself. + */ + public ContentKeyPolicyPlayReadyPlayRight withAllowPassingVideoContentToUnknownOutput( + ContentKeyPolicyPlayReadyUnknownOutputPassingOption allowPassingVideoContentToUnknownOutput) { + this.allowPassingVideoContentToUnknownOutput = allowPassingVideoContentToUnknownOutput; + return this; + } + + /** + * Get the uncompressedDigitalVideoOpl property: Specifies the output protection level for uncompressed digital + * video. + * + * @return the uncompressedDigitalVideoOpl value. + */ + public Integer uncompressedDigitalVideoOpl() { + return this.uncompressedDigitalVideoOpl; + } + + /** + * Set the uncompressedDigitalVideoOpl property: 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 the compressedDigitalVideoOpl property: Specifies the output protection level for compressed digital video. + * + * @return the compressedDigitalVideoOpl value. + */ + public Integer compressedDigitalVideoOpl() { + return this.compressedDigitalVideoOpl; + } + + /** + * Set the compressedDigitalVideoOpl property: 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 the analogVideoOpl property: Specifies the output protection level for compressed digital audio. + * + * @return the analogVideoOpl value. + */ + public Integer analogVideoOpl() { + return this.analogVideoOpl; + } + + /** + * Set the analogVideoOpl property: 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 the compressedDigitalAudioOpl property: Specifies the output protection level for compressed digital audio. + * + * @return the compressedDigitalAudioOpl value. + */ + public Integer compressedDigitalAudioOpl() { + return this.compressedDigitalAudioOpl; + } + + /** + * Set the compressedDigitalAudioOpl property: 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 the uncompressedDigitalAudioOpl property: Specifies the output protection level for uncompressed digital + * audio. + * + * @return the uncompressedDigitalAudioOpl value. + */ + public Integer uncompressedDigitalAudioOpl() { + return this.uncompressedDigitalAudioOpl; + } + + /** + * Set the uncompressedDigitalAudioOpl property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (explicitAnalogTelevisionOutputRestriction() != null) { + explicitAnalogTelevisionOutputRestriction().validate(); + } + if (allowPassingVideoContentToUnknownOutput() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property allowPassingVideoContentToUnknownOutput in model" + + " ContentKeyPolicyPlayReadyPlayRight")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java new file mode 100644 index 000000000000..68785ea617af --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyPlayReadyUnknownOutputPassingOption.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContentKeyPolicyPlayReadyUnknownOutputPassingOption. */ +public final class ContentKeyPolicyPlayReadyUnknownOutputPassingOption + extends ExpandableStringEnum { + /** Static value Unknown for ContentKeyPolicyPlayReadyUnknownOutputPassingOption. */ + public static final ContentKeyPolicyPlayReadyUnknownOutputPassingOption UNKNOWN = fromString("Unknown"); + + /** Static value NotAllowed for ContentKeyPolicyPlayReadyUnknownOutputPassingOption. */ + public static final ContentKeyPolicyPlayReadyUnknownOutputPassingOption NOT_ALLOWED = fromString("NotAllowed"); + + /** Static value Allowed for ContentKeyPolicyPlayReadyUnknownOutputPassingOption. */ + public static final ContentKeyPolicyPlayReadyUnknownOutputPassingOption ALLOWED = fromString("Allowed"); + + /** Static value AllowedWithVideoConstriction for ContentKeyPolicyPlayReadyUnknownOutputPassingOption. */ + public static final ContentKeyPolicyPlayReadyUnknownOutputPassingOption ALLOWED_WITH_VIDEO_CONSTRICTION = + fromString("AllowedWithVideoConstriction"); + + /** + * Creates or finds a ContentKeyPolicyPlayReadyUnknownOutputPassingOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentKeyPolicyPlayReadyUnknownOutputPassingOption. + */ + @JsonCreator + public static ContentKeyPolicyPlayReadyUnknownOutputPassingOption fromString(String name) { + return fromString(name, ContentKeyPolicyPlayReadyUnknownOutputPassingOption.class); + } + + /** @return known ContentKeyPolicyPlayReadyUnknownOutputPassingOption values. */ + public static Collection values() { + return values(ContentKeyPolicyPlayReadyUnknownOutputPassingOption.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyProperties.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyProperties.java new file mode 100644 index 000000000000..442b996edeb8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyProperties.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyPropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** An immutable client-side representation of ContentKeyPolicyProperties. */ +public interface ContentKeyPolicyProperties { + /** + * Gets the policyId property: The legacy Policy ID. + * + * @return the policyId value. + */ + UUID policyId(); + + /** + * Gets the created property: The creation date of the Policy. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the lastModified property: The last modified date of the Policy. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the description property: A description for the Policy. + * + * @return the description value. + */ + String description(); + + /** + * Gets the options property: The Key Policy options. + * + * @return the options value. + */ + List options(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyPropertiesInner object. + * + * @return the inner object. + */ + ContentKeyPolicyPropertiesInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRestriction.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRestriction.java new file mode 100644 index 000000000000..99201ef2fd25 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRestriction.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** 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", + defaultImpl = ContentKeyPolicyRestriction.class) +@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) +}) +@JsonFlatten +@Immutable +public class ContentKeyPolicyRestriction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyRestriction.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRestrictionTokenKey.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRestrictionTokenKey.java new file mode 100644 index 000000000000..8e5e9ede7e5e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRestrictionTokenKey.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** 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", + defaultImpl = ContentKeyPolicyRestrictionTokenKey.class) +@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) +}) +@JsonFlatten +@Immutable +public class ContentKeyPolicyRestrictionTokenKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyRestrictionTokenKey.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRestrictionTokenType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRestrictionTokenType.java new file mode 100644 index 000000000000..f68bd63c619f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRestrictionTokenType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContentKeyPolicyRestrictionTokenType. */ +public final class ContentKeyPolicyRestrictionTokenType + extends ExpandableStringEnum { + /** Static value Unknown for ContentKeyPolicyRestrictionTokenType. */ + public static final ContentKeyPolicyRestrictionTokenType UNKNOWN = fromString("Unknown"); + + /** Static value Swt for ContentKeyPolicyRestrictionTokenType. */ + public static final ContentKeyPolicyRestrictionTokenType SWT = fromString("Swt"); + + /** Static value Jwt for ContentKeyPolicyRestrictionTokenType. */ + public static final ContentKeyPolicyRestrictionTokenType JWT = fromString("Jwt"); + + /** + * Creates or finds a ContentKeyPolicyRestrictionTokenType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentKeyPolicyRestrictionTokenType. + */ + @JsonCreator + public static ContentKeyPolicyRestrictionTokenType fromString(String name) { + return fromString(name, ContentKeyPolicyRestrictionTokenType.class); + } + + /** @return known ContentKeyPolicyRestrictionTokenType values. */ + public static Collection values() { + return values(ContentKeyPolicyRestrictionTokenType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRsaTokenKey.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRsaTokenKey.java new file mode 100644 index 000000000000..ecf9ad8c78c8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyRsaTokenKey.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Fluent +public class ContentKeyPolicyRsaTokenKey extends ContentKeyPolicyRestrictionTokenKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyRsaTokenKey.class); + + /* + * 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 exponent property: The RSA Parameter exponent. + * + * @return the exponent value. + */ + public byte[] exponent() { + return CoreUtils.clone(this.exponent); + } + + /** + * Set the exponent property: The RSA Parameter exponent. + * + * @param exponent the exponent value to set. + * @return the ContentKeyPolicyRsaTokenKey object itself. + */ + public ContentKeyPolicyRsaTokenKey withExponent(byte[] exponent) { + this.exponent = CoreUtils.clone(exponent); + return this; + } + + /** + * Get the modulus property: The RSA Parameter modulus. + * + * @return the modulus value. + */ + public byte[] modulus() { + return CoreUtils.clone(this.modulus); + } + + /** + * Set the modulus property: The RSA Parameter modulus. + * + * @param modulus the modulus value to set. + * @return the ContentKeyPolicyRsaTokenKey object itself. + */ + public ContentKeyPolicyRsaTokenKey withModulus(byte[] modulus) { + this.modulus = CoreUtils.clone(modulus); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exponent() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property exponent in model ContentKeyPolicyRsaTokenKey")); + } + if (modulus() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property modulus in model ContentKeyPolicyRsaTokenKey")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicySymmetricTokenKey.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicySymmetricTokenKey.java new file mode 100644 index 000000000000..ea6e5463d6b1 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicySymmetricTokenKey.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Fluent +public class ContentKeyPolicySymmetricTokenKey extends ContentKeyPolicyRestrictionTokenKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicySymmetricTokenKey.class); + + /* + * The key value of the key + */ + @JsonProperty(value = "keyValue", required = true) + private byte[] keyValue; + + /** + * Get the keyValue property: The key value of the key. + * + * @return the keyValue value. + */ + public byte[] keyValue() { + return CoreUtils.clone(this.keyValue); + } + + /** + * Set the keyValue property: 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 = CoreUtils.clone(keyValue); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (keyValue() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyValue in model ContentKeyPolicySymmetricTokenKey")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyTokenClaim.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyTokenClaim.java new file mode 100644 index 000000000000..7d48e0e9cb38 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyTokenClaim.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents a token claim. */ +@Fluent +public final class ContentKeyPolicyTokenClaim { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyTokenClaim.class); + + /* + * Token claim type. + */ + @JsonProperty(value = "claimType") + private String claimType; + + /* + * Token claim value. + */ + @JsonProperty(value = "claimValue") + private String claimValue; + + /** + * Get the claimType property: Token claim type. + * + * @return the claimType value. + */ + public String claimType() { + return this.claimType; + } + + /** + * Set the claimType property: 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 the claimValue property: Token claim value. + * + * @return the claimValue value. + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Set the claimValue property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyTokenRestriction.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyTokenRestriction.java new file mode 100644 index 000000000000..beab34d41120 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyTokenRestriction.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * 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") +@JsonFlatten +@Fluent +public class ContentKeyPolicyTokenRestriction extends ContentKeyPolicyRestriction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyTokenRestriction.class); + + /* + * 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. + */ + @JsonProperty(value = "restrictionTokenType", required = true) + private ContentKeyPolicyRestrictionTokenType restrictionTokenType; + + /* + * The OpenID connect discovery document. + */ + @JsonProperty(value = "openIdConnectDiscoveryDocument") + private String openIdConnectDiscoveryDocument; + + /** + * Get the issuer property: The token issuer. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the issuer property: 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 property: The audience for the token. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience property: 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 primaryVerificationKey property: The primary verification key. + * + * @return the primaryVerificationKey value. + */ + public ContentKeyPolicyRestrictionTokenKey primaryVerificationKey() { + return this.primaryVerificationKey; + } + + /** + * Set the primaryVerificationKey property: 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 the alternateVerificationKeys property: A list of alternative verification keys. + * + * @return the alternateVerificationKeys value. + */ + public List alternateVerificationKeys() { + return this.alternateVerificationKeys; + } + + /** + * Set the alternateVerificationKeys property: 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 the requiredClaims property: A list of required token claims. + * + * @return the requiredClaims value. + */ + public List requiredClaims() { + return this.requiredClaims; + } + + /** + * Set the requiredClaims property: 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 restrictionTokenType property: The type of token. + * + * @return the restrictionTokenType value. + */ + public ContentKeyPolicyRestrictionTokenType restrictionTokenType() { + return this.restrictionTokenType; + } + + /** + * Set the restrictionTokenType property: The type of token. + * + * @param restrictionTokenType the restrictionTokenType value to set. + * @return the ContentKeyPolicyTokenRestriction object itself. + */ + public ContentKeyPolicyTokenRestriction withRestrictionTokenType( + ContentKeyPolicyRestrictionTokenType restrictionTokenType) { + this.restrictionTokenType = restrictionTokenType; + return this; + } + + /** + * Get the openIdConnectDiscoveryDocument property: The OpenID connect discovery document. + * + * @return the openIdConnectDiscoveryDocument value. + */ + public String openIdConnectDiscoveryDocument() { + return this.openIdConnectDiscoveryDocument; + } + + /** + * Set the openIdConnectDiscoveryDocument property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (issuer() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property issuer in model ContentKeyPolicyTokenRestriction")); + } + if (audience() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property audience in model ContentKeyPolicyTokenRestriction")); + } + if (primaryVerificationKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property primaryVerificationKey in model ContentKeyPolicyTokenRestriction")); + } else { + primaryVerificationKey().validate(); + } + if (alternateVerificationKeys() != null) { + alternateVerificationKeys().forEach(e -> e.validate()); + } + if (requiredClaims() != null) { + requiredClaims().forEach(e -> e.validate()); + } + if (restrictionTokenType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property restrictionTokenType in model ContentKeyPolicyTokenRestriction")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyUnknownConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyUnknownConfiguration.java new file mode 100644 index 000000000000..16e3e9cdba7c --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyUnknownConfiguration.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class ContentKeyPolicyUnknownConfiguration extends ContentKeyPolicyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyUnknownConfiguration.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyUnknownRestriction.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyUnknownRestriction.java new file mode 100644 index 000000000000..403e591daafa --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyUnknownRestriction.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class ContentKeyPolicyUnknownRestriction extends ContentKeyPolicyRestriction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyUnknownRestriction.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyWidevineConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyWidevineConfiguration.java new file mode 100644 index 000000000000..3a412cfa3d28 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyWidevineConfiguration.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Fluent +public class ContentKeyPolicyWidevineConfiguration extends ContentKeyPolicyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyWidevineConfiguration.class); + + /* + * The Widevine template. + */ + @JsonProperty(value = "widevineTemplate", required = true) + private String widevineTemplate; + + /** + * Get the widevineTemplate property: The Widevine template. + * + * @return the widevineTemplate value. + */ + public String widevineTemplate() { + return this.widevineTemplate; + } + + /** + * Set the widevineTemplate property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (widevineTemplate() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property widevineTemplate in model ContentKeyPolicyWidevineConfiguration")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyX509CertificateTokenKey.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyX509CertificateTokenKey.java new file mode 100644 index 000000000000..088d4f39980d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicyX509CertificateTokenKey.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Fluent +public class ContentKeyPolicyX509CertificateTokenKey extends ContentKeyPolicyRestrictionTokenKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentKeyPolicyX509CertificateTokenKey.class); + + /* + * The raw data field of a certificate in PKCS 12 format (X509Certificate2 + * in .NET) + */ + @JsonProperty(value = "rawBody", required = true) + private byte[] rawBody; + + /** + * Get the rawBody property: The raw data field of a certificate in PKCS 12 format (X509Certificate2 in .NET). + * + * @return the rawBody value. + */ + public byte[] rawBody() { + return CoreUtils.clone(this.rawBody); + } + + /** + * Set the rawBody property: 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 = CoreUtils.clone(rawBody); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (rawBody() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rawBody in model ContentKeyPolicyX509CertificateTokenKey")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CopyAudio.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CopyAudio.java new file mode 100644 index 000000000000..e44ade33fb05 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CopyAudio.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class CopyAudio extends Codec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CopyAudio.class); + + /** {@inheritDoc} */ + @Override + public CopyAudio withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CopyVideo.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CopyVideo.java new file mode 100644 index 000000000000..dee453d101fc --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CopyVideo.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class CopyVideo extends Codec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CopyVideo.class); + + /** {@inheritDoc} */ + @Override + public CopyVideo withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CrossSiteAccessPolicies.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CrossSiteAccessPolicies.java new file mode 100644 index 000000000000..87d6f6f72810 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CrossSiteAccessPolicies.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The client access policy. */ +@Fluent +public final class CrossSiteAccessPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CrossSiteAccessPolicies.class); + + /* + * 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 clientAccessPolicy property: The content of clientaccesspolicy.xml used by Silverlight. + * + * @return the clientAccessPolicy value. + */ + public String clientAccessPolicy() { + return this.clientAccessPolicy; + } + + /** + * Set the clientAccessPolicy property: 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 crossDomainPolicy property: The content of crossdomain.xml used by Silverlight. + * + * @return the crossDomainPolicy value. + */ + public String crossDomainPolicy() { + return this.crossDomainPolicy; + } + + /** + * Set the crossDomainPolicy property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DefaultKey.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DefaultKey.java new file mode 100644 index 000000000000..b7a69853bb5d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DefaultKey.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class to specify properties of default content key for each encryption scheme. */ +@Fluent +public final class DefaultKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultKey.class); + + /* + * 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 the label property: Label can be used to specify Content Key when creating a Streaming Locator. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: 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 the policyName property: Policy used by Default Key. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Deinterlace.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Deinterlace.java new file mode 100644 index 000000000000..3323f10f7759 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Deinterlace.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the de-interlacing settings. */ +@Fluent +public final class Deinterlace { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Deinterlace.class); + + /* + * The field parity for de-interlacing, defaults to Auto. + */ + @JsonProperty(value = "parity") + private DeinterlaceParity parity; + + /* + * The deinterlacing mode. Defaults to AutoPixelAdaptive. + */ + @JsonProperty(value = "mode") + private DeinterlaceMode mode; + + /** + * Get the parity property: The field parity for de-interlacing, defaults to Auto. + * + * @return the parity value. + */ + public DeinterlaceParity parity() { + return this.parity; + } + + /** + * Set the parity property: The field parity for de-interlacing, defaults to Auto. + * + * @param parity the parity value to set. + * @return the Deinterlace object itself. + */ + public Deinterlace withParity(DeinterlaceParity parity) { + this.parity = parity; + return this; + } + + /** + * Get the mode property: The deinterlacing mode. Defaults to AutoPixelAdaptive. + * + * @return the mode value. + */ + public DeinterlaceMode mode() { + return this.mode; + } + + /** + * Set the mode property: The deinterlacing mode. Defaults to AutoPixelAdaptive. + * + * @param mode the mode value to set. + * @return the Deinterlace object itself. + */ + public Deinterlace withMode(DeinterlaceMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DeinterlaceMode.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DeinterlaceMode.java new file mode 100644 index 000000000000..c4e03ad88fea --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DeinterlaceMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeinterlaceMode. */ +public final class DeinterlaceMode extends ExpandableStringEnum { + /** Static value Off for DeinterlaceMode. */ + public static final DeinterlaceMode OFF = fromString("Off"); + + /** Static value AutoPixelAdaptive for DeinterlaceMode. */ + public static final DeinterlaceMode AUTO_PIXEL_ADAPTIVE = fromString("AutoPixelAdaptive"); + + /** + * Creates or finds a DeinterlaceMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeinterlaceMode. + */ + @JsonCreator + public static DeinterlaceMode fromString(String name) { + return fromString(name, DeinterlaceMode.class); + } + + /** @return known DeinterlaceMode values. */ + public static Collection values() { + return values(DeinterlaceMode.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DeinterlaceParity.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DeinterlaceParity.java new file mode 100644 index 000000000000..e656dd50c730 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DeinterlaceParity.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeinterlaceParity. */ +public final class DeinterlaceParity extends ExpandableStringEnum { + /** Static value Auto for DeinterlaceParity. */ + public static final DeinterlaceParity AUTO = fromString("Auto"); + + /** Static value TopFieldFirst for DeinterlaceParity. */ + public static final DeinterlaceParity TOP_FIELD_FIRST = fromString("TopFieldFirst"); + + /** Static value BottomFieldFirst for DeinterlaceParity. */ + public static final DeinterlaceParity BOTTOM_FIELD_FIRST = fromString("BottomFieldFirst"); + + /** + * Creates or finds a DeinterlaceParity from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeinterlaceParity. + */ + @JsonCreator + public static DeinterlaceParity fromString(String name) { + return fromString(name, DeinterlaceParity.class); + } + + /** @return known DeinterlaceParity values. */ + public static Collection values() { + return values(DeinterlaceParity.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EdgePolicies.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EdgePolicies.java new file mode 100644 index 000000000000..bf3c73549536 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EdgePolicies.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.EdgePoliciesInner; + +/** An immutable client-side representation of EdgePolicies. */ +public interface EdgePolicies { + /** + * Gets the usageDataCollectionPolicy property: The usageDataCollectionPolicy property. + * + * @return the usageDataCollectionPolicy value. + */ + EdgeUsageDataCollectionPolicy usageDataCollectionPolicy(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.EdgePoliciesInner object. + * + * @return the inner object. + */ + EdgePoliciesInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EdgeUsageDataCollectionPolicy.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EdgeUsageDataCollectionPolicy.java new file mode 100644 index 000000000000..bb318dbe2251 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EdgeUsageDataCollectionPolicy.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EdgeUsageDataCollectionPolicy model. */ +@Fluent +public final class EdgeUsageDataCollectionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EdgeUsageDataCollectionPolicy.class); + + /* + * Usage data collection frequency in ISO 8601 duration format e.g. PT10M , + * PT5H. + */ + @JsonProperty(value = "dataCollectionFrequency") + private String dataCollectionFrequency; + + /* + * Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , + * PT5H. + */ + @JsonProperty(value = "dataReportingFrequency") + private String dataReportingFrequency; + + /* + * Maximum time for which the functionality of the device will not be + * hampered for not reporting the usage data. + */ + @JsonProperty(value = "maxAllowedUnreportedUsageDuration") + private String maxAllowedUnreportedUsageDuration; + + /* + * Details of Event Hub where the usage will be reported. + */ + @JsonProperty(value = "eventHubDetails") + private EdgeUsageDataEventHub eventHubDetails; + + /** + * Get the dataCollectionFrequency property: Usage data collection frequency in ISO 8601 duration format e.g. PT10M + * , PT5H. + * + * @return the dataCollectionFrequency value. + */ + public String dataCollectionFrequency() { + return this.dataCollectionFrequency; + } + + /** + * Set the dataCollectionFrequency property: Usage data collection frequency in ISO 8601 duration format e.g. PT10M + * , PT5H. + * + * @param dataCollectionFrequency the dataCollectionFrequency value to set. + * @return the EdgeUsageDataCollectionPolicy object itself. + */ + public EdgeUsageDataCollectionPolicy withDataCollectionFrequency(String dataCollectionFrequency) { + this.dataCollectionFrequency = dataCollectionFrequency; + return this; + } + + /** + * Get the dataReportingFrequency property: Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , + * PT5H. + * + * @return the dataReportingFrequency value. + */ + public String dataReportingFrequency() { + return this.dataReportingFrequency; + } + + /** + * Set the dataReportingFrequency property: Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , + * PT5H. + * + * @param dataReportingFrequency the dataReportingFrequency value to set. + * @return the EdgeUsageDataCollectionPolicy object itself. + */ + public EdgeUsageDataCollectionPolicy withDataReportingFrequency(String dataReportingFrequency) { + this.dataReportingFrequency = dataReportingFrequency; + return this; + } + + /** + * Get the maxAllowedUnreportedUsageDuration property: Maximum time for which the functionality of the device will + * not be hampered for not reporting the usage data. + * + * @return the maxAllowedUnreportedUsageDuration value. + */ + public String maxAllowedUnreportedUsageDuration() { + return this.maxAllowedUnreportedUsageDuration; + } + + /** + * Set the maxAllowedUnreportedUsageDuration property: Maximum time for which the functionality of the device will + * not be hampered for not reporting the usage data. + * + * @param maxAllowedUnreportedUsageDuration the maxAllowedUnreportedUsageDuration value to set. + * @return the EdgeUsageDataCollectionPolicy object itself. + */ + public EdgeUsageDataCollectionPolicy withMaxAllowedUnreportedUsageDuration( + String maxAllowedUnreportedUsageDuration) { + this.maxAllowedUnreportedUsageDuration = maxAllowedUnreportedUsageDuration; + return this; + } + + /** + * Get the eventHubDetails property: Details of Event Hub where the usage will be reported. + * + * @return the eventHubDetails value. + */ + public EdgeUsageDataEventHub eventHubDetails() { + return this.eventHubDetails; + } + + /** + * Set the eventHubDetails property: Details of Event Hub where the usage will be reported. + * + * @param eventHubDetails the eventHubDetails value to set. + * @return the EdgeUsageDataCollectionPolicy object itself. + */ + public EdgeUsageDataCollectionPolicy withEventHubDetails(EdgeUsageDataEventHub eventHubDetails) { + this.eventHubDetails = eventHubDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (eventHubDetails() != null) { + eventHubDetails().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EdgeUsageDataEventHub.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EdgeUsageDataEventHub.java new file mode 100644 index 000000000000..58ee28063a55 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EdgeUsageDataEventHub.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EdgeUsageDataEventHub model. */ +@Fluent +public final class EdgeUsageDataEventHub { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EdgeUsageDataEventHub.class); + + /* + * Name of the Event Hub where usage will be reported. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Namespace of the Event Hub where usage will be reported. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * SAS token needed to interact with Event Hub. + */ + @JsonProperty(value = "token") + private String token; + + /** + * Get the name property: Name of the Event Hub where usage will be reported. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Event Hub where usage will be reported. + * + * @param name the name value to set. + * @return the EdgeUsageDataEventHub object itself. + */ + public EdgeUsageDataEventHub withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: Namespace of the Event Hub where usage will be reported. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: Namespace of the Event Hub where usage will be reported. + * + * @param namespace the namespace value to set. + * @return the EdgeUsageDataEventHub object itself. + */ + public EdgeUsageDataEventHub withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the token property: SAS token needed to interact with Event Hub. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Set the token property: SAS token needed to interact with Event Hub. + * + * @param token the token value to set. + * @return the EdgeUsageDataEventHub object itself. + */ + public EdgeUsageDataEventHub withToken(String token) { + this.token = token; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EnabledProtocols.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EnabledProtocols.java new file mode 100644 index 000000000000..8262203b5e6a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EnabledProtocols.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class to specify which protocols are enabled. */ +@Fluent +public final class EnabledProtocols { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnabledProtocols.class); + + /* + * 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 the download property: Enable Download protocol or not. + * + * @return the download value. + */ + public boolean download() { + return this.download; + } + + /** + * Set the download property: 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 the dash property: Enable DASH protocol or not. + * + * @return the dash value. + */ + public boolean dash() { + return this.dash; + } + + /** + * Set the dash property: 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 the hls property: Enable HLS protocol or not. + * + * @return the hls value. + */ + public boolean hls() { + return this.hls; + } + + /** + * Set the hls property: 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 the smoothStreaming property: Enable SmoothStreaming protocol or not. + * + * @return the smoothStreaming value. + */ + public boolean smoothStreaming() { + return this.smoothStreaming; + } + + /** + * Set the smoothStreaming property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EncoderNamedPreset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EncoderNamedPreset.java new file mode 100644 index 000000000000..d87ddeea1dd8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EncoderNamedPreset.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncoderNamedPreset. */ +public final class EncoderNamedPreset extends ExpandableStringEnum { + /** Static value H264SingleBitrateSD for EncoderNamedPreset. */ + public static final EncoderNamedPreset H264SINGLE_BITRATE_SD = fromString("H264SingleBitrateSD"); + + /** Static value H264SingleBitrate720p for EncoderNamedPreset. */ + public static final EncoderNamedPreset H264SINGLE_BITRATE720P = fromString("H264SingleBitrate720p"); + + /** Static value H264SingleBitrate1080p for EncoderNamedPreset. */ + public static final EncoderNamedPreset H264SINGLE_BITRATE1080P = fromString("H264SingleBitrate1080p"); + + /** Static value AdaptiveStreaming for EncoderNamedPreset. */ + public static final EncoderNamedPreset ADAPTIVE_STREAMING = fromString("AdaptiveStreaming"); + + /** Static value AACGoodQualityAudio for EncoderNamedPreset. */ + public static final EncoderNamedPreset AACGOOD_QUALITY_AUDIO = fromString("AACGoodQualityAudio"); + + /** Static value ContentAwareEncodingExperimental for EncoderNamedPreset. */ + public static final EncoderNamedPreset CONTENT_AWARE_ENCODING_EXPERIMENTAL = + fromString("ContentAwareEncodingExperimental"); + + /** Static value ContentAwareEncoding for EncoderNamedPreset. */ + public static final EncoderNamedPreset CONTENT_AWARE_ENCODING = fromString("ContentAwareEncoding"); + + /** Static value CopyAllBitrateNonInterleaved for EncoderNamedPreset. */ + public static final EncoderNamedPreset COPY_ALL_BITRATE_NON_INTERLEAVED = + fromString("CopyAllBitrateNonInterleaved"); + + /** Static value H264MultipleBitrate1080p for EncoderNamedPreset. */ + public static final EncoderNamedPreset H264MULTIPLE_BITRATE1080P = fromString("H264MultipleBitrate1080p"); + + /** Static value H264MultipleBitrate720p for EncoderNamedPreset. */ + public static final EncoderNamedPreset H264MULTIPLE_BITRATE720P = fromString("H264MultipleBitrate720p"); + + /** Static value H264MultipleBitrateSD for EncoderNamedPreset. */ + public static final EncoderNamedPreset H264MULTIPLE_BITRATE_SD = fromString("H264MultipleBitrateSD"); + + /** + * Creates or finds a EncoderNamedPreset from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncoderNamedPreset. + */ + @JsonCreator + public static EncoderNamedPreset fromString(String name) { + return fromString(name, EncoderNamedPreset.class); + } + + /** @return known EncoderNamedPreset values. */ + public static Collection values() { + return values(EncoderNamedPreset.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EncryptionScheme.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EncryptionScheme.java new file mode 100644 index 000000000000..e15ef784bcb0 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EncryptionScheme.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionScheme. */ +public final class EncryptionScheme extends ExpandableStringEnum { + /** Static value NoEncryption for EncryptionScheme. */ + public static final EncryptionScheme NO_ENCRYPTION = fromString("NoEncryption"); + + /** Static value EnvelopeEncryption for EncryptionScheme. */ + public static final EncryptionScheme ENVELOPE_ENCRYPTION = fromString("EnvelopeEncryption"); + + /** Static value CommonEncryptionCenc for EncryptionScheme. */ + public static final EncryptionScheme COMMON_ENCRYPTION_CENC = fromString("CommonEncryptionCenc"); + + /** Static value CommonEncryptionCbcs for EncryptionScheme. */ + public static final EncryptionScheme COMMON_ENCRYPTION_CBCS = fromString("CommonEncryptionCbcs"); + + /** + * Creates or finds a EncryptionScheme from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionScheme. + */ + @JsonCreator + public static EncryptionScheme fromString(String name) { + return fromString(name, EncryptionScheme.class); + } + + /** @return known EncryptionScheme values. */ + public static Collection values() { + return values(EncryptionScheme.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EntityNameAvailabilityCheckOutput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EntityNameAvailabilityCheckOutput.java new file mode 100644 index 000000000000..69c3e2268fe3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EntityNameAvailabilityCheckOutput.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.EntityNameAvailabilityCheckOutputInner; + +/** An immutable client-side representation of EntityNameAvailabilityCheckOutput. */ +public interface EntityNameAvailabilityCheckOutput { + /** + * Gets the nameAvailable property: Specifies if the name is available. + * + * @return the nameAvailable value. + */ + boolean nameAvailable(); + + /** + * Gets the reason property: Specifies the reason if the name is not available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: Specifies the detailed reason if the name is not available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.EntityNameAvailabilityCheckOutputInner + * object. + * + * @return the inner object. + */ + EntityNameAvailabilityCheckOutputInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EntropyMode.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EntropyMode.java new file mode 100644 index 000000000000..d1cdb255181d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EntropyMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EntropyMode. */ +public final class EntropyMode extends ExpandableStringEnum { + /** Static value Cabac for EntropyMode. */ + public static final EntropyMode CABAC = fromString("Cabac"); + + /** Static value Cavlc for EntropyMode. */ + public static final EntropyMode CAVLC = fromString("Cavlc"); + + /** + * Creates or finds a EntropyMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntropyMode. + */ + @JsonCreator + public static EntropyMode fromString(String name) { + return fromString(name, EntropyMode.class); + } + + /** @return known EntropyMode values. */ + public static Collection values() { + return values(EntropyMode.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EnvelopeEncryption.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EnvelopeEncryption.java new file mode 100644 index 000000000000..a5f822ddb4fa --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/EnvelopeEncryption.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class for EnvelopeEncryption encryption scheme. */ +@Fluent +public final class EnvelopeEncryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvelopeEncryption.class); + + /* + * 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; + + /* + * Template for the URL of the custom service delivering keys to end user + * players. Not required when using Azure Media Services for issuing keys. + * The template supports replaceable tokens that the service will update at + * runtime with the value specific to the request. The currently supported + * token values are {AlternativeMediaId}, which is replaced with the value + * of StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is + * replaced with the value of identifier of the key being requested. + */ + @JsonProperty(value = "customKeyAcquisitionUrlTemplate") + private String customKeyAcquisitionUrlTemplate; + + /** + * Get the enabledProtocols property: Representing supported protocols. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the enabledProtocols property: 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 the clearTracks property: Representing which tracks should not be encrypted. + * + * @return the clearTracks value. + */ + public List clearTracks() { + return this.clearTracks; + } + + /** + * Set the clearTracks property: 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 the contentKeys property: 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 the contentKeys property: 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 the customKeyAcquisitionUrlTemplate property: Template for the URL of the custom service delivering keys to + * end user players. Not required when using Azure Media Services for issuing keys. The template supports + * replaceable tokens that the service will update at runtime with the value specific to the request. The currently + * supported token values are {AlternativeMediaId}, which is replaced with the value of + * StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + * + * @return the customKeyAcquisitionUrlTemplate value. + */ + public String customKeyAcquisitionUrlTemplate() { + return this.customKeyAcquisitionUrlTemplate; + } + + /** + * Set the customKeyAcquisitionUrlTemplate property: Template for the URL of the custom service delivering keys to + * end user players. Not required when using Azure Media Services for issuing keys. The template supports + * replaceable tokens that the service will update at runtime with the value specific to the request. The currently + * supported token values are {AlternativeMediaId}, which is replaced with the value of + * StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + * + * @param customKeyAcquisitionUrlTemplate the customKeyAcquisitionUrlTemplate value to set. + * @return the EnvelopeEncryption object itself. + */ + public EnvelopeEncryption withCustomKeyAcquisitionUrlTemplate(String customKeyAcquisitionUrlTemplate) { + this.customKeyAcquisitionUrlTemplate = customKeyAcquisitionUrlTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (enabledProtocols() != null) { + enabledProtocols().validate(); + } + if (clearTracks() != null) { + clearTracks().forEach(e -> e.validate()); + } + if (contentKeys() != null) { + contentKeys().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FaceDetectorPreset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FaceDetectorPreset.java new file mode 100644 index 000000000000..31ec807ae70e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FaceDetectorPreset.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Describes all the settings to be used when analyzing a video in order to detect all the faces present. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.FaceDetectorPreset") +@JsonFlatten +@Fluent +public class FaceDetectorPreset extends Preset { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FaceDetectorPreset.class); + + /* + * Specifies the maximum resolution at which your video is analyzed. The + * default behavior is "SourceResolution," which will keep the input video + * at its original resolution when analyzed. Using "StandardDefinition" + * will resize input videos to standard definition while preserving the + * appropriate aspect ratio. It will only resize if the video is of higher + * resolution. For example, a 1920x1080 input would be scaled to 640x360 + * before processing. Switching to "StandardDefinition" will reduce the + * time it takes to process high resolution video. It may also reduce the + * cost of using this component (see + * https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics + * for details). However, faces that end up being too small in the resized + * video may not be detected. + */ + @JsonProperty(value = "resolution") + private AnalysisResolution resolution; + + /* + * Dictionary containing key value pairs for parameters not exposed in the + * preset itself + */ + @JsonProperty(value = "experimentalOptions") + private Map experimentalOptions; + + /** + * Get the resolution property: Specifies the maximum resolution at which your video is analyzed. The default + * behavior is "SourceResolution," which will keep the input video at its original resolution when analyzed. Using + * "StandardDefinition" will resize input videos to standard definition while preserving the appropriate aspect + * ratio. It will only resize if the video is of higher resolution. For example, a 1920x1080 input would be scaled + * to 640x360 before processing. Switching to "StandardDefinition" will reduce the time it takes to process high + * resolution video. It may also reduce the cost of using this component (see + * https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics for details). However, faces that end + * up being too small in the resized video may not be detected. + * + * @return the resolution value. + */ + public AnalysisResolution resolution() { + return this.resolution; + } + + /** + * Set the resolution property: Specifies the maximum resolution at which your video is analyzed. The default + * behavior is "SourceResolution," which will keep the input video at its original resolution when analyzed. Using + * "StandardDefinition" will resize input videos to standard definition while preserving the appropriate aspect + * ratio. It will only resize if the video is of higher resolution. For example, a 1920x1080 input would be scaled + * to 640x360 before processing. Switching to "StandardDefinition" will reduce the time it takes to process high + * resolution video. It may also reduce the cost of using this component (see + * https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics for details). However, faces that end + * up being too small in the resized video may not be detected. + * + * @param resolution the resolution value to set. + * @return the FaceDetectorPreset object itself. + */ + public FaceDetectorPreset withResolution(AnalysisResolution resolution) { + this.resolution = resolution; + return this; + } + + /** + * Get the experimentalOptions property: Dictionary containing key value pairs for parameters not exposed in the + * preset itself. + * + * @return the experimentalOptions value. + */ + public Map experimentalOptions() { + return this.experimentalOptions; + } + + /** + * Set the experimentalOptions property: Dictionary containing key value pairs for parameters not exposed in the + * preset itself. + * + * @param experimentalOptions the experimentalOptions value to set. + * @return the FaceDetectorPreset object itself. + */ + public FaceDetectorPreset withExperimentalOptions(Map experimentalOptions) { + this.experimentalOptions = experimentalOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackPropertyCompareOperation.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackPropertyCompareOperation.java new file mode 100644 index 000000000000..97450f0253dc --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackPropertyCompareOperation.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FilterTrackPropertyCompareOperation. */ +public final class FilterTrackPropertyCompareOperation + extends ExpandableStringEnum { + /** Static value Equal for FilterTrackPropertyCompareOperation. */ + public static final FilterTrackPropertyCompareOperation EQUAL = fromString("Equal"); + + /** Static value NotEqual for FilterTrackPropertyCompareOperation. */ + public static final FilterTrackPropertyCompareOperation NOT_EQUAL = fromString("NotEqual"); + + /** + * Creates or finds a FilterTrackPropertyCompareOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding FilterTrackPropertyCompareOperation. + */ + @JsonCreator + public static FilterTrackPropertyCompareOperation fromString(String name) { + return fromString(name, FilterTrackPropertyCompareOperation.class); + } + + /** @return known FilterTrackPropertyCompareOperation values. */ + public static Collection values() { + return values(FilterTrackPropertyCompareOperation.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackPropertyCondition.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackPropertyCondition.java new file mode 100644 index 000000000000..9a06de2ab974 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackPropertyCondition.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The class to specify one track property condition. */ +@Fluent +public final class FilterTrackPropertyCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FilterTrackPropertyCondition.class); + + /* + * The track property type. + */ + @JsonProperty(value = "property", required = true) + private FilterTrackPropertyType property; + + /* + * The track property value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * The track property condition operation. + */ + @JsonProperty(value = "operation", required = true) + private FilterTrackPropertyCompareOperation operation; + + /** + * Get the property property: The track property type. + * + * @return the property value. + */ + public FilterTrackPropertyType property() { + return this.property; + } + + /** + * Set the property property: The track property type. + * + * @param property the property value to set. + * @return the FilterTrackPropertyCondition object itself. + */ + public FilterTrackPropertyCondition withProperty(FilterTrackPropertyType property) { + this.property = property; + return this; + } + + /** + * Get the value property: The track property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The track property 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 operation property: The track property condition operation. + * + * @return the operation value. + */ + public FilterTrackPropertyCompareOperation operation() { + return this.operation; + } + + /** + * Set the operation property: The track property condition operation. + * + * @param operation the operation value to set. + * @return the FilterTrackPropertyCondition object itself. + */ + public FilterTrackPropertyCondition withOperation(FilterTrackPropertyCompareOperation operation) { + this.operation = operation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (property() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property property in model FilterTrackPropertyCondition")); + } + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model FilterTrackPropertyCondition")); + } + if (operation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operation in model FilterTrackPropertyCondition")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackPropertyType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackPropertyType.java new file mode 100644 index 000000000000..a2d488ca9d40 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackPropertyType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FilterTrackPropertyType. */ +public final class FilterTrackPropertyType extends ExpandableStringEnum { + /** Static value Unknown for FilterTrackPropertyType. */ + public static final FilterTrackPropertyType UNKNOWN = fromString("Unknown"); + + /** Static value Type for FilterTrackPropertyType. */ + public static final FilterTrackPropertyType TYPE = fromString("Type"); + + /** Static value Name for FilterTrackPropertyType. */ + public static final FilterTrackPropertyType NAME = fromString("Name"); + + /** Static value Language for FilterTrackPropertyType. */ + public static final FilterTrackPropertyType LANGUAGE = fromString("Language"); + + /** Static value FourCC for FilterTrackPropertyType. */ + public static final FilterTrackPropertyType FOUR_CC = fromString("FourCC"); + + /** Static value Bitrate for FilterTrackPropertyType. */ + public static final FilterTrackPropertyType BITRATE = fromString("Bitrate"); + + /** + * Creates or finds a FilterTrackPropertyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FilterTrackPropertyType. + */ + @JsonCreator + public static FilterTrackPropertyType fromString(String name) { + return fromString(name, FilterTrackPropertyType.class); + } + + /** @return known FilterTrackPropertyType values. */ + public static Collection values() { + return values(FilterTrackPropertyType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackSelection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackSelection.java new file mode 100644 index 000000000000..d8f90db2da2f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FilterTrackSelection.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Representing a list of FilterTrackPropertyConditions to select a track. The filters are combined using a logical AND + * operation. + */ +@Fluent +public final class FilterTrackSelection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FilterTrackSelection.class); + + /* + * The track selections. + */ + @JsonProperty(value = "trackSelections", required = true) + private List trackSelections; + + /** + * Get the trackSelections property: The track selections. + * + * @return the trackSelections value. + */ + public List trackSelections() { + return this.trackSelections; + } + + /** + * Set the trackSelections property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (trackSelections() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property trackSelections in model FilterTrackSelection")); + } else { + trackSelections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Filters.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Filters.java new file mode 100644 index 000000000000..065b1f4a5a6d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Filters.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes all the filtering operations, such as de-interlacing, rotation etc. that are to be applied to the input + * media before encoding. + */ +@Fluent +public final class Filters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Filters.class); + + /* + * 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 + */ + @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 deinterlace property: The de-interlacing settings. + * + * @return the deinterlace value. + */ + public Deinterlace deinterlace() { + return this.deinterlace; + } + + /** + * Set the deinterlace property: 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 property: The rotation, if any, to be applied to the input video, before it is encoded. Default + * is Auto. + * + * @return the rotation value. + */ + public Rotation rotation() { + return this.rotation; + } + + /** + * Set the rotation property: The rotation, if any, to be applied to the input video, before it is encoded. Default + * is Auto. + * + * @param rotation the rotation value to set. + * @return the Filters object itself. + */ + public Filters withRotation(Rotation rotation) { + this.rotation = rotation; + return this; + } + + /** + * Get the crop property: 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 crop property: 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 overlays property: 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 overlays property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deinterlace() != null) { + deinterlace().validate(); + } + if (crop() != null) { + crop().validate(); + } + if (overlays() != null) { + overlays().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FirstQuality.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FirstQuality.java new file mode 100644 index 000000000000..8a16843ad86e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/FirstQuality.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Filter First Quality. */ +@Fluent +public final class FirstQuality { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirstQuality.class); + + /* + * The first quality bitrate. + */ + @JsonProperty(value = "bitrate", required = true) + private int bitrate; + + /** + * Get the bitrate property: The first quality bitrate. + * + * @return the bitrate value. + */ + public int bitrate() { + return this.bitrate; + } + + /** + * Set the bitrate property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Format.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Format.java new file mode 100644 index 000000000000..63fa35ff88d0 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Format.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for output. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = Format.class) +@JsonTypeName("Format") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.ImageFormat", value = ImageFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgFormat", value = JpgFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngFormat", value = PngFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.MultiBitrateFormat", value = MultiBitrateFormat.class) +}) +@JsonFlatten +@Fluent +public class Format { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Format.class); + + /* + * The pattern of the file names for the generated output files. The + * following macros are supported in the file name: {Basename} - An + * expansion macro that will use the name of the input video file. If the + * base name(the file suffix is not included) of the input video file is + * less than 32 characters long, the base name of input video files will be + * used. If the length of base name of the input video file exceeds 32 + * characters, the base name is truncated to the first 32 characters in + * total length. {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", required = true) + private String filenamePattern; + + /** + * Get the filenamePattern property: The pattern of the file names for the generated output files. The following + * macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video + * file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, + * the base name of input video files will be used. If the length of base name of the input video file exceeds 32 + * characters, the base name is truncated to the first 32 characters in total length. {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 filenamePattern property: The pattern of the file names for the generated output files. The following + * macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video + * file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, + * the base name of input video files will be used. If the length of base name of the input video file exceeds 32 + * characters, the base name is truncated to the first 32 characters in total length. {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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filenamePattern() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property filenamePattern in model Format")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264Complexity.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264Complexity.java new file mode 100644 index 000000000000..8603c6215da2 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264Complexity.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for H264Complexity. */ +public final class H264Complexity extends ExpandableStringEnum { + /** Static value Speed for H264Complexity. */ + public static final H264Complexity SPEED = fromString("Speed"); + + /** Static value Balanced for H264Complexity. */ + public static final H264Complexity BALANCED = fromString("Balanced"); + + /** Static value Quality for H264Complexity. */ + public static final H264Complexity QUALITY = fromString("Quality"); + + /** + * Creates or finds a H264Complexity from its string representation. + * + * @param name a name to look for. + * @return the corresponding H264Complexity. + */ + @JsonCreator + public static H264Complexity fromString(String name) { + return fromString(name, H264Complexity.class); + } + + /** @return known H264Complexity values. */ + public static Collection values() { + return values(H264Complexity.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264Layer.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264Layer.java new file mode 100644 index 000000000000..6b0553f46192 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264Layer.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; + +/** + * 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") +@JsonFlatten +@Fluent +public class H264Layer extends VideoLayer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(H264Layer.class); + + /* + * We currently support Baseline, Main, High, High422, High444. Default is + * Auto. + */ + @JsonProperty(value = "profile") + private H264VideoProfile profile; + + /* + * We currently support Level up to 6.2. 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 Duration 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. + */ + @JsonProperty(value = "entropyMode") + private EntropyMode entropyMode; + + /** + * Get the profile property: We currently support Baseline, Main, High, High422, High444. Default is Auto. + * + * @return the profile value. + */ + public H264VideoProfile profile() { + return this.profile; + } + + /** + * Set the profile property: We currently support Baseline, Main, High, High422, High444. Default is Auto. + * + * @param profile the profile value to set. + * @return the H264Layer object itself. + */ + public H264Layer withProfile(H264VideoProfile profile) { + this.profile = profile; + return this; + } + + /** + * Get the level property: We currently support Level up to 6.2. 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 the level property: We currently support Level up to 6.2. 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 bufferWindow property: 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 Duration bufferWindow() { + return this.bufferWindow; + } + + /** + * Set the bufferWindow property: 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(Duration bufferWindow) { + this.bufferWindow = bufferWindow; + return this; + } + + /** + * Get the referenceFrames property: 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 referenceFrames property: 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 entropyMode property: 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. + * + * @return the entropyMode value. + */ + public EntropyMode entropyMode() { + return this.entropyMode; + } + + /** + * Set the entropyMode property: 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. + * + * @param entropyMode the entropyMode value to set. + * @return the H264Layer object itself. + */ + public H264Layer withEntropyMode(EntropyMode entropyMode) { + this.entropyMode = entropyMode; + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Layer withBitrate(int bitrate) { + super.withBitrate(bitrate); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Layer withMaxBitrate(Integer maxBitrate) { + super.withMaxBitrate(maxBitrate); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Layer withBFrames(Integer bFrames) { + super.withBFrames(bFrames); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Layer withFrameRate(String frameRate) { + super.withFrameRate(frameRate); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Layer withSlices(Integer slices) { + super.withSlices(slices); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Layer withAdaptiveBFrame(Boolean adaptiveBFrame) { + super.withAdaptiveBFrame(adaptiveBFrame); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Layer withWidth(String width) { + super.withWidth(width); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Layer withHeight(String height) { + super.withHeight(height); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Layer withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264Video.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264Video.java new file mode 100644 index 000000000000..391d62ffb8bc --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264Video.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.util.List; + +/** 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") +@JsonFlatten +@Fluent +public class H264Video extends Video { + @JsonIgnore private final ClientLogger logger = new ClientLogger(H264Video.class); + + /* + * 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. + */ + @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 the sceneChangeDetection property: 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 the sceneChangeDetection property: 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 the complexity property: Tells the encoder how to choose its encoding settings. The default value is + * Balanced. + * + * @return the complexity value. + */ + public H264Complexity complexity() { + return this.complexity; + } + + /** + * Set the complexity property: Tells the encoder how to choose its encoding settings. The default value is + * Balanced. + * + * @param complexity the complexity value to set. + * @return the H264Video object itself. + */ + public H264Video withComplexity(H264Complexity complexity) { + this.complexity = complexity; + return this; + } + + /** + * Get the layers property: 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 layers property: 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; + } + + /** {@inheritDoc} */ + @Override + public H264Video withKeyFrameInterval(Duration keyFrameInterval) { + super.withKeyFrameInterval(keyFrameInterval); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Video withStretchMode(StretchMode stretchMode) { + super.withStretchMode(stretchMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Video withSyncMode(VideoSyncMode syncMode) { + super.withSyncMode(syncMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public H264Video withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (layers() != null) { + layers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264VideoProfile.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264VideoProfile.java new file mode 100644 index 000000000000..c15ba9509831 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/H264VideoProfile.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for H264VideoProfile. */ +public final class H264VideoProfile extends ExpandableStringEnum { + /** Static value Auto for H264VideoProfile. */ + public static final H264VideoProfile AUTO = fromString("Auto"); + + /** Static value Baseline for H264VideoProfile. */ + public static final H264VideoProfile BASELINE = fromString("Baseline"); + + /** Static value Main for H264VideoProfile. */ + public static final H264VideoProfile MAIN = fromString("Main"); + + /** Static value High for H264VideoProfile. */ + public static final H264VideoProfile HIGH = fromString("High"); + + /** Static value High422 for H264VideoProfile. */ + public static final H264VideoProfile HIGH422 = fromString("High422"); + + /** Static value High444 for H264VideoProfile. */ + public static final H264VideoProfile HIGH444 = fromString("High444"); + + /** + * Creates or finds a H264VideoProfile from its string representation. + * + * @param name a name to look for. + * @return the corresponding H264VideoProfile. + */ + @JsonCreator + public static H264VideoProfile fromString(String name) { + return fromString(name, H264VideoProfile.class); + } + + /** @return known H264VideoProfile values. */ + public static Collection values() { + return values(H264VideoProfile.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Hls.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Hls.java new file mode 100644 index 000000000000..c3ba36217903 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Hls.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HTTP Live Streaming (HLS) packing setting for the live output. */ +@Fluent +public final class Hls { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Hls.class); + + /* + * The number of fragments in an HTTP Live Streaming (HLS) TS segment in + * the output of the live event. This value does not affect the packing + * ratio for HLS CMAF output. + */ + @JsonProperty(value = "fragmentsPerTsSegment") + private Integer fragmentsPerTsSegment; + + /** + * Get the fragmentsPerTsSegment property: The number of fragments in an HTTP Live Streaming (HLS) TS segment in the + * output of the live event. This value does not affect the packing ratio for HLS CMAF output. + * + * @return the fragmentsPerTsSegment value. + */ + public Integer fragmentsPerTsSegment() { + return this.fragmentsPerTsSegment; + } + + /** + * Set the fragmentsPerTsSegment property: The number of fragments in an HTTP Live Streaming (HLS) TS segment in the + * output of the live event. This value does not affect the packing ratio for HLS CMAF output. + * + * @param fragmentsPerTsSegment the fragmentsPerTsSegment value to set. + * @return the Hls object itself. + */ + public Hls withFragmentsPerTsSegment(Integer fragmentsPerTsSegment) { + this.fragmentsPerTsSegment = fragmentsPerTsSegment; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Image.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Image.java new file mode 100644 index 000000000000..92d5a0be4429 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Image.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; + +/** Describes the basic properties for generating thumbnails from the input video. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = Image.class) +@JsonTypeName("#Microsoft.Media.Image") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgImage", value = JpgImage.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngImage", value = PngImage.class) +}) +@JsonFlatten +@Fluent +public class Image extends Video { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Image.class); + + /* + * The position in the input video from where to start generating + * thumbnails. The value can be in ISO 8601 format (For example, PT05S to + * start at 5 seconds), or a frame count (For example, 10 to start at the + * 10th frame), or a relative value to stream duration (For example, 10% to + * start at 10% of stream duration). Also supports a macro {Best}, which + * tells the encoder to select the best thumbnail from the first few + * seconds of the video and will only produce one thumbnail, no matter what + * other settings are for Step and Range. The default value is macro + * {Best}. + */ + @JsonProperty(value = "start", required = true) + private String start; + + /* + * The intervals at which thumbnails are generated. The value can be in ISO + * 8601 format (For example, PT05S for one image every 5 seconds), or a + * frame count (For example, 30 for one image every 30 frames), or a + * relative value to stream duration (For example, 10% for one image every + * 10% of stream duration). Note: Step value will affect the first + * generated thumbnail, which may not be exactly the one specified at + * transform preset start time. This is due to the encoder, which tries to + * select the best thumbnail between start time and Step position from + * start time as the first output. As the default value is 10%, it means if + * stream has long duration, the first generated thumbnail might be far + * away from the one specified at start time. Try to select reasonable + * value for Step if the first thumbnail is expected close to start time, + * or set Range value at 1 if only one thumbnail is needed at start time. + */ + @JsonProperty(value = "step") + private String step; + + /* + * The position relative to transform preset start time in the input video + * at which to stop generating thumbnails. The value can be in ISO 8601 + * format (For example, PT5M30S to stop at 5 minutes and 30 seconds from + * start time), or a frame count (For example, 300 to stop at the 300th + * frame from the frame at start time. If this value is 1, it means only + * producing one thumbnail at start time), or a relative value to the + * stream duration (For example, 50% to stop at half of stream duration + * from start time). The default value is 100%, which means to stop at the + * end of the stream. + */ + @JsonProperty(value = "range") + private String range; + + /** + * Get the start property: The position in the input video from where to start generating thumbnails. The value can + * be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at + * the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). + * Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of + * the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default + * value is macro {Best}. + * + * @return the start value. + */ + public String start() { + return this.start; + } + + /** + * Set the start property: The position in the input video from where to start generating thumbnails. The value can + * be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at + * the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). + * Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of + * the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default + * value is macro {Best}. + * + * @param start the start value to set. + * @return the Image object itself. + */ + public Image withStart(String start) { + this.start = start; + return this; + } + + /** + * Get the step property: The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For + * example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), + * or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step + * value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset + * start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step + * position from start time as the first output. As the default value is 10%, it means if stream has long duration, + * the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable + * value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one + * thumbnail is needed at start time. + * + * @return the step value. + */ + public String step() { + return this.step; + } + + /** + * Set the step property: The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For + * example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), + * or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step + * value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset + * start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step + * position from start time as the first output. As the default value is 10%, it means if stream has long duration, + * the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable + * value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one + * thumbnail is needed at start time. + * + * @param step the step value to set. + * @return the Image object itself. + */ + public Image withStep(String step) { + this.step = step; + return this; + } + + /** + * Get the range property: The position relative to transform preset start time in the input video at which to stop + * generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 + * seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start + * time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream + * duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which + * means to stop at the end of the stream. + * + * @return the range value. + */ + public String range() { + return this.range; + } + + /** + * Set the range property: The position relative to transform preset start time in the input video at which to stop + * generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 + * seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start + * time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream + * duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which + * means to stop at the end of the stream. + * + * @param range the range value to set. + * @return the Image object itself. + */ + public Image withRange(String range) { + this.range = range; + return this; + } + + /** {@inheritDoc} */ + @Override + public Image withKeyFrameInterval(Duration keyFrameInterval) { + super.withKeyFrameInterval(keyFrameInterval); + return this; + } + + /** {@inheritDoc} */ + @Override + public Image withStretchMode(StretchMode stretchMode) { + super.withStretchMode(stretchMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public Image withSyncMode(VideoSyncMode syncMode) { + super.withSyncMode(syncMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public Image withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (start() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property start in model Image")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ImageFormat.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ImageFormat.java new file mode 100644 index 000000000000..2727be117098 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ImageFormat.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes the properties for an output image file. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.ImageFormat") +@JsonFlatten +@Immutable +public class ImageFormat extends Format { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageFormat.class); + + /** {@inheritDoc} */ + @Override + public ImageFormat withFilenamePattern(String filenamePattern) { + super.withFilenamePattern(filenamePattern); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/InsightsType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/InsightsType.java new file mode 100644 index 000000000000..18f33bdb1c4c --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/InsightsType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InsightsType. */ +public final class InsightsType extends ExpandableStringEnum { + /** Static value AudioInsightsOnly for InsightsType. */ + public static final InsightsType AUDIO_INSIGHTS_ONLY = fromString("AudioInsightsOnly"); + + /** Static value VideoInsightsOnly for InsightsType. */ + public static final InsightsType VIDEO_INSIGHTS_ONLY = fromString("VideoInsightsOnly"); + + /** Static value AllInsights for InsightsType. */ + public static final InsightsType ALL_INSIGHTS = fromString("AllInsights"); + + /** + * Creates or finds a InsightsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InsightsType. + */ + @JsonCreator + public static InsightsType fromString(String name) { + return fromString(name, InsightsType.class); + } + + /** @return known InsightsType values. */ + public static Collection values() { + return values(InsightsType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/IpAccessControl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/IpAccessControl.java new file mode 100644 index 000000000000..3f5d11dc961a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/IpAccessControl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The IP access control. */ +@Fluent +public final class IpAccessControl { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAccessControl.class); + + /* + * The IP allow list. + */ + @JsonProperty(value = "allow") + private List allow; + + /** + * Get the allow property: The IP allow list. + * + * @return the allow value. + */ + public List allow() { + return this.allow; + } + + /** + * Set the allow property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (allow() != null) { + allow().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/IpRange.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/IpRange.java new file mode 100644 index 000000000000..1fe733267389 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/IpRange.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IP address range in the CIDR scheme. */ +@Fluent +public final class IpRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpRange.class); + + /* + * 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 name property: The friendly name for the IP address range. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 address property: The IP address. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: 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 subnetPrefixLength property: The subnet mask prefix length (see CIDR notation). + * + * @return the subnetPrefixLength value. + */ + public Integer subnetPrefixLength() { + return this.subnetPrefixLength; + } + + /** + * Set the subnetPrefixLength property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Job.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Job.java new file mode 100644 index 000000000000..f74640052277 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Job.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.JobInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Job. */ +public interface Job { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the created property: The UTC date and time when the customer has created the Job, in 'YYYY-MM-DDThh:mm:ssZ' + * format. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the state property: The current state of the job. + * + * @return the state value. + */ + JobState state(); + + /** + * Gets the description property: Optional customer supplied description of the Job. + * + * @return the description value. + */ + String description(); + + /** + * Gets the input property: The inputs for the Job. + * + * @return the input value. + */ + JobInput input(); + + /** + * Gets the lastModified property: The UTC date and time when the customer has last updated the Job, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the outputs property: The outputs for the Job. + * + * @return the outputs value. + */ + List outputs(); + + /** + * Gets the priority property: Priority with which the job should be processed. Higher priority jobs are processed + * before lower priority jobs. If not set, the default is normal. + * + * @return the priority value. + */ + Priority priority(); + + /** + * Gets the correlationData property: Customer provided key, value pairs that will be returned in Job and JobOutput + * state events. + * + * @return the correlationData value. + */ + Map correlationData(); + + /** + * Gets the startTime property: The UTC date and time at which this Job began processing. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The UTC date and time at which this Job finished processing. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.JobInner object. + * + * @return the inner object. + */ + JobInner innerModel(); + + /** The entirety of the Job definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Job definition stages. */ + interface DefinitionStages { + /** The first stage of the Job definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Job definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName, transformName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param transformName The Transform name. + * @return the next definition stage. + */ + WithCreate withExistingTransform(String resourceGroupName, String accountName, String transformName); + } + /** + * The stage of the Job definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDescription, + DefinitionStages.WithInput, + DefinitionStages.WithOutputs, + DefinitionStages.WithPriority, + DefinitionStages.WithCorrelationData { + /** + * Executes the create request. + * + * @return the created resource. + */ + Job create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Job create(Context context); + } + /** The stage of the Job definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Optional customer supplied description of the Job.. + * + * @param description Optional customer supplied description of the Job. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the Job definition allowing to specify input. */ + interface WithInput { + /** + * Specifies the input property: The inputs for the Job.. + * + * @param input The inputs for the Job. + * @return the next definition stage. + */ + WithCreate withInput(JobInput input); + } + /** The stage of the Job definition allowing to specify outputs. */ + interface WithOutputs { + /** + * Specifies the outputs property: The outputs for the Job.. + * + * @param outputs The outputs for the Job. + * @return the next definition stage. + */ + WithCreate withOutputs(List outputs); + } + /** The stage of the Job definition allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority with which the job should be processed. Higher priority jobs + * are processed before lower priority jobs. If not set, the default is normal.. + * + * @param priority Priority with which the job should be processed. Higher priority jobs are processed + * before lower priority jobs. If not set, the default is normal. + * @return the next definition stage. + */ + WithCreate withPriority(Priority priority); + } + /** The stage of the Job definition allowing to specify correlationData. */ + interface WithCorrelationData { + /** + * Specifies the correlationData property: Customer provided key, value pairs that will be returned in Job + * and JobOutput state events.. + * + * @param correlationData Customer provided key, value pairs that will be returned in Job and JobOutput + * state events. + * @return the next definition stage. + */ + WithCreate withCorrelationData(Map correlationData); + } + } + /** + * Begins update for the Job resource. + * + * @return the stage of resource update. + */ + Job.Update update(); + + /** The template for Job update. */ + interface Update + extends UpdateStages.WithDescription, + UpdateStages.WithInput, + UpdateStages.WithOutputs, + UpdateStages.WithPriority, + UpdateStages.WithCorrelationData { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Job apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Job apply(Context context); + } + /** The Job update stages. */ + interface UpdateStages { + /** The stage of the Job update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Optional customer supplied description of the Job.. + * + * @param description Optional customer supplied description of the Job. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Job update allowing to specify input. */ + interface WithInput { + /** + * Specifies the input property: The inputs for the Job.. + * + * @param input The inputs for the Job. + * @return the next definition stage. + */ + Update withInput(JobInput input); + } + /** The stage of the Job update allowing to specify outputs. */ + interface WithOutputs { + /** + * Specifies the outputs property: The outputs for the Job.. + * + * @param outputs The outputs for the Job. + * @return the next definition stage. + */ + Update withOutputs(List outputs); + } + /** The stage of the Job update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority with which the job should be processed. Higher priority jobs + * are processed before lower priority jobs. If not set, the default is normal.. + * + * @param priority Priority with which the job should be processed. Higher priority jobs are processed + * before lower priority jobs. If not set, the default is normal. + * @return the next definition stage. + */ + Update withPriority(Priority priority); + } + /** The stage of the Job update allowing to specify correlationData. */ + interface WithCorrelationData { + /** + * Specifies the correlationData property: Customer provided key, value pairs that will be returned in Job + * and JobOutput state events.. + * + * @param correlationData Customer provided key, value pairs that will be returned in Job and JobOutput + * state events. + * @return the next definition stage. + */ + Update withCorrelationData(Map correlationData); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Job refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Job refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobCollection.java new file mode 100644 index 000000000000..c98658d6a07d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.JobInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of Job items. */ +@Fluent +public final class JobCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobCollection.class); + + /* + * A collection of Job items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of Job items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of Job items. + * + * @param value the value value to set. + * @return the JobCollection object itself. + */ + public JobCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the JobCollection object itself. + */ + public JobCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobError.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobError.java new file mode 100644 index 000000000000..bef6e1004411 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobError.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details of JobOutput errors. */ +@Immutable +public final class JobError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobError.class); + + /* + * Error code describing the error. + */ + @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. + */ + @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. + */ + @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 the code property: Error code describing the error. + * + * @return the code value. + */ + public JobErrorCode code() { + return this.code; + } + + /** + * Get the message property: A human-readable language-dependent representation of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the category property: Helps with categorization of errors. + * + * @return the category value. + */ + public JobErrorCategory category() { + return this.category; + } + + /** + * Get the retry property: Indicates that it may be possible to retry the Job. If retry is unsuccessful, please + * contact Azure support via Azure Portal. + * + * @return the retry value. + */ + public JobRetry retry() { + return this.retry; + } + + /** + * Get the details property: An array of details about specific errors that led to this reported error. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobErrorCategory.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobErrorCategory.java new file mode 100644 index 000000000000..2f4e549d981c --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobErrorCategory.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JobErrorCategory. */ +public final class JobErrorCategory extends ExpandableStringEnum { + /** Static value Service for JobErrorCategory. */ + public static final JobErrorCategory SERVICE = fromString("Service"); + + /** Static value Download for JobErrorCategory. */ + public static final JobErrorCategory DOWNLOAD = fromString("Download"); + + /** Static value Upload for JobErrorCategory. */ + public static final JobErrorCategory UPLOAD = fromString("Upload"); + + /** Static value Configuration for JobErrorCategory. */ + public static final JobErrorCategory CONFIGURATION = fromString("Configuration"); + + /** Static value Content for JobErrorCategory. */ + public static final JobErrorCategory CONTENT = fromString("Content"); + + /** + * Creates or finds a JobErrorCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobErrorCategory. + */ + @JsonCreator + public static JobErrorCategory fromString(String name) { + return fromString(name, JobErrorCategory.class); + } + + /** @return known JobErrorCategory values. */ + public static Collection values() { + return values(JobErrorCategory.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobErrorCode.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobErrorCode.java new file mode 100644 index 000000000000..636eb42c96dd --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobErrorCode.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JobErrorCode. */ +public final class JobErrorCode extends ExpandableStringEnum { + /** Static value ServiceError for JobErrorCode. */ + public static final JobErrorCode SERVICE_ERROR = fromString("ServiceError"); + + /** Static value ServiceTransientError for JobErrorCode. */ + public static final JobErrorCode SERVICE_TRANSIENT_ERROR = fromString("ServiceTransientError"); + + /** Static value DownloadNotAccessible for JobErrorCode. */ + public static final JobErrorCode DOWNLOAD_NOT_ACCESSIBLE = fromString("DownloadNotAccessible"); + + /** Static value DownloadTransientError for JobErrorCode. */ + public static final JobErrorCode DOWNLOAD_TRANSIENT_ERROR = fromString("DownloadTransientError"); + + /** Static value UploadNotAccessible for JobErrorCode. */ + public static final JobErrorCode UPLOAD_NOT_ACCESSIBLE = fromString("UploadNotAccessible"); + + /** Static value UploadTransientError for JobErrorCode. */ + public static final JobErrorCode UPLOAD_TRANSIENT_ERROR = fromString("UploadTransientError"); + + /** Static value ConfigurationUnsupported for JobErrorCode. */ + public static final JobErrorCode CONFIGURATION_UNSUPPORTED = fromString("ConfigurationUnsupported"); + + /** Static value ContentMalformed for JobErrorCode. */ + public static final JobErrorCode CONTENT_MALFORMED = fromString("ContentMalformed"); + + /** Static value ContentUnsupported for JobErrorCode. */ + public static final JobErrorCode CONTENT_UNSUPPORTED = fromString("ContentUnsupported"); + + /** + * Creates or finds a JobErrorCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobErrorCode. + */ + @JsonCreator + public static JobErrorCode fromString(String name) { + return fromString(name, JobErrorCode.class); + } + + /** @return known JobErrorCode values. */ + public static Collection values() { + return values(JobErrorCode.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobErrorDetail.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobErrorDetail.java new file mode 100644 index 000000000000..dd00a545fec8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobErrorDetail.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of JobOutput errors. */ +@Immutable +public final class JobErrorDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobErrorDetail.class); + + /* + * 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 the code property: Code describing the error detail. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: A human-readable representation of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInput.java new file mode 100644 index 000000000000..eb332af21ff8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInput.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Base class for inputs to a Job. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = JobInput.class) +@JsonTypeName("JobInput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputClip", value = JobInputClip.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputs", value = JobInputs.class) +}) +@JsonFlatten +@Immutable +public class JobInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobInput.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputAsset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputAsset.java new file mode 100644 index 000000000000..d5b60053fac6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputAsset.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Represents an Asset for input into a Job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.JobInputAsset") +@JsonFlatten +@Fluent +public class JobInputAsset extends JobInputClip { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobInputAsset.class); + + /* + * The name of the input Asset. + */ + @JsonProperty(value = "assetName", required = true) + private String assetName; + + /** + * Get the assetName property: The name of the input Asset. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: 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; + } + + /** {@inheritDoc} */ + @Override + public JobInputAsset withFiles(List files) { + super.withFiles(files); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobInputAsset withStart(ClipTime start) { + super.withStart(start); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobInputAsset withEnd(ClipTime end) { + super.withEnd(end); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobInputAsset withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (assetName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property assetName in model JobInputAsset")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputClip.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputClip.java new file mode 100644 index 000000000000..2c3e61477cb3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputClip.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Represents input files for a Job. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = JobInputClip.class) +@JsonTypeName("#Microsoft.Media.JobInputClip") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputAsset", value = JobInputAsset.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.JobInputHttp", value = JobInputHttp.class) +}) +@JsonFlatten +@Fluent +public class JobInputClip extends JobInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobInputClip.class); + + /* + * List of files. Required for JobInputHttp. Maximum of 4000 characters + * each. + */ + @JsonProperty(value = "files") + private List files; + + /* + * Defines a point on the timeline of the input media at which processing + * will start. Defaults to the beginning of the input media. + */ + @JsonProperty(value = "start") + private ClipTime start; + + /* + * Defines a point on the timeline of the input media at which processing + * will end. Defaults to the end of the input media. + */ + @JsonProperty(value = "end") + private ClipTime end; + + /* + * 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 the files property: List of files. Required for JobInputHttp. Maximum of 4000 characters each. + * + * @return the files value. + */ + public List files() { + return this.files; + } + + /** + * Set the files property: List of files. Required for JobInputHttp. Maximum of 4000 characters each. + * + * @param files the files value to set. + * @return the JobInputClip object itself. + */ + public JobInputClip withFiles(List files) { + this.files = files; + return this; + } + + /** + * Get the start property: Defines a point on the timeline of the input media at which processing will start. + * Defaults to the beginning of the input media. + * + * @return the start value. + */ + public ClipTime start() { + return this.start; + } + + /** + * Set the start property: Defines a point on the timeline of the input media at which processing will start. + * Defaults to the beginning of the input media. + * + * @param start the start value to set. + * @return the JobInputClip object itself. + */ + public JobInputClip withStart(ClipTime start) { + this.start = start; + return this; + } + + /** + * Get the end property: Defines a point on the timeline of the input media at which processing will end. Defaults + * to the end of the input media. + * + * @return the end value. + */ + public ClipTime end() { + return this.end; + } + + /** + * Set the end property: Defines a point on the timeline of the input media at which processing will end. Defaults + * to the end of the input media. + * + * @param end the end value to set. + * @return the JobInputClip object itself. + */ + public JobInputClip withEnd(ClipTime end) { + this.end = end; + return this; + } + + /** + * Get the label property: 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 the label property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (start() != null) { + start().validate(); + } + if (end() != null) { + end().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputHttp.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputHttp.java new file mode 100644 index 000000000000..2c5353e3f7bd --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputHttp.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Represents HTTPS job input. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.JobInputHttp") +@JsonFlatten +@Fluent +public class JobInputHttp extends JobInputClip { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobInputHttp.class); + + /* + * 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. Maximum length of 4000 characters. + */ + @JsonProperty(value = "baseUri") + private String baseUri; + + /** + * Get the baseUri property: 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. Maximum length of 4000 + * characters. + * + * @return the baseUri value. + */ + public String baseUri() { + return this.baseUri; + } + + /** + * Set the baseUri property: 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. Maximum length of 4000 + * characters. + * + * @param baseUri the baseUri value to set. + * @return the JobInputHttp object itself. + */ + public JobInputHttp withBaseUri(String baseUri) { + this.baseUri = baseUri; + return this; + } + + /** {@inheritDoc} */ + @Override + public JobInputHttp withFiles(List files) { + super.withFiles(files); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobInputHttp withStart(ClipTime start) { + super.withStart(start); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobInputHttp withEnd(ClipTime end) { + super.withEnd(end); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobInputHttp withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputs.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputs.java new file mode 100644 index 000000000000..c1f095f8012d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobInputs.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Describes a list of inputs to a Job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.JobInputs") +@JsonFlatten +@Fluent +public class JobInputs extends JobInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobInputs.class); + + /* + * List of inputs to a Job. + */ + @JsonProperty(value = "inputs") + private List inputs; + + /** + * Get the inputs property: List of inputs to a Job. + * + * @return the inputs value. + */ + public List inputs() { + return this.inputs; + } + + /** + * Set the inputs property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (inputs() != null) { + inputs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobOutput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobOutput.java new file mode 100644 index 000000000000..9963bdf4de47 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobOutput.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Describes all the properties of a JobOutput. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = JobOutput.class) +@JsonTypeName("JobOutput") +@JsonSubTypes({@JsonSubTypes.Type(name = "#Microsoft.Media.JobOutputAsset", value = JobOutputAsset.class)}) +@JsonFlatten +@Fluent +public class JobOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobOutput.class); + + /* + * 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. + */ + @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 Integer 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; + + /* + * The UTC date and time at which this Job Output began processing. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The UTC date and time at which this Job Output finished processing. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /** + * Get the error property: 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 the state property: Describes the state of the JobOutput. + * + * @return the state value. + */ + public JobState state() { + return this.state; + } + + /** + * Get the progress property: 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 Integer progress() { + return this.progress; + } + + /** + * Get the label property: 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 the label property: 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; + } + + /** + * Get the startTime property: The UTC date and time at which this Job Output began processing. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The UTC date and time at which this Job Output finished processing. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobOutputAsset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobOutputAsset.java new file mode 100644 index 000000000000..a82c9b503f34 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobOutputAsset.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Fluent +public class JobOutputAsset extends JobOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobOutputAsset.class); + + /* + * The name of the output Asset. + */ + @JsonProperty(value = "assetName", required = true) + private String assetName; + + /** + * Get the assetName property: The name of the output Asset. + * + * @return the assetName value. + */ + public String assetName() { + return this.assetName; + } + + /** + * Set the assetName property: 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; + } + + /** {@inheritDoc} */ + @Override + public JobOutputAsset withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (assetName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property assetName in model JobOutputAsset")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobRetry.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobRetry.java new file mode 100644 index 000000000000..63610c1f4322 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobRetry.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JobRetry. */ +public final class JobRetry extends ExpandableStringEnum { + /** Static value DoNotRetry for JobRetry. */ + public static final JobRetry DO_NOT_RETRY = fromString("DoNotRetry"); + + /** Static value MayRetry for JobRetry. */ + public static final JobRetry MAY_RETRY = fromString("MayRetry"); + + /** + * Creates or finds a JobRetry from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobRetry. + */ + @JsonCreator + public static JobRetry fromString(String name) { + return fromString(name, JobRetry.class); + } + + /** @return known JobRetry values. */ + public static Collection values() { + return values(JobRetry.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobState.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobState.java new file mode 100644 index 000000000000..5d9245c542f5 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JobState.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JobState. */ +public final class JobState extends ExpandableStringEnum { + /** Static value Canceled for JobState. */ + public static final JobState CANCELED = fromString("Canceled"); + + /** Static value Canceling for JobState. */ + public static final JobState CANCELING = fromString("Canceling"); + + /** Static value Error for JobState. */ + public static final JobState ERROR = fromString("Error"); + + /** Static value Finished for JobState. */ + public static final JobState FINISHED = fromString("Finished"); + + /** Static value Processing for JobState. */ + public static final JobState PROCESSING = fromString("Processing"); + + /** Static value Queued for JobState. */ + public static final JobState QUEUED = fromString("Queued"); + + /** Static value Scheduled for JobState. */ + public static final JobState SCHEDULED = fromString("Scheduled"); + + /** + * Creates or finds a JobState from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobState. + */ + @JsonCreator + public static JobState fromString(String name) { + return fromString(name, JobState.class); + } + + /** @return known JobState values. */ + public static Collection values() { + return values(JobState.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Jobs.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Jobs.java new file mode 100644 index 000000000000..3bd5954043c3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Jobs.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Jobs. */ +public interface 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + PagedIterable list(String resourceGroupName, String accountName, String transformName); + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Job items. + */ + PagedIterable list( + String resourceGroupName, + String accountName, + String transformName, + String filter, + String orderby, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + Job get(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancelJob(String resourceGroupName, String accountName, String transformName, String jobName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response cancelJobWithResponse( + String resourceGroupName, String accountName, String transformName, String jobName, Context context); + + /** + * Gets a Job. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + Job getById(String id); + + /** + * Gets a Job. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Job. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Job. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Job. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Job resource. + * + * @param name resource name. + * @return the first stage of the new Job definition. + */ + Job.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgFormat.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgFormat.java new file mode 100644 index 000000000000..5322419b7203 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgFormat.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class JpgFormat extends Format { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JpgFormat.class); + + /** {@inheritDoc} */ + @Override + public JpgFormat withFilenamePattern(String filenamePattern) { + super.withFilenamePattern(filenamePattern); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgImage.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgImage.java new file mode 100644 index 000000000000..bf195417d9f8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgImage.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.util.List; + +/** 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") +@JsonFlatten +@Fluent +public class JpgImage extends Image { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JpgImage.class); + + /* + * A collection of output JPEG image layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /* + * Sets the number of columns used in thumbnail sprite image. The number + * of rows are automatically calculated and a VTT file is generated with + * the coordinate mappings for each thumbnail in the sprite. Note: this + * value should be a positive integer and a proper value is recommended so + * that the output image resolution will not go beyond JPEG maximum pixel + * resolution limit 65535x65535. + */ + @JsonProperty(value = "spriteColumn") + private Integer spriteColumn; + + /** + * Get the layers property: A collection of output JPEG image layers to be produced by the encoder. + * + * @return the layers value. + */ + public List layers() { + return this.layers; + } + + /** + * Set the layers property: 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; + } + + /** + * Get the spriteColumn property: Sets the number of columns used in thumbnail sprite image. The number of rows are + * automatically calculated and a VTT file is generated with the coordinate mappings for each thumbnail in the + * sprite. Note: this value should be a positive integer and a proper value is recommended so that the output image + * resolution will not go beyond JPEG maximum pixel resolution limit 65535x65535. + * + * @return the spriteColumn value. + */ + public Integer spriteColumn() { + return this.spriteColumn; + } + + /** + * Set the spriteColumn property: Sets the number of columns used in thumbnail sprite image. The number of rows are + * automatically calculated and a VTT file is generated with the coordinate mappings for each thumbnail in the + * sprite. Note: this value should be a positive integer and a proper value is recommended so that the output image + * resolution will not go beyond JPEG maximum pixel resolution limit 65535x65535. + * + * @param spriteColumn the spriteColumn value to set. + * @return the JpgImage object itself. + */ + public JpgImage withSpriteColumn(Integer spriteColumn) { + this.spriteColumn = spriteColumn; + return this; + } + + /** {@inheritDoc} */ + @Override + public JpgImage withStart(String start) { + super.withStart(start); + return this; + } + + /** {@inheritDoc} */ + @Override + public JpgImage withStep(String step) { + super.withStep(step); + return this; + } + + /** {@inheritDoc} */ + @Override + public JpgImage withRange(String range) { + super.withRange(range); + return this; + } + + /** {@inheritDoc} */ + @Override + public JpgImage withKeyFrameInterval(Duration keyFrameInterval) { + super.withKeyFrameInterval(keyFrameInterval); + return this; + } + + /** {@inheritDoc} */ + @Override + public JpgImage withStretchMode(StretchMode stretchMode) { + super.withStretchMode(stretchMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public JpgImage withSyncMode(VideoSyncMode syncMode) { + super.withSyncMode(syncMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public JpgImage withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (layers() != null) { + layers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgLayer.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgLayer.java new file mode 100644 index 000000000000..f5a1d7827c7e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgLayer.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Fluent +public class JpgLayer extends Layer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JpgLayer.class); + + /* + * 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 quality property: 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 quality property: 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; + } + + /** {@inheritDoc} */ + @Override + public JpgLayer withWidth(String width) { + super.withWidth(width); + return this; + } + + /** {@inheritDoc} */ + @Override + public JpgLayer withHeight(String height) { + super.withHeight(height); + return this; + } + + /** {@inheritDoc} */ + @Override + public JpgLayer withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/KeyVaultProperties.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/KeyVaultProperties.java new file mode 100644 index 000000000000..5df282e9a024 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/KeyVaultProperties.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The KeyVaultProperties model. */ +@Fluent +public final class KeyVaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultProperties.class); + + /* + * The URL of the Key Vault key used to encrypt the account. The key may + * either be versioned (for example https://vault/keys/mykey/version1) or + * reference a key without a version (for example + * https://vault/keys/mykey). + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * The current key used to encrypt the Media Services account, including + * the key version. + */ + @JsonProperty(value = "currentKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String currentKeyIdentifier; + + /** + * Get the keyIdentifier property: The URL of the Key Vault key used to encrypt the account. The key may either be + * versioned (for example https://vault/keys/mykey/version1) or reference a key without a version (for example + * https://vault/keys/mykey). + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: The URL of the Key Vault key used to encrypt the account. The key may either be + * versioned (for example https://vault/keys/mykey/version1) or reference a key without a version (for example + * https://vault/keys/mykey). + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the currentKeyIdentifier property: The current key used to encrypt the Media Services account, including the + * key version. + * + * @return the currentKeyIdentifier value. + */ + public String currentKeyIdentifier() { + return this.currentKeyIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Layer.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Layer.java new file mode 100644 index 000000000000..e5610bc29575 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Layer.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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", + defaultImpl = Layer.class) +@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) +}) +@JsonFlatten +@Fluent +public class Layer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Layer.class); + + /* + * 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 property: The width of the output video for this layer. The value can be absolute (in pixels) or + * relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + * + * @return the width value. + */ + public String width() { + return this.width; + } + + /** + * Set the width property: The width of the output video for this layer. The value can be absolute (in pixels) or + * relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. + * + * @param width the width value to set. + * @return the Layer object itself. + */ + public Layer withWidth(String width) { + this.width = width; + return this; + } + + /** + * Get the height property: The height of the output video for this layer. The value can be absolute (in pixels) or + * relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + * + * @return the height value. + */ + public String height() { + return this.height; + } + + /** + * Set the height property: The height of the output video for this layer. The value can be absolute (in pixels) or + * relative (in percentage). For example 50% means the output video has half as many pixels in height as the input. + * + * @param height the height value to set. + * @return the Layer object itself. + */ + public Layer withHeight(String height) { + this.height = height; + return this; + } + + /** + * Get the label property: The alphanumeric label for this layer, which can be used in multiplexing different video + * and audio layers, or in naming the output file. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: The alphanumeric label for this layer, which can be used in multiplexing different video + * and audio layers, or in naming the output file. + * + * @param label the label value to set. + * @return the Layer object itself. + */ + public Layer withLabel(String label) { + this.label = label; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListContainerSasInput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListContainerSasInput.java new file mode 100644 index 000000000000..719b1f8fdaa0 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListContainerSasInput.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The parameters to the list SAS request. */ +@Fluent +public final class ListContainerSasInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListContainerSasInput.class); + + /* + * The permissions to set on the SAS URL. + */ + @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 OffsetDateTime expiryTime; + + /** + * Get the permissions property: The permissions to set on the SAS URL. + * + * @return the permissions value. + */ + public AssetContainerPermission permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The permissions to set on the SAS URL. + * + * @param permissions the permissions value to set. + * @return the ListContainerSasInput object itself. + */ + public ListContainerSasInput withPermissions(AssetContainerPermission permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the expiryTime property: The SAS URL expiration time. This must be less than 24 hours from the current time. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: 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(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListContentKeysResponse.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListContentKeysResponse.java new file mode 100644 index 000000000000..0d26d78d40f9 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListContentKeysResponse.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.ListContentKeysResponseInner; +import java.util.List; + +/** An immutable client-side representation of ListContentKeysResponse. */ +public interface ListContentKeysResponse { + /** + * Gets the contentKeys property: ContentKeys used by current Streaming Locator. + * + * @return the contentKeys value. + */ + List contentKeys(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.ListContentKeysResponseInner object. + * + * @return the inner object. + */ + ListContentKeysResponseInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListEdgePoliciesInput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListEdgePoliciesInput.java new file mode 100644 index 000000000000..53cde7fb877b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListEdgePoliciesInput.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ListEdgePoliciesInput model. */ +@Fluent +public final class ListEdgePoliciesInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListEdgePoliciesInput.class); + + /* + * Unique identifier of the edge device. + */ + @JsonProperty(value = "deviceId") + private String deviceId; + + /** + * Get the deviceId property: Unique identifier of the edge device. + * + * @return the deviceId value. + */ + public String deviceId() { + return this.deviceId; + } + + /** + * Set the deviceId property: Unique identifier of the edge device. + * + * @param deviceId the deviceId value to set. + * @return the ListEdgePoliciesInput object itself. + */ + public ListEdgePoliciesInput withDeviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListPathsResponse.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListPathsResponse.java new file mode 100644 index 000000000000..e092e8ae61ac --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListPathsResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.ListPathsResponseInner; +import java.util.List; + +/** An immutable client-side representation of ListPathsResponse. */ +public interface ListPathsResponse { + /** + * Gets the streamingPaths property: Streaming Paths supported by current Streaming Locator. + * + * @return the streamingPaths value. + */ + List streamingPaths(); + + /** + * Gets the downloadPaths property: Download Paths supported by current Streaming Locator. + * + * @return the downloadPaths value. + */ + List downloadPaths(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.ListPathsResponseInner object. + * + * @return the inner object. + */ + ListPathsResponseInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListStreamingLocatorsResponse.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListStreamingLocatorsResponse.java new file mode 100644 index 000000000000..40d6902e15b3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ListStreamingLocatorsResponse.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.ListStreamingLocatorsResponseInner; +import java.util.List; + +/** An immutable client-side representation of ListStreamingLocatorsResponse. */ +public interface ListStreamingLocatorsResponse { + /** + * Gets the streamingLocators property: The list of Streaming Locators. + * + * @return the streamingLocators value. + */ + List streamingLocators(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.ListStreamingLocatorsResponseInner object. + * + * @return the inner object. + */ + ListStreamingLocatorsResponseInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvent.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvent.java new file mode 100644 index 000000000000..c59c18bdb811 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvent.java @@ -0,0 +1,552 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of LiveEvent. */ +public interface LiveEvent { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the description property: A description for the live event. + * + * @return the description value. + */ + String description(); + + /** + * Gets the input property: Live event input settings. It defines how the live event receives input from a + * contribution encoder. + * + * @return the input value. + */ + LiveEventInput input(); + + /** + * Gets the preview property: Live event preview settings. Preview allows live event producers to preview the live + * streaming content without creating any live output. + * + * @return the preview value. + */ + LiveEventPreview preview(); + + /** + * Gets the encoding property: Encoding settings for the live event. It configures whether a live encoder is used + * for the live event and settings for the live encoder if it is used. + * + * @return the encoding value. + */ + LiveEventEncoding encoding(); + + /** + * Gets the transcriptions property: Live transcription settings for the live event. See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature. + * + * @return the transcriptions value. + */ + List transcriptions(); + + /** + * Gets the provisioningState property: The provisioning state of the live event. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the resourceState property: The resource state of the live event. See + * https://go.microsoft.com/fwlink/?linkid=2139012 for more information. + * + * @return the resourceState value. + */ + LiveEventResourceState resourceState(); + + /** + * Gets the crossSiteAccessPolicies property: Live event cross site access policies. + * + * @return the crossSiteAccessPolicies value. + */ + CrossSiteAccessPolicies crossSiteAccessPolicies(); + + /** + * Gets the useStaticHostname property: Specifies whether a static hostname would be assigned to the live event + * preview and ingest endpoints. This value can only be updated if the live event is in Standby state. + * + * @return the useStaticHostname value. + */ + Boolean useStaticHostname(); + + /** + * Gets the hostnamePrefix property: When useStaticHostname is set to true, the hostnamePrefix specifies the first + * part of the hostname assigned to the live event preview and ingest endpoints. The final hostname would be a + * combination of this prefix, the media service account name and a short code for the Azure Media Services data + * center. + * + * @return the hostnamePrefix value. + */ + String hostnamePrefix(); + + /** + * Gets the streamOptions property: The options to use for the LiveEvent. This value is specified at creation time + * and cannot be updated. The valid values for the array entry values are 'Default' and 'LowLatency'. + * + * @return the streamOptions value. + */ + List streamOptions(); + + /** + * Gets the created property: The creation time for the live event. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the lastModified property: The last modified time of the live event. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner object. + * + * @return the inner object. + */ + LiveEventInner innerModel(); + + /** The entirety of the LiveEvent definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The LiveEvent definition stages. */ + interface DefinitionStages { + /** The first stage of the LiveEvent definition. */ + interface Blank extends WithLocation { + } + /** The stage of the LiveEvent definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the LiveEvent definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @return the next definition stage. + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + /** + * The stage of the LiveEvent definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithDescription, + DefinitionStages.WithInput, + DefinitionStages.WithPreview, + DefinitionStages.WithEncoding, + DefinitionStages.WithTranscriptions, + DefinitionStages.WithCrossSiteAccessPolicies, + DefinitionStages.WithUseStaticHostname, + DefinitionStages.WithHostnamePrefix, + DefinitionStages.WithStreamOptions, + DefinitionStages.WithAutoStart { + /** + * Executes the create request. + * + * @return the created resource. + */ + LiveEvent create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LiveEvent create(Context context); + } + /** The stage of the LiveEvent definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the LiveEvent definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description for the live event.. + * + * @param description A description for the live event. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the LiveEvent definition allowing to specify input. */ + interface WithInput { + /** + * Specifies the input property: Live event input settings. It defines how the live event receives input + * from a contribution encoder.. + * + * @param input Live event input settings. It defines how the live event receives input from a contribution + * encoder. + * @return the next definition stage. + */ + WithCreate withInput(LiveEventInput input); + } + /** The stage of the LiveEvent definition allowing to specify preview. */ + interface WithPreview { + /** + * Specifies the preview property: Live event preview settings. Preview allows live event producers to + * preview the live streaming content without creating any live output.. + * + * @param preview Live event preview settings. Preview allows live event producers to preview the live + * streaming content without creating any live output. + * @return the next definition stage. + */ + WithCreate withPreview(LiveEventPreview preview); + } + /** The stage of the LiveEvent definition allowing to specify encoding. */ + interface WithEncoding { + /** + * Specifies the encoding property: Encoding settings for the live event. It configures whether a live + * encoder is used for the live event and settings for the live encoder if it is used.. + * + * @param encoding Encoding settings for the live event. It configures whether a live encoder is used for + * the live event and settings for the live encoder if it is used. + * @return the next definition stage. + */ + WithCreate withEncoding(LiveEventEncoding encoding); + } + /** The stage of the LiveEvent definition allowing to specify transcriptions. */ + interface WithTranscriptions { + /** + * Specifies the transcriptions property: Live transcription settings for the live event. See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription + * feature.. + * + * @param transcriptions Live transcription settings for the live event. See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription + * feature. + * @return the next definition stage. + */ + WithCreate withTranscriptions(List transcriptions); + } + /** The stage of the LiveEvent definition allowing to specify crossSiteAccessPolicies. */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies the crossSiteAccessPolicies property: Live event cross site access policies.. + * + * @param crossSiteAccessPolicies Live event cross site access policies. + * @return the next definition stage. + */ + WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + /** The stage of the LiveEvent definition allowing to specify useStaticHostname. */ + interface WithUseStaticHostname { + /** + * Specifies the useStaticHostname property: Specifies whether a static hostname would be assigned to the + * live event preview and ingest endpoints. This value can only be updated if the live event is in Standby + * state. + * + * @param useStaticHostname Specifies whether a static hostname would be assigned to the live event preview + * and ingest endpoints. This value can only be updated if the live event is in Standby state. + * @return the next definition stage. + */ + WithCreate withUseStaticHostname(Boolean useStaticHostname); + } + /** The stage of the LiveEvent definition allowing to specify hostnamePrefix. */ + interface WithHostnamePrefix { + /** + * Specifies the hostnamePrefix property: When useStaticHostname is set to true, the hostnamePrefix + * specifies the first part of the hostname assigned to the live event preview and ingest endpoints. The + * final hostname would be a combination of this prefix, the media service account name and a short code for + * the Azure Media Services data center.. + * + * @param hostnamePrefix When useStaticHostname is set to true, the hostnamePrefix specifies the first part + * of the hostname assigned to the live event preview and ingest endpoints. The final hostname would be + * a combination of this prefix, the media service account name and a short code for the Azure Media + * Services data center. + * @return the next definition stage. + */ + WithCreate withHostnamePrefix(String hostnamePrefix); + } + /** The stage of the LiveEvent definition allowing to specify streamOptions. */ + interface WithStreamOptions { + /** + * Specifies the streamOptions property: The options to use for the LiveEvent. This value is specified at + * creation time and cannot be updated. The valid values for the array entry values are 'Default' and + * 'LowLatency'.. + * + * @param streamOptions The options to use for the LiveEvent. This value is specified at creation time and + * cannot be updated. The valid values for the array entry values are 'Default' and 'LowLatency'. + * @return the next definition stage. + */ + WithCreate withStreamOptions(List streamOptions); + } + /** The stage of the LiveEvent definition allowing to specify autoStart. */ + interface WithAutoStart { + /** + * Specifies the autoStart property: The flag indicates if the resource should be automatically started on + * creation.. + * + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @return the next definition stage. + */ + WithCreate withAutoStart(Boolean autoStart); + } + } + /** + * Begins update for the LiveEvent resource. + * + * @return the stage of resource update. + */ + LiveEvent.Update update(); + + /** The template for LiveEvent update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithDescription, + UpdateStages.WithInput, + UpdateStages.WithPreview, + UpdateStages.WithEncoding, + UpdateStages.WithTranscriptions, + UpdateStages.WithCrossSiteAccessPolicies, + UpdateStages.WithUseStaticHostname, + UpdateStages.WithHostnamePrefix, + UpdateStages.WithStreamOptions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LiveEvent apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LiveEvent apply(Context context); + } + /** The LiveEvent update stages. */ + interface UpdateStages { + /** The stage of the LiveEvent update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the LiveEvent update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description for the live event.. + * + * @param description A description for the live event. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the LiveEvent update allowing to specify input. */ + interface WithInput { + /** + * Specifies the input property: Live event input settings. It defines how the live event receives input + * from a contribution encoder.. + * + * @param input Live event input settings. It defines how the live event receives input from a contribution + * encoder. + * @return the next definition stage. + */ + Update withInput(LiveEventInput input); + } + /** The stage of the LiveEvent update allowing to specify preview. */ + interface WithPreview { + /** + * Specifies the preview property: Live event preview settings. Preview allows live event producers to + * preview the live streaming content without creating any live output.. + * + * @param preview Live event preview settings. Preview allows live event producers to preview the live + * streaming content without creating any live output. + * @return the next definition stage. + */ + Update withPreview(LiveEventPreview preview); + } + /** The stage of the LiveEvent update allowing to specify encoding. */ + interface WithEncoding { + /** + * Specifies the encoding property: Encoding settings for the live event. It configures whether a live + * encoder is used for the live event and settings for the live encoder if it is used.. + * + * @param encoding Encoding settings for the live event. It configures whether a live encoder is used for + * the live event and settings for the live encoder if it is used. + * @return the next definition stage. + */ + Update withEncoding(LiveEventEncoding encoding); + } + /** The stage of the LiveEvent update allowing to specify transcriptions. */ + interface WithTranscriptions { + /** + * Specifies the transcriptions property: Live transcription settings for the live event. See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription + * feature.. + * + * @param transcriptions Live transcription settings for the live event. See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription + * feature. + * @return the next definition stage. + */ + Update withTranscriptions(List transcriptions); + } + /** The stage of the LiveEvent update allowing to specify crossSiteAccessPolicies. */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies the crossSiteAccessPolicies property: Live event cross site access policies.. + * + * @param crossSiteAccessPolicies Live event cross site access policies. + * @return the next definition stage. + */ + Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + /** The stage of the LiveEvent update allowing to specify useStaticHostname. */ + interface WithUseStaticHostname { + /** + * Specifies the useStaticHostname property: Specifies whether a static hostname would be assigned to the + * live event preview and ingest endpoints. This value can only be updated if the live event is in Standby + * state. + * + * @param useStaticHostname Specifies whether a static hostname would be assigned to the live event preview + * and ingest endpoints. This value can only be updated if the live event is in Standby state. + * @return the next definition stage. + */ + Update withUseStaticHostname(Boolean useStaticHostname); + } + /** The stage of the LiveEvent update allowing to specify hostnamePrefix. */ + interface WithHostnamePrefix { + /** + * Specifies the hostnamePrefix property: When useStaticHostname is set to true, the hostnamePrefix + * specifies the first part of the hostname assigned to the live event preview and ingest endpoints. The + * final hostname would be a combination of this prefix, the media service account name and a short code for + * the Azure Media Services data center.. + * + * @param hostnamePrefix When useStaticHostname is set to true, the hostnamePrefix specifies the first part + * of the hostname assigned to the live event preview and ingest endpoints. The final hostname would be + * a combination of this prefix, the media service account name and a short code for the Azure Media + * Services data center. + * @return the next definition stage. + */ + Update withHostnamePrefix(String hostnamePrefix); + } + /** The stage of the LiveEvent update allowing to specify streamOptions. */ + interface WithStreamOptions { + /** + * Specifies the streamOptions property: The options to use for the LiveEvent. This value is specified at + * creation time and cannot be updated. The valid values for the array entry values are 'Default' and + * 'LowLatency'.. + * + * @param streamOptions The options to use for the LiveEvent. This value is specified at creation time and + * cannot be updated. The valid values for the array entry values are 'Default' and 'LowLatency'. + * @return the next definition stage. + */ + Update withStreamOptions(List streamOptions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LiveEvent refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LiveEvent refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventActionInput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventActionInput.java new file mode 100644 index 000000000000..e68e820b79e3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventActionInput.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LiveEvent action input parameter definition. */ +@Fluent +public final class LiveEventActionInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventActionInput.class); + + /* + * The flag indicates whether live outputs are automatically deleted when + * live event is being stopped. Deleting live outputs do not delete the + * underlying assets. + */ + @JsonProperty(value = "removeOutputsOnStop") + private Boolean removeOutputsOnStop; + + /** + * Get the removeOutputsOnStop property: The flag indicates whether live outputs are automatically deleted when live + * event is being stopped. Deleting live outputs do not delete the underlying assets. + * + * @return the removeOutputsOnStop value. + */ + public Boolean removeOutputsOnStop() { + return this.removeOutputsOnStop; + } + + /** + * Set the removeOutputsOnStop property: The flag indicates whether live outputs are automatically deleted when live + * event is being stopped. Deleting live outputs do not delete the underlying assets. + * + * @param removeOutputsOnStop the removeOutputsOnStop value to set. + * @return the LiveEventActionInput object itself. + */ + public LiveEventActionInput withRemoveOutputsOnStop(Boolean removeOutputsOnStop) { + this.removeOutputsOnStop = removeOutputsOnStop; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventEncoding.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventEncoding.java new file mode 100644 index 000000000000..8b08c14cb806 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventEncoding.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** Specifies the live event type and optional encoding settings for encoding live events. */ +@Fluent +public final class LiveEventEncoding { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventEncoding.class); + + /* + * Live event type. When encodingType is set to None, the service simply + * passes through the incoming video and audio layer(s) to the output. When + * encodingType is set to Standard or Premium1080p, a live encoder + * transcodes the incoming stream into multiple bitrates or layers. See + * https://go.microsoft.com/fwlink/?linkid=2095101 for more information. + * This property cannot be modified after the live event is created. + */ + @JsonProperty(value = "encodingType") + private LiveEventEncodingType encodingType; + + /* + * The optional encoding preset name, used when encodingType is not None. + * This value is specified at creation time and cannot be updated. If the + * encodingType is set to Standard, then the default preset name is + * ‘Default720p’. Else if the encodingType is set to Premium1080p, the + * default preset is ‘Default1080p’. + */ + @JsonProperty(value = "presetName") + private String presetName; + + /* + * Specifies how the input video will be resized to fit the desired output + * resolution(s). Default is None + */ + @JsonProperty(value = "stretchMode") + private StretchMode stretchMode; + + /* + * Use an ISO 8601 time value between 0.5 to 20 seconds to specify the + * output fragment length for the video and audio tracks of an encoding + * live event. For example, use PT2S to indicate 2 seconds. For the video + * track it also defines the key frame interval, or the length of a GoP + * (group of pictures). If this value is not set for an encoding live + * event, the fragment duration defaults to 2 seconds. The value cannot be + * set for pass-through live events. + */ + @JsonProperty(value = "keyFrameInterval") + private Duration keyFrameInterval; + + /** + * Get the encodingType property: Live event type. When encodingType is set to None, the service simply passes + * through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or + * Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers. See + * https://go.microsoft.com/fwlink/?linkid=2095101 for more information. This property cannot be modified after the + * live event is created. + * + * @return the encodingType value. + */ + public LiveEventEncodingType encodingType() { + return this.encodingType; + } + + /** + * Set the encodingType property: Live event type. When encodingType is set to None, the service simply passes + * through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or + * Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers. See + * https://go.microsoft.com/fwlink/?linkid=2095101 for more information. This property cannot be modified after the + * live event is created. + * + * @param encodingType the encodingType value to set. + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withEncodingType(LiveEventEncodingType encodingType) { + this.encodingType = encodingType; + return this; + } + + /** + * Get the presetName property: The optional encoding preset name, used when encodingType is not None. This value is + * specified at creation time and cannot be updated. If the encodingType is set to Standard, then the default preset + * name is ‘Default720p’. Else if the encodingType is set to Premium1080p, the default preset is ‘Default1080p’. + * + * @return the presetName value. + */ + public String presetName() { + return this.presetName; + } + + /** + * Set the presetName property: The optional encoding preset name, used when encodingType is not None. This value is + * specified at creation time and cannot be updated. If the encodingType is set to Standard, then the default preset + * name is ‘Default720p’. Else if the encodingType is set to Premium1080p, the default preset is ‘Default1080p’. + * + * @param presetName the presetName value to set. + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withPresetName(String presetName) { + this.presetName = presetName; + return this; + } + + /** + * Get the stretchMode property: Specifies how the input video will be resized to fit the desired output + * resolution(s). Default is None. + * + * @return the stretchMode value. + */ + public StretchMode stretchMode() { + return this.stretchMode; + } + + /** + * Set the stretchMode property: Specifies how the input video will be resized to fit the desired output + * resolution(s). Default is None. + * + * @param stretchMode the stretchMode value to set. + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withStretchMode(StretchMode stretchMode) { + this.stretchMode = stretchMode; + return this; + } + + /** + * Get the keyFrameInterval property: Use an ISO 8601 time value between 0.5 to 20 seconds to specify the output + * fragment length for the video and audio tracks of an encoding live event. For example, use PT2S to indicate 2 + * seconds. For the video track it also defines the key frame interval, or the length of a GoP (group of pictures). + * If this value is not set for an encoding live event, the fragment duration defaults to 2 seconds. The value + * cannot be set for pass-through live events. + * + * @return the keyFrameInterval value. + */ + public Duration keyFrameInterval() { + return this.keyFrameInterval; + } + + /** + * Set the keyFrameInterval property: Use an ISO 8601 time value between 0.5 to 20 seconds to specify the output + * fragment length for the video and audio tracks of an encoding live event. For example, use PT2S to indicate 2 + * seconds. For the video track it also defines the key frame interval, or the length of a GoP (group of pictures). + * If this value is not set for an encoding live event, the fragment duration defaults to 2 seconds. The value + * cannot be set for pass-through live events. + * + * @param keyFrameInterval the keyFrameInterval value to set. + * @return the LiveEventEncoding object itself. + */ + public LiveEventEncoding withKeyFrameInterval(Duration keyFrameInterval) { + this.keyFrameInterval = keyFrameInterval; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventEncodingType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventEncodingType.java new file mode 100644 index 000000000000..4a1f3312b261 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventEncodingType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LiveEventEncodingType. */ +public final class LiveEventEncodingType extends ExpandableStringEnum { + /** Static value None for LiveEventEncodingType. */ + public static final LiveEventEncodingType NONE = fromString("None"); + + /** Static value Standard for LiveEventEncodingType. */ + public static final LiveEventEncodingType STANDARD = fromString("Standard"); + + /** Static value Premium1080p for LiveEventEncodingType. */ + public static final LiveEventEncodingType PREMIUM1080P = fromString("Premium1080p"); + + /** + * Creates or finds a LiveEventEncodingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LiveEventEncodingType. + */ + @JsonCreator + public static LiveEventEncodingType fromString(String name) { + return fromString(name, LiveEventEncodingType.class); + } + + /** @return known LiveEventEncodingType values. */ + public static Collection values() { + return values(LiveEventEncodingType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventEndpoint.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventEndpoint.java new file mode 100644 index 000000000000..5db98537253f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventEndpoint.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The live event endpoint. */ +@Fluent +public final class LiveEventEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventEndpoint.class); + + /* + * The endpoint protocol. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /* + * The endpoint URL. + */ + @JsonProperty(value = "url") + private String url; + + /** + * Get the protocol property: The endpoint protocol. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: 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 url property: The endpoint URL. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInput.java new file mode 100644 index 000000000000..ed12f2f4ed40 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInput.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The live event input. */ +@Fluent +public final class LiveEventInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventInput.class); + + /* + * The input protocol for the live event. This is specified at creation + * time and cannot be updated. + */ + @JsonProperty(value = "streamingProtocol", required = true) + private LiveEventInputProtocol streamingProtocol; + + /* + * Access control for live event input. + */ + @JsonProperty(value = "accessControl") + private LiveEventInputAccessControl accessControl; + + /* + * ISO 8601 time duration of the key frame interval duration of the input. + * This value sets the EXT-X-TARGETDURATION property in the HLS output. For + * example, use PT2S to indicate 2 seconds. Leave the value empty for + * encoding live events. + */ + @JsonProperty(value = "keyFrameIntervalDuration") + private String keyFrameIntervalDuration; + + /* + * A UUID in string form to uniquely identify the 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 streamingProtocol property: The input protocol for the live event. This is specified at creation time and + * cannot be updated. + * + * @return the streamingProtocol value. + */ + public LiveEventInputProtocol streamingProtocol() { + return this.streamingProtocol; + } + + /** + * Set the streamingProtocol property: The input protocol for the live event. This is specified at creation time and + * cannot be updated. + * + * @param streamingProtocol the streamingProtocol value to set. + * @return the LiveEventInput object itself. + */ + public LiveEventInput withStreamingProtocol(LiveEventInputProtocol streamingProtocol) { + this.streamingProtocol = streamingProtocol; + return this; + } + + /** + * Get the accessControl property: Access control for live event input. + * + * @return the accessControl value. + */ + public LiveEventInputAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the accessControl property: Access control for live event input. + * + * @param accessControl the accessControl value to set. + * @return the LiveEventInput object itself. + */ + public LiveEventInput withAccessControl(LiveEventInputAccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get the keyFrameIntervalDuration property: ISO 8601 time duration of the key frame interval duration of the + * input. This value sets the EXT-X-TARGETDURATION property in the HLS output. For example, use PT2S to indicate 2 + * seconds. Leave the value empty for encoding live events. + * + * @return the keyFrameIntervalDuration value. + */ + public String keyFrameIntervalDuration() { + return this.keyFrameIntervalDuration; + } + + /** + * Set the keyFrameIntervalDuration property: ISO 8601 time duration of the key frame interval duration of the + * input. This value sets the EXT-X-TARGETDURATION property in the HLS output. For example, use PT2S to indicate 2 + * seconds. Leave the value empty for encoding live events. + * + * @param keyFrameIntervalDuration the keyFrameIntervalDuration value to set. + * @return the LiveEventInput object itself. + */ + public LiveEventInput withKeyFrameIntervalDuration(String keyFrameIntervalDuration) { + this.keyFrameIntervalDuration = keyFrameIntervalDuration; + return this; + } + + /** + * Get the accessToken property: A UUID in string form to uniquely identify the 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 the accessToken property: A UUID in string form to uniquely identify the 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 endpoints property: The input endpoints for the live event. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streamingProtocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property streamingProtocol in model LiveEventInput")); + } + if (accessControl() != null) { + accessControl().validate(); + } + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInputAccessControl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInputAccessControl.java new file mode 100644 index 000000000000..a76f0e5584e4 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInputAccessControl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IP access control for live event input. */ +@Fluent +public final class LiveEventInputAccessControl { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventInputAccessControl.class); + + /* + * The IP access control properties. + */ + @JsonProperty(value = "ip") + private IpAccessControl ip; + + /** + * Get the ip property: The IP access control properties. + * + * @return the ip value. + */ + public IpAccessControl ip() { + return this.ip; + } + + /** + * Set the ip property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ip() != null) { + ip().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInputProtocol.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInputProtocol.java new file mode 100644 index 000000000000..86e2aef6331a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInputProtocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LiveEventInputProtocol. */ +public final class LiveEventInputProtocol extends ExpandableStringEnum { + /** Static value FragmentedMP4 for LiveEventInputProtocol. */ + public static final LiveEventInputProtocol FRAGMENTED_MP4 = fromString("FragmentedMP4"); + + /** Static value RTMP for LiveEventInputProtocol. */ + public static final LiveEventInputProtocol RTMP = fromString("RTMP"); + + /** + * Creates or finds a LiveEventInputProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding LiveEventInputProtocol. + */ + @JsonCreator + public static LiveEventInputProtocol fromString(String name) { + return fromString(name, LiveEventInputProtocol.class); + } + + /** @return known LiveEventInputProtocol values. */ + public static Collection values() { + return values(LiveEventInputProtocol.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInputTrackSelection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInputTrackSelection.java new file mode 100644 index 000000000000..52226955d6e9 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventInputTrackSelection.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A track selection condition. This property is reserved for future use, any value set on this property will be + * ignored. + */ +@Fluent +public final class LiveEventInputTrackSelection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventInputTrackSelection.class); + + /* + * Property name to select. This property is reserved for future use, any + * value set on this property will be ignored. + */ + @JsonProperty(value = "property") + private String property; + + /* + * Comparing operation. This property is reserved for future use, any value + * set on this property will be ignored. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Property value to select. This property is reserved for future use, any + * value set on this property will be ignored. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the property property: Property name to select. This property is reserved for future use, any value set on + * this property will be ignored. + * + * @return the property value. + */ + public String property() { + return this.property; + } + + /** + * Set the property property: Property name to select. This property is reserved for future use, any value set on + * this property will be ignored. + * + * @param property the property value to set. + * @return the LiveEventInputTrackSelection object itself. + */ + public LiveEventInputTrackSelection withProperty(String property) { + this.property = property; + return this; + } + + /** + * Get the operation property: Comparing operation. This property is reserved for future use, any value set on this + * property will be ignored. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Comparing operation. This property is reserved for future use, any value set on this + * property will be ignored. + * + * @param operation the operation value to set. + * @return the LiveEventInputTrackSelection object itself. + */ + public LiveEventInputTrackSelection withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the value property: Property value to select. This property is reserved for future use, any value set on this + * property will be ignored. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value to select. This property is reserved for future use, any value set on this + * property will be ignored. + * + * @param value the value value to set. + * @return the LiveEventInputTrackSelection object itself. + */ + public LiveEventInputTrackSelection withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventListResult.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventListResult.java new file mode 100644 index 000000000000..34c0da46945a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventListResult.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The LiveEvent list result. */ +@Fluent +public final class LiveEventListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventListResult.class); + + /* + * The result of the List Live Event operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The number of result. + */ + @JsonProperty(value = "@odata.count") + private Integer odataCount; + + /* + * The link to the next set of results. Not empty if value contains + * incomplete list of live outputs. + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: The result of the List Live Event operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The result of the List Live Event operation. + * + * @param value the value value to set. + * @return the LiveEventListResult object itself. + */ + public LiveEventListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataCount property: The number of result. + * + * @return the odataCount value. + */ + public Integer odataCount() { + return this.odataCount; + } + + /** + * Set the odataCount property: The number of result. + * + * @param odataCount the odataCount value to set. + * @return the LiveEventListResult object itself. + */ + public LiveEventListResult withOdataCount(Integer odataCount) { + this.odataCount = odataCount; + return this; + } + + /** + * Get the odataNextLink property: The link to the next set of results. Not empty if value contains incomplete list + * of live outputs. + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: The link to the next set of results. Not empty if value contains incomplete list + * of live outputs. + * + * @param odataNextLink the odataNextLink value to set. + * @return the LiveEventListResult object itself. + */ + public LiveEventListResult withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventOutputTranscriptionTrack.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventOutputTranscriptionTrack.java new file mode 100644 index 000000000000..b2f37529e7b4 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventOutputTranscriptionTrack.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a transcription track in the output of a live event, generated using speech-to-text transcription. This + * property is reserved for future use, any value set on this property will be ignored. + */ +@Fluent +public final class LiveEventOutputTranscriptionTrack { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventOutputTranscriptionTrack.class); + + /* + * The output track name. This property is reserved for future use, any + * value set on this property will be ignored. + */ + @JsonProperty(value = "trackName", required = true) + private String trackName; + + /** + * Get the trackName property: The output track name. This property is reserved for future use, any value set on + * this property will be ignored. + * + * @return the trackName value. + */ + public String trackName() { + return this.trackName; + } + + /** + * Set the trackName property: The output track name. This property is reserved for future use, any value set on + * this property will be ignored. + * + * @param trackName the trackName value to set. + * @return the LiveEventOutputTranscriptionTrack object itself. + */ + public LiveEventOutputTranscriptionTrack withTrackName(String trackName) { + this.trackName = trackName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (trackName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property trackName in model LiveEventOutputTranscriptionTrack")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventPreview.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventPreview.java new file mode 100644 index 000000000000..8f96315cb3e6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventPreview.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Live event preview settings. */ +@Fluent +public final class LiveEventPreview { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventPreview.class); + + /* + * The endpoints for preview. Do not share the preview URL with the live + * event audience. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * The access control for live event 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 live event 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 streaming locator + * 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 property: The endpoints for preview. Do not share the preview URL with the live event audience. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The endpoints for preview. Do not share the preview URL with the live event audience. + * + * @param endpoints the endpoints value to set. + * @return the LiveEventPreview object itself. + */ + public LiveEventPreview withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the accessControl property: The access control for live event preview. + * + * @return the accessControl value. + */ + public LiveEventPreviewAccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the accessControl property: The access control for live event 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 previewLocator property: 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 previewLocator property: 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 streamingPolicyName property: The name of streaming policy used for the live event preview. This value is + * specified at creation time and cannot be updated. + * + * @return the streamingPolicyName value. + */ + public String streamingPolicyName() { + return this.streamingPolicyName; + } + + /** + * Set the streamingPolicyName property: The name of streaming policy used for the live event 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 the alternativeMediaId property: An alternative media identifier associated with the streaming locator + * 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 the alternativeMediaId property: An alternative media identifier associated with the streaming locator + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (accessControl() != null) { + accessControl().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventPreviewAccessControl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventPreviewAccessControl.java new file mode 100644 index 000000000000..07d96e682610 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventPreviewAccessControl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IP access control for the live event preview endpoint. */ +@Fluent +public final class LiveEventPreviewAccessControl { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventPreviewAccessControl.class); + + /* + * The IP access control properties. + */ + @JsonProperty(value = "ip") + private IpAccessControl ip; + + /** + * Get the ip property: The IP access control properties. + * + * @return the ip value. + */ + public IpAccessControl ip() { + return this.ip; + } + + /** + * Set the ip property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ip() != null) { + ip().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventResourceState.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventResourceState.java new file mode 100644 index 000000000000..ba24619deb83 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventResourceState.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LiveEventResourceState. */ +public final class LiveEventResourceState extends ExpandableStringEnum { + /** Static value Stopped for LiveEventResourceState. */ + public static final LiveEventResourceState STOPPED = fromString("Stopped"); + + /** Static value Allocating for LiveEventResourceState. */ + public static final LiveEventResourceState ALLOCATING = fromString("Allocating"); + + /** Static value StandBy for LiveEventResourceState. */ + public static final LiveEventResourceState STAND_BY = fromString("StandBy"); + + /** Static value Starting for LiveEventResourceState. */ + public static final LiveEventResourceState STARTING = fromString("Starting"); + + /** Static value Running for LiveEventResourceState. */ + public static final LiveEventResourceState RUNNING = fromString("Running"); + + /** Static value Stopping for LiveEventResourceState. */ + public static final LiveEventResourceState STOPPING = fromString("Stopping"); + + /** Static value Deleting for LiveEventResourceState. */ + public static final LiveEventResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a LiveEventResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LiveEventResourceState. + */ + @JsonCreator + public static LiveEventResourceState fromString(String name) { + return fromString(name, LiveEventResourceState.class); + } + + /** @return known LiveEventResourceState values. */ + public static Collection values() { + return values(LiveEventResourceState.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventTranscription.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventTranscription.java new file mode 100644 index 000000000000..bc172b37e312 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEventTranscription.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes the transcription tracks in the output of a live event, generated using speech-to-text transcription. This + * property is reserved for future use, any value set on this property will be ignored. + */ +@Fluent +public final class LiveEventTranscription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveEventTranscription.class); + + /* + * Specifies the language (locale) to be used for speech-to-text + * transcription – it should match the spoken language in the audio track. + * The value should be in BCP-47 format (e.g: 'en-US'). See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information + * about the live transcription feature and the list of supported + * languages. + */ + @JsonProperty(value = "language") + private String language; + + /* + * Provides a mechanism to select the audio track in the input live feed, + * to which speech-to-text transcription is applied. This property is + * reserved for future use, any value set on this property will be ignored. + */ + @JsonProperty(value = "inputTrackSelection") + private List inputTrackSelection; + + /* + * Describes a transcription track in the output of a live event, generated + * using speech-to-text transcription. This property is reserved for future + * use, any value set on this property will be ignored. + */ + @JsonProperty(value = "outputTranscriptionTrack") + private LiveEventOutputTranscriptionTrack outputTranscriptionTrack; + + /** + * Get the language property: Specifies the language (locale) to be used for speech-to-text transcription – it + * should match the spoken language in the audio track. The value should be in BCP-47 format (e.g: 'en-US'). See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature and the + * list of supported languages. + * + * @return the language value. + */ + public String language() { + return this.language; + } + + /** + * Set the language property: Specifies the language (locale) to be used for speech-to-text transcription – it + * should match the spoken language in the audio track. The value should be in BCP-47 format (e.g: 'en-US'). See + * https://go.microsoft.com/fwlink/?linkid=2133742 for more information about the live transcription feature and the + * list of supported languages. + * + * @param language the language value to set. + * @return the LiveEventTranscription object itself. + */ + public LiveEventTranscription withLanguage(String language) { + this.language = language; + return this; + } + + /** + * Get the inputTrackSelection property: Provides a mechanism to select the audio track in the input live feed, to + * which speech-to-text transcription is applied. This property is reserved for future use, any value set on this + * property will be ignored. + * + * @return the inputTrackSelection value. + */ + public List inputTrackSelection() { + return this.inputTrackSelection; + } + + /** + * Set the inputTrackSelection property: Provides a mechanism to select the audio track in the input live feed, to + * which speech-to-text transcription is applied. This property is reserved for future use, any value set on this + * property will be ignored. + * + * @param inputTrackSelection the inputTrackSelection value to set. + * @return the LiveEventTranscription object itself. + */ + public LiveEventTranscription withInputTrackSelection(List inputTrackSelection) { + this.inputTrackSelection = inputTrackSelection; + return this; + } + + /** + * Get the outputTranscriptionTrack property: Describes a transcription track in the output of a live event, + * generated using speech-to-text transcription. This property is reserved for future use, any value set on this + * property will be ignored. + * + * @return the outputTranscriptionTrack value. + */ + public LiveEventOutputTranscriptionTrack outputTranscriptionTrack() { + return this.outputTranscriptionTrack; + } + + /** + * Set the outputTranscriptionTrack property: Describes a transcription track in the output of a live event, + * generated using speech-to-text transcription. This property is reserved for future use, any value set on this + * property will be ignored. + * + * @param outputTranscriptionTrack the outputTranscriptionTrack value to set. + * @return the LiveEventTranscription object itself. + */ + public LiveEventTranscription withOutputTranscriptionTrack( + LiveEventOutputTranscriptionTrack outputTranscriptionTrack) { + this.outputTranscriptionTrack = outputTranscriptionTrack; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inputTrackSelection() != null) { + inputTrackSelection().forEach(e -> e.validate()); + } + if (outputTranscriptionTrack() != null) { + outputTranscriptionTrack().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvents.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvents.java new file mode 100644 index 000000000000..c9e58bbad2f6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvents.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LiveEvents. */ +public interface LiveEvents { + /** + * Lists all 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveEvent list result. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets properties of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + LiveEvent get(String resourceGroupName, String accountName, String liveEventName); + + /** + * Gets properties of 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String liveEventName); + + /** + * 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void allocate(String resourceGroupName, String accountName, String liveEventName); + + /** + * A live event is in StandBy state after allocation completes, and is ready to start. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void allocate(String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String accountName, String liveEventName); + + /** + * A live event in Stopped or StandBy state will be in Running state after the start operation completes. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String accountName, String liveEventName, LiveEventActionInput parameters); + + /** + * Stops a running 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, maximum length is 32. + * @param parameters The LiveEvent action input parameter definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop( + String resourceGroupName, + String accountName, + String liveEventName, + LiveEventActionInput parameters, + Context context); + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reset(String resourceGroupName, String accountName, String liveEventName); + + /** + * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and + * will be started again. All assets used by the live outputs and streaming locators created on these assets are + * unaffected. + * + * @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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reset(String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * Gets properties of a live event. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + LiveEvent getById(String id); + + /** + * Gets properties of a live event. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a live event. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a live event. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a live event. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LiveEvent resource. + * + * @param name resource name. + * @return the first stage of the new LiveEvent definition. + */ + LiveEvent.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutput.java new file mode 100644 index 000000000000..547aa2f25de4 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutput.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveOutputInner; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of LiveOutput. */ +public interface LiveOutput { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the description property: The description of the live output. + * + * @return the description value. + */ + String description(); + + /** + * Gets the assetName property: The asset that the live output will write to. + * + * @return the assetName value. + */ + String assetName(); + + /** + * Gets the archiveWindowLength property: ISO 8601 time between 1 minute to 25 hours to indicate the maximum content + * length that can be archived in the asset for this live output. This also sets the maximum content length for the + * rewind window. For example, use PT1H30M to indicate 1 hour and 30 minutes of archive window. + * + * @return the archiveWindowLength value. + */ + Duration archiveWindowLength(); + + /** + * Gets the manifestName property: The manifest file name. If not provided, the service will generate one + * automatically. + * + * @return the manifestName value. + */ + String manifestName(); + + /** + * Gets the hls property: HTTP Live Streaming (HLS) packing setting for the live output. + * + * @return the hls value. + */ + Hls hls(); + + /** + * Gets the outputSnapTime property: The initial timestamp that the live output will start at, any content before + * this value will not be archived. + * + * @return the outputSnapTime value. + */ + Long outputSnapTime(); + + /** + * Gets the created property: The creation time the live output. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the lastModified property: The time the live output was last modified. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the provisioningState property: The provisioning state of the live output. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the resourceState property: The resource state of the live output. + * + * @return the resourceState value. + */ + LiveOutputResourceState resourceState(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.LiveOutputInner object. + * + * @return the inner object. + */ + LiveOutputInner innerModel(); + + /** The entirety of the LiveOutput definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The LiveOutput definition stages. */ + interface DefinitionStages { + /** The first stage of the LiveOutput definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the LiveOutput definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName, liveEventName. + * + * @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, maximum length is 32. + * @return the next definition stage. + */ + WithCreate withExistingLiveEvent(String resourceGroupName, String accountName, String liveEventName); + } + /** + * The stage of the LiveOutput definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDescription, + DefinitionStages.WithAssetName, + DefinitionStages.WithArchiveWindowLength, + DefinitionStages.WithManifestName, + DefinitionStages.WithHls, + DefinitionStages.WithOutputSnapTime { + /** + * Executes the create request. + * + * @return the created resource. + */ + LiveOutput create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LiveOutput create(Context context); + } + /** The stage of the LiveOutput definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The description of the live output.. + * + * @param description The description of the live output. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the LiveOutput definition allowing to specify assetName. */ + interface WithAssetName { + /** + * Specifies the assetName property: The asset that the live output will write to.. + * + * @param assetName The asset that the live output will write to. + * @return the next definition stage. + */ + WithCreate withAssetName(String assetName); + } + /** The stage of the LiveOutput definition allowing to specify archiveWindowLength. */ + interface WithArchiveWindowLength { + /** + * Specifies the archiveWindowLength property: ISO 8601 time between 1 minute to 25 hours to indicate the + * maximum content length that can be archived in the asset for this live output. This also sets the maximum + * content length for the rewind window. For example, use PT1H30M to indicate 1 hour and 30 minutes of + * archive window.. + * + * @param archiveWindowLength ISO 8601 time between 1 minute to 25 hours to indicate the maximum content + * length that can be archived in the asset for this live output. This also sets the maximum content + * length for the rewind window. For example, use PT1H30M to indicate 1 hour and 30 minutes of archive + * window. + * @return the next definition stage. + */ + WithCreate withArchiveWindowLength(Duration archiveWindowLength); + } + /** The stage of the LiveOutput definition allowing to specify manifestName. */ + interface WithManifestName { + /** + * Specifies the manifestName property: The manifest file name. If not provided, the service will generate + * one automatically.. + * + * @param manifestName The manifest file name. If not provided, the service will generate one automatically. + * @return the next definition stage. + */ + WithCreate withManifestName(String manifestName); + } + /** The stage of the LiveOutput definition allowing to specify hls. */ + interface WithHls { + /** + * Specifies the hls property: HTTP Live Streaming (HLS) packing setting for the live output.. + * + * @param hls HTTP Live Streaming (HLS) packing setting for the live output. + * @return the next definition stage. + */ + WithCreate withHls(Hls hls); + } + /** The stage of the LiveOutput definition allowing to specify outputSnapTime. */ + interface WithOutputSnapTime { + /** + * Specifies the outputSnapTime property: The initial timestamp that the live output will start at, any + * content before this value will not be archived.. + * + * @param outputSnapTime The initial timestamp that the live output will start at, any content before this + * value will not be archived. + * @return the next definition stage. + */ + WithCreate withOutputSnapTime(Long outputSnapTime); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LiveOutput refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LiveOutput refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutputListResult.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutputListResult.java new file mode 100644 index 000000000000..cc8d4f491c28 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutputListResult.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.LiveOutputInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The LiveOutput list result. */ +@Fluent +public final class LiveOutputListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LiveOutputListResult.class); + + /* + * The result of the List LiveOutput operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The number of result. + */ + @JsonProperty(value = "@odata.count") + private Integer odataCount; + + /* + * The link to the next set of results. Not empty if value contains + * incomplete list of live outputs. + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: The result of the List LiveOutput operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The result of the List LiveOutput operation. + * + * @param value the value value to set. + * @return the LiveOutputListResult object itself. + */ + public LiveOutputListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataCount property: The number of result. + * + * @return the odataCount value. + */ + public Integer odataCount() { + return this.odataCount; + } + + /** + * Set the odataCount property: The number of result. + * + * @param odataCount the odataCount value to set. + * @return the LiveOutputListResult object itself. + */ + public LiveOutputListResult withOdataCount(Integer odataCount) { + this.odataCount = odataCount; + return this; + } + + /** + * Get the odataNextLink property: The link to the next set of results. Not empty if value contains incomplete list + * of live outputs. + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: The link to the next set of results. Not empty if value contains incomplete list + * of live outputs. + * + * @param odataNextLink the odataNextLink value to set. + * @return the LiveOutputListResult object itself. + */ + public LiveOutputListResult withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutputResourceState.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutputResourceState.java new file mode 100644 index 000000000000..0a603bac9dcc --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutputResourceState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LiveOutputResourceState. */ +public final class LiveOutputResourceState extends ExpandableStringEnum { + /** Static value Creating for LiveOutputResourceState. */ + public static final LiveOutputResourceState CREATING = fromString("Creating"); + + /** Static value Running for LiveOutputResourceState. */ + public static final LiveOutputResourceState RUNNING = fromString("Running"); + + /** Static value Deleting for LiveOutputResourceState. */ + public static final LiveOutputResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a LiveOutputResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LiveOutputResourceState. + */ + @JsonCreator + public static LiveOutputResourceState fromString(String name) { + return fromString(name, LiveOutputResourceState.class); + } + + /** @return known LiveOutputResourceState values. */ + public static Collection values() { + return values(LiveOutputResourceState.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutputs.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutputs.java new file mode 100644 index 000000000000..9c4e04353cba --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveOutputs.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LiveOutputs. */ +public interface LiveOutputs { + /** + * Lists the live outputs of 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, maximum length is 32. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + PagedIterable list(String resourceGroupName, String accountName, String liveEventName); + + /** + * Lists the live outputs of 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, maximum length is 32. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LiveOutput list result. + */ + PagedIterable list(String resourceGroupName, String accountName, String liveEventName, Context context); + + /** + * 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + LiveOutput get(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + + /** + * 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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context); + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName); + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @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, maximum length is 32. + * @param liveOutputName The name of the live output. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String accountName, String liveEventName, String liveOutputName, Context context); + + /** + * Gets a live output. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + LiveOutput getById(String id); + + /** + * Gets a live output. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a live output. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LiveOutput resource. + * + * @param name resource name. + * @return the first stage of the new LiveOutput definition. + */ + LiveOutput.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Locations.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Locations.java new file mode 100644 index 000000000000..84fd3f6ecf78 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Locations.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Locations. */ +public interface Locations { + /** + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location. + * @param parameters The input to the check name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the check name availability request. + */ + EntityNameAvailabilityCheckOutput checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters); + + /** + * Checks whether the Media Service resource name is available. + * + * @param locationName The name of the location. + * @param parameters The input to the check name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String locationName, CheckNameAvailabilityInput parameters, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LogSpecification.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LogSpecification.java new file mode 100644 index 000000000000..cc2e23579a2a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LogSpecification.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A diagnostic log emitted by service. */ +@Immutable +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * The diagnostic log category name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The diagnostic log category display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The time range for requests in each blob. + */ + @JsonProperty(value = "blobDuration", access = JsonProperty.Access.WRITE_ONLY) + private String blobDuration; + + /** + * Get the name property: The diagnostic log category name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: The diagnostic log category display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the blobDuration property: The time range for requests in each blob. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ManagedIdentityType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ManagedIdentityType.java new file mode 100644 index 000000000000..3ad510dbcd67 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ManagedIdentityType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedIdentityType. */ +public final class ManagedIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value None for ManagedIdentityType. */ + public static final ManagedIdentityType NONE = fromString("None"); + + /** + * Creates or finds a ManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedIdentityType. + */ + @JsonCreator + public static ManagedIdentityType fromString(String name) { + return fromString(name, ManagedIdentityType.class); + } + + /** @return known ManagedIdentityType values. */ + public static Collection values() { + return values(ManagedIdentityType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaService.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaService.java new file mode 100644 index 000000000000..f511b1d990ee --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaService.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** An immutable client-side representation of MediaService. */ +public interface MediaService { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The Managed Identity for the Media Services account. + * + * @return the identity value. + */ + MediaServiceIdentity identity(); + + /** + * Gets the mediaServiceId property: The Media Services account ID. + * + * @return the mediaServiceId value. + */ + UUID mediaServiceId(); + + /** + * Gets the storageAccounts property: The storage accounts for this resource. + * + * @return the storageAccounts value. + */ + List storageAccounts(); + + /** + * Gets the storageAuthentication property: The storageAuthentication property. + * + * @return the storageAuthentication value. + */ + StorageAuthentication storageAuthentication(); + + /** + * Gets the encryption property: The account encryption properties. + * + * @return the encryption value. + */ + AccountEncryption encryption(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner object. + * + * @return the inner object. + */ + MediaServiceInner innerModel(); + + /** The entirety of the MediaService definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The MediaService definition stages. */ + interface DefinitionStages { + /** The first stage of the MediaService definition. */ + interface Blank extends WithLocation { + } + /** The stage of the MediaService definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the MediaService definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the MediaService definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithStorageAccounts, + DefinitionStages.WithStorageAuthentication, + DefinitionStages.WithEncryption { + /** + * Executes the create request. + * + * @return the created resource. + */ + MediaService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MediaService create(Context context); + } + /** The stage of the MediaService definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the MediaService definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The Managed Identity for the Media Services account.. + * + * @param identity The Managed Identity for the Media Services account. + * @return the next definition stage. + */ + WithCreate withIdentity(MediaServiceIdentity identity); + } + /** The stage of the MediaService definition allowing to specify storageAccounts. */ + interface WithStorageAccounts { + /** + * Specifies the storageAccounts property: The storage accounts for this resource.. + * + * @param storageAccounts The storage accounts for this resource. + * @return the next definition stage. + */ + WithCreate withStorageAccounts(List storageAccounts); + } + /** The stage of the MediaService definition allowing to specify storageAuthentication. */ + interface WithStorageAuthentication { + /** + * Specifies the storageAuthentication property: The storageAuthentication property.. + * + * @param storageAuthentication The storageAuthentication property. + * @return the next definition stage. + */ + WithCreate withStorageAuthentication(StorageAuthentication storageAuthentication); + } + /** The stage of the MediaService definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The account encryption properties.. + * + * @param encryption The account encryption properties. + * @return the next definition stage. + */ + WithCreate withEncryption(AccountEncryption encryption); + } + } + /** + * Begins update for the MediaService resource. + * + * @return the stage of resource update. + */ + MediaService.Update update(); + + /** The template for MediaService update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithStorageAccounts, + UpdateStages.WithStorageAuthentication, + UpdateStages.WithEncryption { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MediaService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MediaService apply(Context context); + } + /** The MediaService update stages. */ + interface UpdateStages { + /** The stage of the MediaService update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the MediaService update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The Managed Identity for the Media Services account.. + * + * @param identity The Managed Identity for the Media Services account. + * @return the next definition stage. + */ + Update withIdentity(MediaServiceIdentity identity); + } + /** The stage of the MediaService update allowing to specify storageAccounts. */ + interface WithStorageAccounts { + /** + * Specifies the storageAccounts property: The storage accounts for this resource.. + * + * @param storageAccounts The storage accounts for this resource. + * @return the next definition stage. + */ + Update withStorageAccounts(List storageAccounts); + } + /** The stage of the MediaService update allowing to specify storageAuthentication. */ + interface WithStorageAuthentication { + /** + * Specifies the storageAuthentication property: The storageAuthentication property.. + * + * @param storageAuthentication The storageAuthentication property. + * @return the next definition stage. + */ + Update withStorageAuthentication(StorageAuthentication storageAuthentication); + } + /** The stage of the MediaService update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The account encryption properties.. + * + * @param encryption The account encryption properties. + * @return the next definition stage. + */ + Update withEncryption(AccountEncryption encryption); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MediaService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MediaService refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaServiceCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaServiceCollection.java new file mode 100644 index 000000000000..2ce50b6c5428 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaServiceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of MediaService items. */ +@Fluent +public final class MediaServiceCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MediaServiceCollection.class); + + /* + * A collection of MediaService items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of MediaService items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of MediaService items. + * + * @param value the value value to set. + * @return the MediaServiceCollection object itself. + */ + public MediaServiceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the MediaServiceCollection object itself. + */ + public MediaServiceCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaServiceIdentity.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaServiceIdentity.java new file mode 100644 index 000000000000..9375b1537d51 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaServiceIdentity.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MediaServiceIdentity model. */ +@Fluent +public class MediaServiceIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MediaServiceIdentity.class); + + /* + * The identity type. + */ + @JsonProperty(value = "type", required = true) + private ManagedIdentityType type; + + /* + * The Principal ID of the identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The Tenant ID of the identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the MediaServiceIdentity object itself. + */ + public MediaServiceIdentity withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: The Principal ID of the identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The Tenant ID of the identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model MediaServiceIdentity")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mediaservices.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mediaservices.java new file mode 100644 index 000000000000..42d276d75e84 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mediaservices.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Mediaservices. */ +public interface Mediaservices { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Media Services accounts in the resource group. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + MediaService getByResourceGroup(String resourceGroupName, String accountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * 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 parameters The input to the sync storage keys request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void syncStorageKeys(String resourceGroupName, String accountName, SyncStorageKeysInput parameters); + + /** + * 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 parameters The input to the sync storage keys request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response syncStorageKeysWithResponse( + String resourceGroupName, String accountName, SyncStorageKeysInput parameters, Context context); + + /** + * List the media edge policies associated with the 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + EdgePolicies listEdgePolicies(String resourceGroupName, String accountName, ListEdgePoliciesInput parameters); + + /** + * List the media edge policies associated with the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response listEdgePoliciesWithResponse( + String resourceGroupName, String accountName, ListEdgePoliciesInput parameters, Context context); + + /** + * List Media Services accounts in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + PagedIterable list(); + + /** + * List Media Services accounts in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of MediaService items. + */ + PagedIterable list(Context context); + + /** + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + MediaService getBySubscription(String accountName); + + /** + * Get the details of a Media Services account. + * + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + Response getBySubscriptionWithResponse(String accountName, Context context); + + /** + * Get the details of a Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + MediaService getById(String id); + + /** + * Get the details of a Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Media Services account. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MediaService resource. + * + * @param name resource name. + * @return the first stage of the new MediaService definition. + */ + MediaService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricAggregationType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricAggregationType.java new file mode 100644 index 000000000000..278a7cb8b0cf --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricAggregationType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricAggregationType. */ +public final class MetricAggregationType extends ExpandableStringEnum { + /** Static value Average for MetricAggregationType. */ + public static final MetricAggregationType AVERAGE = fromString("Average"); + + /** Static value Count for MetricAggregationType. */ + public static final MetricAggregationType COUNT = fromString("Count"); + + /** Static value Total for MetricAggregationType. */ + public static final MetricAggregationType TOTAL = fromString("Total"); + + /** + * Creates or finds a MetricAggregationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricAggregationType. + */ + @JsonCreator + public static MetricAggregationType fromString(String name) { + return fromString(name, MetricAggregationType.class); + } + + /** @return known MetricAggregationType values. */ + public static Collection values() { + return values(MetricAggregationType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricDimension.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricDimension.java new file mode 100644 index 000000000000..ed49633a21e3 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricDimension.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A metric dimension. */ +@Immutable +public final class MetricDimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDimension.class); + + /* + * 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 name property: The metric dimension name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: The display name for the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the toBeExportedForShoebox property: Whether to export metric to shoebox. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricSpecification.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricSpecification.java new file mode 100644 index 000000000000..9f1da4633930 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricSpecification.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A metric emitted by service. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * 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 + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private MetricUnit unit; + + /* + * The metric aggregation type + */ + @JsonProperty(value = "aggregationType", access = JsonProperty.Access.WRITE_ONLY) + private MetricAggregationType aggregationType; + + /* + * Supported aggregation types. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /* + * The metric dimensions. + */ + @JsonProperty(value = "dimensions", access = JsonProperty.Access.WRITE_ONLY) + private List dimensions; + + /** + * Get the name property: The metric name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: The metric display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the displayDescription property: The metric display description. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Get the unit property: The metric unit. + * + * @return the unit value. + */ + public MetricUnit unit() { + return this.unit; + } + + /** + * Get the aggregationType property: The metric aggregation type. + * + * @return the aggregationType value. + */ + public MetricAggregationType aggregationType() { + return this.aggregationType; + } + + /** + * Get the supportedAggregationTypes property: Supported aggregation types. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: Supported aggregation types. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get the dimensions property: The metric dimensions. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricUnit.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricUnit.java new file mode 100644 index 000000000000..da3842853080 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricUnit.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricUnit. */ +public final class MetricUnit extends ExpandableStringEnum { + /** Static value Bytes for MetricUnit. */ + public static final MetricUnit BYTES = fromString("Bytes"); + + /** Static value Count for MetricUnit. */ + public static final MetricUnit COUNT = fromString("Count"); + + /** Static value Milliseconds for MetricUnit. */ + public static final MetricUnit MILLISECONDS = fromString("Milliseconds"); + + /** + * Creates or finds a MetricUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricUnit. + */ + @JsonCreator + public static MetricUnit fromString(String name) { + return fromString(name, MetricUnit.class); + } + + /** @return known MetricUnit values. */ + public static Collection values() { + return values(MetricUnit.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mp4Format.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mp4Format.java new file mode 100644 index 000000000000..a3dca339d12d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mp4Format.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** 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") +@JsonFlatten +@Immutable +public class Mp4Format extends MultiBitrateFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Mp4Format.class); + + /** {@inheritDoc} */ + @Override + public Mp4Format withOutputFiles(List outputFiles) { + super.withOutputFiles(outputFiles); + return this; + } + + /** {@inheritDoc} */ + @Override + public Mp4Format withFilenamePattern(String filenamePattern) { + super.withFilenamePattern(filenamePattern); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MultiBitrateFormat.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MultiBitrateFormat.java new file mode 100644 index 000000000000..3c4adb7e0ec8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MultiBitrateFormat.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * 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", + defaultImpl = MultiBitrateFormat.class) +@JsonTypeName("#Microsoft.Media.MultiBitrateFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Mp4Format", value = Mp4Format.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.TransportStreamFormat", value = TransportStreamFormat.class) +}) +@JsonFlatten +@Fluent +public class MultiBitrateFormat extends Format { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MultiBitrateFormat.class); + + /* + * 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 outputFiles property: 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 outputFiles property: 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; + } + + /** {@inheritDoc} */ + @Override + public MultiBitrateFormat withFilenamePattern(String filenamePattern) { + super.withFilenamePattern(filenamePattern); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (outputFiles() != null) { + outputFiles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/NoEncryption.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/NoEncryption.java new file mode 100644 index 000000000000..b3f3f38118b6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/NoEncryption.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class for NoEncryption scheme. */ +@Fluent +public final class NoEncryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NoEncryption.class); + + /* + * Representing supported protocols + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Get the enabledProtocols property: Representing supported protocols. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the enabledProtocols property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (enabledProtocols() != null) { + enabledProtocols().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OnErrorType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OnErrorType.java new file mode 100644 index 000000000000..7266b24c776f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OnErrorType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OnErrorType. */ +public final class OnErrorType extends ExpandableStringEnum { + /** Static value StopProcessingJob for OnErrorType. */ + public static final OnErrorType STOP_PROCESSING_JOB = fromString("StopProcessingJob"); + + /** Static value ContinueJob for OnErrorType. */ + public static final OnErrorType CONTINUE_JOB = fromString("ContinueJob"); + + /** + * Creates or finds a OnErrorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OnErrorType. + */ + @JsonCreator + public static OnErrorType fromString(String name) { + return fromString(name, OnErrorType.class); + } + + /** @return known OnErrorType values. */ + public static Collection values() { + return values(OnErrorType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operation.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operation.java new file mode 100644 index 000000000000..b20a45c80d71 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The operation name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The operation display name. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Operation properties format. + * + * @return the properties value. + */ + Properties properties(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OperationCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OperationCollection.java new file mode 100644 index 000000000000..7ea8f7faf1c1 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OperationCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of Operation items. */ +@Fluent +public final class OperationCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationCollection.class); + + /* + * A collection of Operation items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of Operation items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of Operation items. + * + * @param value the value value to set. + * @return the OperationCollection object itself. + */ + public OperationCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the OperationCollection object itself. + */ + public OperationCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OperationDisplay.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OperationDisplay.java new file mode 100644 index 000000000000..4ece9533b80d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation details. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * 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 provider property: The service provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: 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 the resource property: Resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: 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 property: The operation type. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: 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 description property: The operation description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operations.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operations.java new file mode 100644 index 000000000000..6d5bed174aa4 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all the Media Services operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + PagedIterable list(); + + /** + * Lists all the Media Services operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Operation items. + */ + PagedIterable list(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OutputFile.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OutputFile.java new file mode 100644 index 000000000000..49630edc3f3f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/OutputFile.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents an output file produced. */ +@Fluent +public final class OutputFile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OutputFile.class); + + /* + * 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", required = true) + private List labels; + + /** + * Get the labels property: 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 labels property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (labels() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property labels in model OutputFile")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Overlay.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Overlay.java new file mode 100644 index 000000000000..9f848cbd70fa --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Overlay.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; + +/** Base type for all overlays - image, audio or video. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = Overlay.class) +@JsonTypeName("Overlay") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.AudioOverlay", value = AudioOverlay.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoOverlay", value = VideoOverlay.class) +}) +@JsonFlatten +@Fluent +public class Overlay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Overlay.class); + + /* + * 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", required = true) + 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 into the input video. If not + * specified the overlay starts from the beginning of the input video. + */ + @JsonProperty(value = "start") + private Duration start; + + /* + * The end position, with reference to the input video, at which the + * overlay ends. The value should be in ISO 8601 format. For example, PT30S + * to end the overlay at 30 seconds into the input video. If not specified + * or the value is greater than the input video duration, the overlay will + * be applied until the end of the input video if the overlay media + * duration is greater than the input video duration, else the overlay will + * last as long as the overlay media duration. + */ + @JsonProperty(value = "end") + private Duration 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 Duration 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 Duration 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 inputLabel property: 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 inputLabel property: 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 property: 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 into the input video. If + * not specified the overlay starts from the beginning of the input video. + * + * @return the start value. + */ + public Duration start() { + return this.start; + } + + /** + * Set the start property: 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 into 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(Duration start) { + this.start = start; + return this; + } + + /** + * Get the end property: The end position, with reference to the input video, at which the overlay ends. The value + * should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into the input video. If not + * specified or the value is greater than the input video duration, the overlay will be applied until the end of the + * input video if the overlay media duration is greater than the input video duration, else the overlay will last as + * long as the overlay media duration. + * + * @return the end value. + */ + public Duration end() { + return this.end; + } + + /** + * Set the end property: The end position, with reference to the input video, at which the overlay ends. The value + * should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into the input video. If not + * specified or the value is greater than the input video duration, the overlay will be applied until the end of the + * input video if the overlay media duration is greater than the input video duration, else the overlay will last as + * long as the overlay media duration. + * + * @param end the end value to set. + * @return the Overlay object itself. + */ + public Overlay withEnd(Duration end) { + this.end = end; + return this; + } + + /** + * Get the fadeInDuration property: 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 Duration fadeInDuration() { + return this.fadeInDuration; + } + + /** + * Set the fadeInDuration property: 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(Duration fadeInDuration) { + this.fadeInDuration = fadeInDuration; + return this; + } + + /** + * Get the fadeOutDuration property: 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 Duration fadeOutDuration() { + return this.fadeOutDuration; + } + + /** + * Set the fadeOutDuration property: 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(Duration fadeOutDuration) { + this.fadeOutDuration = fadeOutDuration; + return this; + } + + /** + * Get the audioGainLevel property: 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 audioGainLevel property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inputLabel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property inputLabel in model Overlay")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngFormat.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngFormat.java new file mode 100644 index 000000000000..ee2b945d38c8 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngFormat.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class PngFormat extends Format { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PngFormat.class); + + /** {@inheritDoc} */ + @Override + public PngFormat withFilenamePattern(String filenamePattern) { + super.withFilenamePattern(filenamePattern); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngImage.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngImage.java new file mode 100644 index 000000000000..0f72fe74353c --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngImage.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; +import java.util.List; + +/** 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") +@JsonFlatten +@Fluent +public class PngImage extends Image { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PngImage.class); + + /* + * A collection of output PNG image layers to be produced by the encoder. + */ + @JsonProperty(value = "layers") + private List layers; + + /** + * Get the layers property: A collection of output PNG image layers to be produced by the encoder. + * + * @return the layers value. + */ + public List layers() { + return this.layers; + } + + /** + * Set the layers property: 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; + } + + /** {@inheritDoc} */ + @Override + public PngImage withStart(String start) { + super.withStart(start); + return this; + } + + /** {@inheritDoc} */ + @Override + public PngImage withStep(String step) { + super.withStep(step); + return this; + } + + /** {@inheritDoc} */ + @Override + public PngImage withRange(String range) { + super.withRange(range); + return this; + } + + /** {@inheritDoc} */ + @Override + public PngImage withKeyFrameInterval(Duration keyFrameInterval) { + super.withKeyFrameInterval(keyFrameInterval); + return this; + } + + /** {@inheritDoc} */ + @Override + public PngImage withStretchMode(StretchMode stretchMode) { + super.withStretchMode(stretchMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public PngImage withSyncMode(VideoSyncMode syncMode) { + super.withSyncMode(syncMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public PngImage withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (layers() != null) { + layers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngLayer.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngLayer.java new file mode 100644 index 000000000000..1e048b64f6f9 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngLayer.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") +@JsonFlatten +@Immutable +public class PngLayer extends Layer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PngLayer.class); + + /** {@inheritDoc} */ + @Override + public PngLayer withWidth(String width) { + super.withWidth(width); + return this; + } + + /** {@inheritDoc} */ + @Override + public PngLayer withHeight(String height) { + super.withHeight(height); + return this; + } + + /** {@inheritDoc} */ + @Override + public PngLayer withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PresentationTimeRange.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PresentationTimeRange.java new file mode 100644 index 000000000000..7499735fb00e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PresentationTimeRange.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The presentation time range, this is asset related and not recommended for Account Filter. */ +@Fluent +public final class PresentationTimeRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PresentationTimeRange.class); + + /* + * The absolute start time boundary. + */ + @JsonProperty(value = "startTimestamp") + private Long startTimestamp; + + /* + * The absolute end time boundary. + */ + @JsonProperty(value = "endTimestamp") + private Long endTimestamp; + + /* + * The relative to end sliding window. + */ + @JsonProperty(value = "presentationWindowDuration") + private Long presentationWindowDuration; + + /* + * The relative to end right edge. + */ + @JsonProperty(value = "liveBackoffDuration") + private Long liveBackoffDuration; + + /* + * The time scale of time stamps. + */ + @JsonProperty(value = "timescale") + private Long timescale; + + /* + * The indicator of forcing existing of end time stamp. + */ + @JsonProperty(value = "forceEndTimestamp") + private Boolean forceEndTimestamp; + + /** + * Get the startTimestamp property: The absolute start time boundary. + * + * @return the startTimestamp value. + */ + public Long startTimestamp() { + return this.startTimestamp; + } + + /** + * Set the startTimestamp property: 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 endTimestamp property: The absolute end time boundary. + * + * @return the endTimestamp value. + */ + public Long endTimestamp() { + return this.endTimestamp; + } + + /** + * Set the endTimestamp property: 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 presentationWindowDuration property: The relative to end sliding window. + * + * @return the presentationWindowDuration value. + */ + public Long presentationWindowDuration() { + return this.presentationWindowDuration; + } + + /** + * Set the presentationWindowDuration property: 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 liveBackoffDuration property: The relative to end right edge. + * + * @return the liveBackoffDuration value. + */ + public Long liveBackoffDuration() { + return this.liveBackoffDuration; + } + + /** + * Set the liveBackoffDuration property: 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 timescale property: The time scale of time stamps. + * + * @return the timescale value. + */ + public Long timescale() { + return this.timescale; + } + + /** + * Set the timescale property: 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 forceEndTimestamp property: The indicator of forcing existing of end time stamp. + * + * @return the forceEndTimestamp value. + */ + public Boolean forceEndTimestamp() { + return this.forceEndTimestamp; + } + + /** + * Set the forceEndTimestamp property: The indicator of forcing existing 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Preset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Preset.java new file mode 100644 index 000000000000..7c4707e41542 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Preset.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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", + defaultImpl = Preset.class) +@JsonTypeName("Preset") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.FaceDetectorPreset", value = FaceDetectorPreset.class), + @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) +}) +@JsonFlatten +@Immutable +public class Preset { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Preset.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Priority.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Priority.java new file mode 100644 index 000000000000..7536e7bf050f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Priority.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Priority. */ +public final class Priority extends ExpandableStringEnum { + /** Static value Low for Priority. */ + public static final Priority LOW = fromString("Low"); + + /** Static value Normal for Priority. */ + public static final Priority NORMAL = fromString("Normal"); + + /** Static value High for Priority. */ + public static final Priority HIGH = fromString("High"); + + /** + * Creates or finds a Priority from its string representation. + * + * @param name a name to look for. + * @return the corresponding Priority. + */ + @JsonCreator + public static Priority fromString(String name) { + return fromString(name, Priority.class); + } + + /** @return known Priority values. */ + public static Collection values() { + return values(Priority.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpoint.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpoint.java new file mode 100644 index 000000000000..cbf10d09fc6f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * The ARM identifier for Private Endpoint + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..4fc3c76f728f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnection.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @return the next definition stage. + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnectionListResult.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..1b5a9a9d5a34 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateEndpointConnectionListResult. */ +public interface PrivateEndpointConnectionListResult { + /** + * Gets the value property: Array of private endpoint connections. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionListResultInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionListResultInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnectionProvisioningState.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..795aea75546a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionProvisioningState. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** @return known PrivateEndpointConnectionProvisioningState values. */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnections.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..174357d96d13 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointConnections.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * Get all private endpoint connections. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections. + */ + PrivateEndpointConnectionListResult list(String resourceGroupName, String accountName); + + /** + * Get all private endpoint connections. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoint connections. + */ + Response listWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Get private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + PrivateEndpointConnection get(String resourceGroupName, String accountName, String name); + + /** + * Get private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String name, Context context); + + /** + * Delete private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String name); + + /** + * Delete private endpoint connection. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String name, Context context); + + /** + * Get private endpoint connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + PrivateEndpointConnection getById(String id); + + /** + * Get private endpoint connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete private endpoint connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete private endpoint connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointServiceConnectionStatus.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 000000000000..2afe21ab2688 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointServiceConnectionStatus. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** @return known PrivateEndpointServiceConnectionStatus values. */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkResource.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkResource.java new file mode 100644 index 000000000000..ccb4afaf1d70 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkResource.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkResourceListResult.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..1fc4c3fdb1a6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkResourceListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourceListResult. */ +public interface PrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceListResultInner object. + * + * @return the inner object. + */ + PrivateLinkResourceListResultInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkResources.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkResources.java new file mode 100644 index 000000000000..0abb32506b85 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkResources.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * Get list of group IDs. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of group IDs. + */ + PrivateLinkResourceListResult list(String resourceGroupName, String accountName); + + /** + * Get list of group IDs. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of group IDs. + */ + Response listWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Get group ID. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return group ID. + */ + PrivateLinkResource get(String resourceGroupName, String accountName, String name); + + /** + * Get group ID. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param name The name parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return group ID. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String name, Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkServiceConnectionState.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..30a4064f164b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Properties.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Properties.java new file mode 100644 index 000000000000..75e8e5fb4ff5 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Properties.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The service specification property. */ +@Immutable +public final class Properties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Properties.class); + + /* + * The service specifications. + */ + @JsonProperty(value = "serviceSpecification", access = JsonProperty.Access.WRITE_ONLY) + private ServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: The service specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Rectangle.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Rectangle.java new file mode 100644 index 000000000000..743e7b73b8d6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Rectangle.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a rectangular window applied to the input media before processing it. */ +@Fluent +public final class Rectangle { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Rectangle.class); + + /* + * 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 left property: 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 left property: 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 top property: 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 top property: 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 property: 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 property: 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 property: 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 property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Rotation.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Rotation.java new file mode 100644 index 000000000000..62e8df145404 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Rotation.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Rotation. */ +public final class Rotation extends ExpandableStringEnum { + /** Static value Auto for Rotation. */ + public static final Rotation AUTO = fromString("Auto"); + + /** Static value None for Rotation. */ + public static final Rotation NONE = fromString("None"); + + /** Static value Rotate0 for Rotation. */ + public static final Rotation ROTATE0 = fromString("Rotate0"); + + /** Static value Rotate90 for Rotation. */ + public static final Rotation ROTATE90 = fromString("Rotate90"); + + /** Static value Rotate180 for Rotation. */ + public static final Rotation ROTATE180 = fromString("Rotate180"); + + /** Static value Rotate270 for Rotation. */ + public static final Rotation ROTATE270 = fromString("Rotate270"); + + /** + * Creates or finds a Rotation from its string representation. + * + * @param name a name to look for. + * @return the corresponding Rotation. + */ + @JsonCreator + public static Rotation fromString(String name) { + return fromString(name, Rotation.class); + } + + /** @return known Rotation values. */ + public static Collection values() { + return values(Rotation.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ServiceSpecification.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ServiceSpecification.java new file mode 100644 index 000000000000..d65afe2e009f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ServiceSpecification.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The service metric specifications. */ +@Immutable +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * List of log specifications. + */ + @JsonProperty(value = "logSpecifications", access = JsonProperty.Access.WRITE_ONLY) + private List logSpecifications; + + /* + * List of metric specifications. + */ + @JsonProperty(value = "metricSpecifications", access = JsonProperty.Access.WRITE_ONLY) + private List metricSpecifications; + + /** + * Get the logSpecifications property: List of log specifications. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Get the metricSpecifications property: List of metric specifications. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StandardEncoderPreset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StandardEncoderPreset.java new file mode 100644 index 000000000000..c27b028349e0 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StandardEncoderPreset.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** 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") +@JsonFlatten +@Fluent +public class StandardEncoderPreset extends Preset { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StandardEncoderPreset.class); + + /* + * 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", required = true) + private List codecs; + + /* + * The list of outputs to be produced by the encoder. + */ + @JsonProperty(value = "formats", required = true) + private List formats; + + /** + * Get the filters property: 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 the filters property: 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 codecs property: The list of codecs to be used when encoding the input video. + * + * @return the codecs value. + */ + public List codecs() { + return this.codecs; + } + + /** + * Set the codecs property: 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 formats property: The list of outputs to be produced by the encoder. + * + * @return the formats value. + */ + public List formats() { + return this.formats; + } + + /** + * Set the formats property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (filters() != null) { + filters().validate(); + } + if (codecs() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property codecs in model StandardEncoderPreset")); + } else { + codecs().forEach(e -> e.validate()); + } + if (formats() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property formats in model StandardEncoderPreset")); + } else { + formats().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageAccount.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageAccount.java new file mode 100644 index 000000000000..00c20e130db5 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageAccount.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The storage account details. */ +@Fluent +public final class StorageAccount { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccount.class); + + /* + * 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. + */ + @JsonProperty(value = "type", required = true) + private StorageAccountType type; + + /** + * Get the id property: 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 property: 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 property: The type of the storage account. + * + * @return the type value. + */ + public StorageAccountType type() { + return this.type; + } + + /** + * Set the type property: The type of the storage account. + * + * @param type the type value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withType(StorageAccountType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model StorageAccount")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageAccountType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageAccountType.java new file mode 100644 index 000000000000..a2c0a3b921f1 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageAccountType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageAccountType. */ +public final class StorageAccountType extends ExpandableStringEnum { + /** Static value Primary for StorageAccountType. */ + public static final StorageAccountType PRIMARY = fromString("Primary"); + + /** Static value Secondary for StorageAccountType. */ + public static final StorageAccountType SECONDARY = fromString("Secondary"); + + /** + * Creates or finds a StorageAccountType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageAccountType. + */ + @JsonCreator + public static StorageAccountType fromString(String name) { + return fromString(name, StorageAccountType.class); + } + + /** @return known StorageAccountType values. */ + public static Collection values() { + return values(StorageAccountType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageAuthentication.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageAuthentication.java new file mode 100644 index 000000000000..a21171c43416 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageAuthentication.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageAuthentication. */ +public final class StorageAuthentication extends ExpandableStringEnum { + /** Static value System for StorageAuthentication. */ + public static final StorageAuthentication SYSTEM = fromString("System"); + + /** Static value ManagedIdentity for StorageAuthentication. */ + public static final StorageAuthentication MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** + * Creates or finds a StorageAuthentication from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageAuthentication. + */ + @JsonCreator + public static StorageAuthentication fromString(String name) { + return fromString(name, StorageAuthentication.class); + } + + /** @return known StorageAuthentication values. */ + public static Collection values() { + return values(StorageAuthentication.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageEncryptedAssetDecryptionData.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageEncryptedAssetDecryptionData.java new file mode 100644 index 000000000000..916b66321751 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StorageEncryptedAssetDecryptionData.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.resourcemanager.mediaservices.fluent.models.StorageEncryptedAssetDecryptionDataInner; +import java.util.List; + +/** An immutable client-side representation of StorageEncryptedAssetDecryptionData. */ +public interface StorageEncryptedAssetDecryptionData { + /** + * Gets the key property: The Asset File storage encryption key. + * + * @return the key value. + */ + byte[] key(); + + /** + * Gets the assetFileEncryptionMetadata property: Asset File encryption metadata. + * + * @return the assetFileEncryptionMetadata value. + */ + List assetFileEncryptionMetadata(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.StorageEncryptedAssetDecryptionDataInner + * object. + * + * @return the inner object. + */ + StorageEncryptedAssetDecryptionDataInner innerModel(); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamOptionsFlag.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamOptionsFlag.java new file mode 100644 index 000000000000..f725445bca5d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamOptionsFlag.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StreamOptionsFlag. */ +public final class StreamOptionsFlag extends ExpandableStringEnum { + /** Static value Default for StreamOptionsFlag. */ + public static final StreamOptionsFlag DEFAULT = fromString("Default"); + + /** Static value LowLatency for StreamOptionsFlag. */ + public static final StreamOptionsFlag LOW_LATENCY = fromString("LowLatency"); + + /** + * Creates or finds a StreamOptionsFlag from its string representation. + * + * @param name a name to look for. + * @return the corresponding StreamOptionsFlag. + */ + @JsonCreator + public static StreamOptionsFlag fromString(String name) { + return fromString(name, StreamOptionsFlag.class); + } + + /** @return known StreamOptionsFlag values. */ + public static Collection values() { + return values(StreamOptionsFlag.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoint.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoint.java new file mode 100644 index 000000000000..cc7f480522a7 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoint.java @@ -0,0 +1,545 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of StreamingEndpoint. */ +public interface StreamingEndpoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the description property: The streaming endpoint description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the scaleUnits property: The number of scale units. Use the Scale operation to adjust this value. + * + * @return the scaleUnits value. + */ + Integer scaleUnits(); + + /** + * Gets the availabilitySetName property: This feature is deprecated, do not set a value for this property. + * + * @return the availabilitySetName value. + */ + String availabilitySetName(); + + /** + * Gets the accessControl property: The access control definition of the streaming endpoint. + * + * @return the accessControl value. + */ + StreamingEndpointAccessControl accessControl(); + + /** + * Gets the maxCacheAge property: Max cache age. + * + * @return the maxCacheAge value. + */ + Long maxCacheAge(); + + /** + * Gets the customHostNames property: The custom host names of the streaming endpoint. + * + * @return the customHostNames value. + */ + List customHostNames(); + + /** + * Gets the hostname property: The streaming endpoint host name. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the cdnEnabled property: The CDN enabled flag. + * + * @return the cdnEnabled value. + */ + Boolean cdnEnabled(); + + /** + * Gets the cdnProvider property: The CDN provider name. + * + * @return the cdnProvider value. + */ + String cdnProvider(); + + /** + * Gets the cdnProfile property: The CDN profile name. + * + * @return the cdnProfile value. + */ + String cdnProfile(); + + /** + * Gets the provisioningState property: The provisioning state of the streaming endpoint. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the resourceState property: The resource state of the streaming endpoint. + * + * @return the resourceState value. + */ + StreamingEndpointResourceState resourceState(); + + /** + * Gets the crossSiteAccessPolicies property: The streaming endpoint access policies. + * + * @return the crossSiteAccessPolicies value. + */ + CrossSiteAccessPolicies crossSiteAccessPolicies(); + + /** + * Gets the freeTrialEndTime property: The free trial expiration time. + * + * @return the freeTrialEndTime value. + */ + OffsetDateTime freeTrialEndTime(); + + /** + * Gets the created property: The exact time the streaming endpoint was created. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the lastModified property: The exact time the streaming endpoint was last modified. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner object. + * + * @return the inner object. + */ + StreamingEndpointInner innerModel(); + + /** The entirety of the StreamingEndpoint definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The StreamingEndpoint definition stages. */ + interface DefinitionStages { + /** The first stage of the StreamingEndpoint definition. */ + interface Blank extends WithLocation { + } + /** The stage of the StreamingEndpoint definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the StreamingEndpoint definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @return the next definition stage. + */ + WithCreate withExistingMediaservice(String resourceGroupName, String accountName); + } + /** + * The stage of the StreamingEndpoint definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithDescription, + DefinitionStages.WithScaleUnits, + DefinitionStages.WithAvailabilitySetName, + DefinitionStages.WithAccessControl, + DefinitionStages.WithMaxCacheAge, + DefinitionStages.WithCustomHostNames, + DefinitionStages.WithCdnEnabled, + DefinitionStages.WithCdnProvider, + DefinitionStages.WithCdnProfile, + DefinitionStages.WithCrossSiteAccessPolicies, + DefinitionStages.WithAutoStart { + /** + * Executes the create request. + * + * @return the created resource. + */ + StreamingEndpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StreamingEndpoint create(Context context); + } + /** The stage of the StreamingEndpoint definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the StreamingEndpoint definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The streaming endpoint description.. + * + * @param description The streaming endpoint description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the StreamingEndpoint definition allowing to specify scaleUnits. */ + interface WithScaleUnits { + /** + * Specifies the scaleUnits property: The number of scale units. Use the Scale operation to adjust this + * value.. + * + * @param scaleUnits The number of scale units. Use the Scale operation to adjust this value. + * @return the next definition stage. + */ + WithCreate withScaleUnits(Integer scaleUnits); + } + /** The stage of the StreamingEndpoint definition allowing to specify availabilitySetName. */ + interface WithAvailabilitySetName { + /** + * Specifies the availabilitySetName property: This feature is deprecated, do not set a value for this + * property.. + * + * @param availabilitySetName This feature is deprecated, do not set a value for this property. + * @return the next definition stage. + */ + WithCreate withAvailabilitySetName(String availabilitySetName); + } + /** The stage of the StreamingEndpoint definition allowing to specify accessControl. */ + interface WithAccessControl { + /** + * Specifies the accessControl property: The access control definition of the streaming endpoint.. + * + * @param accessControl The access control definition of the streaming endpoint. + * @return the next definition stage. + */ + WithCreate withAccessControl(StreamingEndpointAccessControl accessControl); + } + /** The stage of the StreamingEndpoint definition allowing to specify maxCacheAge. */ + interface WithMaxCacheAge { + /** + * Specifies the maxCacheAge property: Max cache age. + * + * @param maxCacheAge Max cache age. + * @return the next definition stage. + */ + WithCreate withMaxCacheAge(Long maxCacheAge); + } + /** The stage of the StreamingEndpoint definition allowing to specify customHostNames. */ + interface WithCustomHostNames { + /** + * Specifies the customHostNames property: The custom host names of the streaming endpoint. + * + * @param customHostNames The custom host names of the streaming endpoint. + * @return the next definition stage. + */ + WithCreate withCustomHostNames(List customHostNames); + } + /** The stage of the StreamingEndpoint definition allowing to specify cdnEnabled. */ + interface WithCdnEnabled { + /** + * Specifies the cdnEnabled property: The CDN enabled flag.. + * + * @param cdnEnabled The CDN enabled flag. + * @return the next definition stage. + */ + WithCreate withCdnEnabled(Boolean cdnEnabled); + } + /** The stage of the StreamingEndpoint definition allowing to specify cdnProvider. */ + interface WithCdnProvider { + /** + * Specifies the cdnProvider property: The CDN provider name.. + * + * @param cdnProvider The CDN provider name. + * @return the next definition stage. + */ + WithCreate withCdnProvider(String cdnProvider); + } + /** The stage of the StreamingEndpoint definition allowing to specify cdnProfile. */ + interface WithCdnProfile { + /** + * Specifies the cdnProfile property: The CDN profile name.. + * + * @param cdnProfile The CDN profile name. + * @return the next definition stage. + */ + WithCreate withCdnProfile(String cdnProfile); + } + /** The stage of the StreamingEndpoint definition allowing to specify crossSiteAccessPolicies. */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies the crossSiteAccessPolicies property: The streaming endpoint access policies.. + * + * @param crossSiteAccessPolicies The streaming endpoint access policies. + * @return the next definition stage. + */ + WithCreate withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + /** The stage of the StreamingEndpoint definition allowing to specify autoStart. */ + interface WithAutoStart { + /** + * Specifies the autoStart property: The flag indicates if the resource should be automatically started on + * creation.. + * + * @param autoStart The flag indicates if the resource should be automatically started on creation. + * @return the next definition stage. + */ + WithCreate withAutoStart(Boolean autoStart); + } + } + /** + * Begins update for the StreamingEndpoint resource. + * + * @return the stage of resource update. + */ + StreamingEndpoint.Update update(); + + /** The template for StreamingEndpoint update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithDescription, + UpdateStages.WithScaleUnits, + UpdateStages.WithAvailabilitySetName, + UpdateStages.WithAccessControl, + UpdateStages.WithMaxCacheAge, + UpdateStages.WithCustomHostNames, + UpdateStages.WithCdnEnabled, + UpdateStages.WithCdnProvider, + UpdateStages.WithCdnProfile, + UpdateStages.WithCrossSiteAccessPolicies { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StreamingEndpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StreamingEndpoint apply(Context context); + } + /** The StreamingEndpoint update stages. */ + interface UpdateStages { + /** The stage of the StreamingEndpoint update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the StreamingEndpoint update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The streaming endpoint description.. + * + * @param description The streaming endpoint description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the StreamingEndpoint update allowing to specify scaleUnits. */ + interface WithScaleUnits { + /** + * Specifies the scaleUnits property: The number of scale units. Use the Scale operation to adjust this + * value.. + * + * @param scaleUnits The number of scale units. Use the Scale operation to adjust this value. + * @return the next definition stage. + */ + Update withScaleUnits(Integer scaleUnits); + } + /** The stage of the StreamingEndpoint update allowing to specify availabilitySetName. */ + interface WithAvailabilitySetName { + /** + * Specifies the availabilitySetName property: This feature is deprecated, do not set a value for this + * property.. + * + * @param availabilitySetName This feature is deprecated, do not set a value for this property. + * @return the next definition stage. + */ + Update withAvailabilitySetName(String availabilitySetName); + } + /** The stage of the StreamingEndpoint update allowing to specify accessControl. */ + interface WithAccessControl { + /** + * Specifies the accessControl property: The access control definition of the streaming endpoint.. + * + * @param accessControl The access control definition of the streaming endpoint. + * @return the next definition stage. + */ + Update withAccessControl(StreamingEndpointAccessControl accessControl); + } + /** The stage of the StreamingEndpoint update allowing to specify maxCacheAge. */ + interface WithMaxCacheAge { + /** + * Specifies the maxCacheAge property: Max cache age. + * + * @param maxCacheAge Max cache age. + * @return the next definition stage. + */ + Update withMaxCacheAge(Long maxCacheAge); + } + /** The stage of the StreamingEndpoint update allowing to specify customHostNames. */ + interface WithCustomHostNames { + /** + * Specifies the customHostNames property: The custom host names of the streaming endpoint. + * + * @param customHostNames The custom host names of the streaming endpoint. + * @return the next definition stage. + */ + Update withCustomHostNames(List customHostNames); + } + /** The stage of the StreamingEndpoint update allowing to specify cdnEnabled. */ + interface WithCdnEnabled { + /** + * Specifies the cdnEnabled property: The CDN enabled flag.. + * + * @param cdnEnabled The CDN enabled flag. + * @return the next definition stage. + */ + Update withCdnEnabled(Boolean cdnEnabled); + } + /** The stage of the StreamingEndpoint update allowing to specify cdnProvider. */ + interface WithCdnProvider { + /** + * Specifies the cdnProvider property: The CDN provider name.. + * + * @param cdnProvider The CDN provider name. + * @return the next definition stage. + */ + Update withCdnProvider(String cdnProvider); + } + /** The stage of the StreamingEndpoint update allowing to specify cdnProfile. */ + interface WithCdnProfile { + /** + * Specifies the cdnProfile property: The CDN profile name.. + * + * @param cdnProfile The CDN profile name. + * @return the next definition stage. + */ + Update withCdnProfile(String cdnProfile); + } + /** The stage of the StreamingEndpoint update allowing to specify crossSiteAccessPolicies. */ + interface WithCrossSiteAccessPolicies { + /** + * Specifies the crossSiteAccessPolicies property: The streaming endpoint access policies.. + * + * @param crossSiteAccessPolicies The streaming endpoint access policies. + * @return the next definition stage. + */ + Update withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StreamingEndpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StreamingEndpoint refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpointAccessControl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpointAccessControl.java new file mode 100644 index 000000000000..578983cb050a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpointAccessControl.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Streaming endpoint access control definition. */ +@Fluent +public final class StreamingEndpointAccessControl { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingEndpointAccessControl.class); + + /* + * The access control of Akamai + */ + @JsonProperty(value = "akamai") + private AkamaiAccessControl akamai; + + /* + * The IP access control of the streaming endpoint. + */ + @JsonProperty(value = "ip") + private IpAccessControl ip; + + /** + * Get the akamai property: The access control of Akamai. + * + * @return the akamai value. + */ + public AkamaiAccessControl akamai() { + return this.akamai; + } + + /** + * Set the akamai property: 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 property: The IP access control of the streaming endpoint. + * + * @return the ip value. + */ + public IpAccessControl ip() { + return this.ip; + } + + /** + * Set the ip property: The IP access control of the streaming endpoint. + * + * @param ip the ip value to set. + * @return the StreamingEndpointAccessControl object itself. + */ + public StreamingEndpointAccessControl withIp(IpAccessControl ip) { + this.ip = ip; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (akamai() != null) { + akamai().validate(); + } + if (ip() != null) { + ip().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpointListResult.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpointListResult.java new file mode 100644 index 000000000000..8497ce2008df --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpointListResult.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The streaming endpoint list result. */ +@Fluent +public final class StreamingEndpointListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingEndpointListResult.class); + + /* + * The result of the List StreamingEndpoint operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The number of result. + */ + @JsonProperty(value = "@odata.count") + private Integer odataCount; + + /* + * The link to the next set of results. Not empty if value contains + * incomplete list of streaming endpoints. + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: The result of the List StreamingEndpoint operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The result of the List StreamingEndpoint operation. + * + * @param value the value value to set. + * @return the StreamingEndpointListResult object itself. + */ + public StreamingEndpointListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataCount property: The number of result. + * + * @return the odataCount value. + */ + public Integer odataCount() { + return this.odataCount; + } + + /** + * Set the odataCount property: The number of result. + * + * @param odataCount the odataCount value to set. + * @return the StreamingEndpointListResult object itself. + */ + public StreamingEndpointListResult withOdataCount(Integer odataCount) { + this.odataCount = odataCount; + return this; + } + + /** + * Get the odataNextLink property: The link to the next set of results. Not empty if value contains incomplete list + * of streaming endpoints. + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: The link to the next set of results. Not empty if value contains incomplete list + * of streaming endpoints. + * + * @param odataNextLink the odataNextLink value to set. + * @return the StreamingEndpointListResult object itself. + */ + public StreamingEndpointListResult withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpointResourceState.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpointResourceState.java new file mode 100644 index 000000000000..cc2776e0f787 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpointResourceState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StreamingEndpointResourceState. */ +public final class StreamingEndpointResourceState extends ExpandableStringEnum { + /** Static value Stopped for StreamingEndpointResourceState. */ + public static final StreamingEndpointResourceState STOPPED = fromString("Stopped"); + + /** Static value Starting for StreamingEndpointResourceState. */ + public static final StreamingEndpointResourceState STARTING = fromString("Starting"); + + /** Static value Running for StreamingEndpointResourceState. */ + public static final StreamingEndpointResourceState RUNNING = fromString("Running"); + + /** Static value Stopping for StreamingEndpointResourceState. */ + public static final StreamingEndpointResourceState STOPPING = fromString("Stopping"); + + /** Static value Deleting for StreamingEndpointResourceState. */ + public static final StreamingEndpointResourceState DELETING = fromString("Deleting"); + + /** Static value Scaling for StreamingEndpointResourceState. */ + public static final StreamingEndpointResourceState SCALING = fromString("Scaling"); + + /** + * Creates or finds a StreamingEndpointResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding StreamingEndpointResourceState. + */ + @JsonCreator + public static StreamingEndpointResourceState fromString(String name) { + return fromString(name, StreamingEndpointResourceState.class); + } + + /** @return known StreamingEndpointResourceState values. */ + public static Collection values() { + return values(StreamingEndpointResourceState.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoints.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoints.java new file mode 100644 index 000000000000..a6054df63932 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoints.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of StreamingEndpoints. */ +public interface StreamingEndpoints { + /** + * Lists the streaming endpoints 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists the streaming endpoints in the account. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the streaming endpoint list result. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + StreamingEndpoint get(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Gets a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Deletes a streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Starts an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String accountName, String streamingEndpointName); + + /** + * Stops an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String accountName, String streamingEndpointName, Context context); + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void scale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters); + + /** + * Scales an existing streaming endpoint. + * + * @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 streaming endpoint, maximum length is 24. + * @param parameters scale units definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void scale( + String resourceGroupName, + String accountName, + String streamingEndpointName, + StreamingEntityScaleUnit parameters, + Context context); + + /** + * Gets a streaming endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + StreamingEndpoint getById(String id); + + /** + * Gets a streaming endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a streaming endpoint. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a streaming endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a streaming endpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StreamingEndpoint resource. + * + * @param name resource name. + * @return the first stage of the new StreamingEndpoint definition. + */ + StreamingEndpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEntityScaleUnit.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEntityScaleUnit.java new file mode 100644 index 000000000000..2a0cbd669f81 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEntityScaleUnit.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** scale units definition. */ +@Fluent +public final class StreamingEntityScaleUnit { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingEntityScaleUnit.class); + + /* + * The scale unit number of the streaming endpoint. + */ + @JsonProperty(value = "scaleUnit") + private Integer scaleUnit; + + /** + * Get the scaleUnit property: The scale unit number of the streaming endpoint. + * + * @return the scaleUnit value. + */ + public Integer scaleUnit() { + return this.scaleUnit; + } + + /** + * Set the scaleUnit property: The scale unit number of the streaming endpoint. + * + * @param scaleUnit the scaleUnit value to set. + * @return the StreamingEntityScaleUnit object itself. + */ + public StreamingEntityScaleUnit withScaleUnit(Integer scaleUnit) { + this.scaleUnit = scaleUnit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocator.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocator.java new file mode 100644 index 000000000000..cea70f300a22 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocator.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingLocatorInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** An immutable client-side representation of StreamingLocator. */ +public interface StreamingLocator { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the assetName property: Asset Name. + * + * @return the assetName value. + */ + String assetName(); + + /** + * Gets the created property: The creation time of the Streaming Locator. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the startTime property: The start time of the Streaming Locator. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the Streaming Locator. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the streamingLocatorId property: The StreamingLocatorId of the Streaming Locator. + * + * @return the streamingLocatorId value. + */ + UUID streamingLocatorId(); + + /** + * Gets the streamingPolicyName property: 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. + */ + String streamingPolicyName(); + + /** + * Gets the defaultContentKeyPolicyName property: Name of the default ContentKeyPolicy used by this Streaming + * Locator. + * + * @return the defaultContentKeyPolicyName value. + */ + String defaultContentKeyPolicyName(); + + /** + * Gets the contentKeys property: The ContentKeys used by this Streaming Locator. + * + * @return the contentKeys value. + */ + List contentKeys(); + + /** + * Gets the alternativeMediaId property: Alternative Media ID of this Streaming Locator. + * + * @return the alternativeMediaId value. + */ + String alternativeMediaId(); + + /** + * Gets the filters property: A list of asset or account filters which apply to this streaming locator. + * + * @return the filters value. + */ + List filters(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.StreamingLocatorInner object. + * + * @return the inner object. + */ + StreamingLocatorInner innerModel(); + + /** The entirety of the StreamingLocator definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The StreamingLocator definition stages. */ + interface DefinitionStages { + /** The first stage of the StreamingLocator definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the StreamingLocator definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @return the next definition stage. + */ + WithCreate withExistingMediaService(String resourceGroupName, String accountName); + } + /** + * The stage of the StreamingLocator definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithAssetName, + DefinitionStages.WithStartTime, + DefinitionStages.WithEndTime, + DefinitionStages.WithStreamingLocatorId, + DefinitionStages.WithStreamingPolicyName, + DefinitionStages.WithDefaultContentKeyPolicyName, + DefinitionStages.WithContentKeys, + DefinitionStages.WithAlternativeMediaId, + DefinitionStages.WithFilters { + /** + * Executes the create request. + * + * @return the created resource. + */ + StreamingLocator create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StreamingLocator create(Context context); + } + /** The stage of the StreamingLocator definition allowing to specify assetName. */ + interface WithAssetName { + /** + * Specifies the assetName property: Asset Name. + * + * @param assetName Asset Name. + * @return the next definition stage. + */ + WithCreate withAssetName(String assetName); + } + /** The stage of the StreamingLocator definition allowing to specify startTime. */ + interface WithStartTime { + /** + * Specifies the startTime property: The start time of the Streaming Locator.. + * + * @param startTime The start time of the Streaming Locator. + * @return the next definition stage. + */ + WithCreate withStartTime(OffsetDateTime startTime); + } + /** The stage of the StreamingLocator definition allowing to specify endTime. */ + interface WithEndTime { + /** + * Specifies the endTime property: The end time of the Streaming Locator.. + * + * @param endTime The end time of the Streaming Locator. + * @return the next definition stage. + */ + WithCreate withEndTime(OffsetDateTime endTime); + } + /** The stage of the StreamingLocator definition allowing to specify streamingLocatorId. */ + interface WithStreamingLocatorId { + /** + * Specifies the streamingLocatorId property: The StreamingLocatorId of the Streaming Locator.. + * + * @param streamingLocatorId The StreamingLocatorId of the Streaming Locator. + * @return the next definition stage. + */ + WithCreate withStreamingLocatorId(UUID streamingLocatorId); + } + /** The stage of the StreamingLocator definition allowing to specify streamingPolicyName. */ + interface WithStreamingPolicyName { + /** + * Specifies the streamingPolicyName property: 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 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 next definition stage. + */ + WithCreate withStreamingPolicyName(String streamingPolicyName); + } + /** The stage of the StreamingLocator definition allowing to specify defaultContentKeyPolicyName. */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies the defaultContentKeyPolicyName property: Name of the default ContentKeyPolicy used by this + * Streaming Locator.. + * + * @param defaultContentKeyPolicyName Name of the default ContentKeyPolicy used by this Streaming Locator. + * @return the next definition stage. + */ + WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + /** The stage of the StreamingLocator definition allowing to specify contentKeys. */ + interface WithContentKeys { + /** + * Specifies the contentKeys property: The ContentKeys used by this Streaming Locator.. + * + * @param contentKeys The ContentKeys used by this Streaming Locator. + * @return the next definition stage. + */ + WithCreate withContentKeys(List contentKeys); + } + /** The stage of the StreamingLocator definition allowing to specify alternativeMediaId. */ + interface WithAlternativeMediaId { + /** + * Specifies the alternativeMediaId property: Alternative Media ID of this Streaming Locator. + * + * @param alternativeMediaId Alternative Media ID of this Streaming Locator. + * @return the next definition stage. + */ + WithCreate withAlternativeMediaId(String alternativeMediaId); + } + /** The stage of the StreamingLocator definition allowing to specify filters. */ + interface WithFilters { + /** + * Specifies the filters property: A list of asset or account filters which apply to this streaming locator. + * + * @param filters A list of asset or account filters which apply to this streaming locator. + * @return the next definition stage. + */ + WithCreate withFilters(List filters); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StreamingLocator refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StreamingLocator refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocatorCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocatorCollection.java new file mode 100644 index 000000000000..5de3ea696eae --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocatorCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingLocatorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of StreamingLocator items. */ +@Fluent +public final class StreamingLocatorCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingLocatorCollection.class); + + /* + * A collection of StreamingLocator items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of StreamingLocator items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of StreamingLocator items. + * + * @param value the value value to set. + * @return the StreamingLocatorCollection object itself. + */ + public StreamingLocatorCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the StreamingLocatorCollection object itself. + */ + public StreamingLocatorCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocatorContentKey.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocatorContentKey.java new file mode 100644 index 000000000000..d39bbcdee867 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocatorContentKey.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** Class for content key in Streaming Locator. */ +@Fluent +public final class StreamingLocatorContentKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingLocatorContentKey.class); + + /* + * ID of Content Key + */ + @JsonProperty(value = "id", required = true) + private UUID id; + + /* + * Encryption type of Content Key + */ + @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 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 the id property: ID of Content Key. + * + * @return the id value. + */ + public UUID id() { + return this.id; + } + + /** + * Set the id property: 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 the type property: Encryption type of Content Key. + * + * @return the type value. + */ + public StreamingLocatorContentKeyType type() { + return this.type; + } + + /** + * Get the labelReferenceInStreamingPolicy property: Label of Content Key as specified in the Streaming Policy. + * + * @return the labelReferenceInStreamingPolicy value. + */ + public String labelReferenceInStreamingPolicy() { + return this.labelReferenceInStreamingPolicy; + } + + /** + * Set the labelReferenceInStreamingPolicy property: 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 the value property: Value of Content Key. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value 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 the policyName property: ContentKeyPolicy used by Content Key. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Get the tracks property: Tracks which use this Content Key. + * + * @return the tracks value. + */ + public List tracks() { + return this.tracks; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model StreamingLocatorContentKey")); + } + if (tracks() != null) { + tracks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocatorContentKeyType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocatorContentKeyType.java new file mode 100644 index 000000000000..ebdc367c40a6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocatorContentKeyType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StreamingLocatorContentKeyType. */ +public final class StreamingLocatorContentKeyType extends ExpandableStringEnum { + /** Static value CommonEncryptionCenc for StreamingLocatorContentKeyType. */ + public static final StreamingLocatorContentKeyType COMMON_ENCRYPTION_CENC = fromString("CommonEncryptionCenc"); + + /** Static value CommonEncryptionCbcs for StreamingLocatorContentKeyType. */ + public static final StreamingLocatorContentKeyType COMMON_ENCRYPTION_CBCS = fromString("CommonEncryptionCbcs"); + + /** Static value EnvelopeEncryption for StreamingLocatorContentKeyType. */ + public static final StreamingLocatorContentKeyType ENVELOPE_ENCRYPTION = fromString("EnvelopeEncryption"); + + /** + * Creates or finds a StreamingLocatorContentKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StreamingLocatorContentKeyType. + */ + @JsonCreator + public static StreamingLocatorContentKeyType fromString(String name) { + return fromString(name, StreamingLocatorContentKeyType.class); + } + + /** @return known StreamingLocatorContentKeyType values. */ + public static Collection values() { + return values(StreamingLocatorContentKeyType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocators.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocators.java new file mode 100644 index 000000000000..f4198d69ff1e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocators.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of StreamingLocators. */ +public interface StreamingLocators { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingLocator items. + */ + PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + StreamingLocator get(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listContentKeys action. + */ + ListContentKeysResponse listContentKeys(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listContentKeys action. + */ + Response listContentKeysWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listPaths action. + */ + ListPathsResponse listPaths(String resourceGroupName, String accountName, String streamingLocatorName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class of response for listPaths action. + */ + Response listPathsWithResponse( + String resourceGroupName, String accountName, String streamingLocatorName, Context context); + + /** + * Get the details of a Streaming Locator in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + StreamingLocator getById(String id); + + /** + * Get the details of a Streaming Locator in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Locator in the Media Services account. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Streaming Locator in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Streaming Locator in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StreamingLocator resource. + * + * @param name resource name. + * @return the first stage of the new StreamingLocator definition. + */ + StreamingLocator.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPath.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPath.java new file mode 100644 index 000000000000..34b38b5cff2c --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPath.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class of paths for streaming. */ +@Fluent +public final class StreamingPath { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingPath.class); + + /* + * Streaming protocol + */ + @JsonProperty(value = "streamingProtocol", required = true) + private StreamingPolicyStreamingProtocol streamingProtocol; + + /* + * Encryption scheme + */ + @JsonProperty(value = "encryptionScheme", required = true) + private EncryptionScheme encryptionScheme; + + /* + * Streaming paths for each protocol and encryptionScheme pair + */ + @JsonProperty(value = "paths") + private List paths; + + /** + * Get the streamingProtocol property: Streaming protocol. + * + * @return the streamingProtocol value. + */ + public StreamingPolicyStreamingProtocol streamingProtocol() { + return this.streamingProtocol; + } + + /** + * Set the streamingProtocol property: Streaming protocol. + * + * @param streamingProtocol the streamingProtocol value to set. + * @return the StreamingPath object itself. + */ + public StreamingPath withStreamingProtocol(StreamingPolicyStreamingProtocol streamingProtocol) { + this.streamingProtocol = streamingProtocol; + return this; + } + + /** + * Get the encryptionScheme property: Encryption scheme. + * + * @return the encryptionScheme value. + */ + public EncryptionScheme encryptionScheme() { + return this.encryptionScheme; + } + + /** + * Set the encryptionScheme property: Encryption scheme. + * + * @param encryptionScheme the encryptionScheme value to set. + * @return the StreamingPath object itself. + */ + public StreamingPath withEncryptionScheme(EncryptionScheme encryptionScheme) { + this.encryptionScheme = encryptionScheme; + return this; + } + + /** + * Get the paths property: Streaming paths for each protocol and encryptionScheme pair. + * + * @return the paths value. + */ + public List paths() { + return this.paths; + } + + /** + * Set the paths property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (streamingProtocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property streamingProtocol in model StreamingPath")); + } + if (encryptionScheme() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property encryptionScheme in model StreamingPath")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicies.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicies.java new file mode 100644 index 000000000000..a33ff6b4b652 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicies.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of StreamingPolicies. */ +public interface StreamingPolicies { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of StreamingPolicy items. + */ + PagedIterable list( + String resourceGroupName, String accountName, String filter, Integer top, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + StreamingPolicy get(String resourceGroupName, String accountName, String streamingPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String streamingPolicyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String streamingPolicyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String streamingPolicyName, Context context); + + /** + * Get the details of a Streaming Policy in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + StreamingPolicy getById(String id); + + /** + * Get the details of a Streaming Policy in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a Streaming Policy in the Media Services account. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Streaming Policy in the Media Services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Streaming Policy in the Media Services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StreamingPolicy resource. + * + * @param name resource name. + * @return the first stage of the new StreamingPolicy definition. + */ + StreamingPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicy.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicy.java new file mode 100644 index 000000000000..abad58fbf4b4 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicy.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of StreamingPolicy. */ +public interface StreamingPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the created property: Creation time of Streaming Policy. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the defaultContentKeyPolicyName property: Default ContentKey used by current Streaming Policy. + * + * @return the defaultContentKeyPolicyName value. + */ + String defaultContentKeyPolicyName(); + + /** + * Gets the envelopeEncryption property: Configuration of EnvelopeEncryption. + * + * @return the envelopeEncryption value. + */ + EnvelopeEncryption envelopeEncryption(); + + /** + * Gets the commonEncryptionCenc property: Configuration of CommonEncryptionCenc. + * + * @return the commonEncryptionCenc value. + */ + CommonEncryptionCenc commonEncryptionCenc(); + + /** + * Gets the commonEncryptionCbcs property: Configuration of CommonEncryptionCbcs. + * + * @return the commonEncryptionCbcs value. + */ + CommonEncryptionCbcs commonEncryptionCbcs(); + + /** + * Gets the noEncryption property: Configurations of NoEncryption. + * + * @return the noEncryption value. + */ + NoEncryption noEncryption(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner object. + * + * @return the inner object. + */ + StreamingPolicyInner innerModel(); + + /** The entirety of the StreamingPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The StreamingPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the StreamingPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the StreamingPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @return the next definition stage. + */ + WithCreate withExistingMediaService(String resourceGroupName, String accountName); + } + /** + * The stage of the StreamingPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDefaultContentKeyPolicyName, + DefinitionStages.WithEnvelopeEncryption, + DefinitionStages.WithCommonEncryptionCenc, + DefinitionStages.WithCommonEncryptionCbcs, + DefinitionStages.WithNoEncryption { + /** + * Executes the create request. + * + * @return the created resource. + */ + StreamingPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StreamingPolicy create(Context context); + } + /** The stage of the StreamingPolicy definition allowing to specify defaultContentKeyPolicyName. */ + interface WithDefaultContentKeyPolicyName { + /** + * Specifies the defaultContentKeyPolicyName property: Default ContentKey used by current Streaming Policy. + * + * @param defaultContentKeyPolicyName Default ContentKey used by current Streaming Policy. + * @return the next definition stage. + */ + WithCreate withDefaultContentKeyPolicyName(String defaultContentKeyPolicyName); + } + /** The stage of the StreamingPolicy definition allowing to specify envelopeEncryption. */ + interface WithEnvelopeEncryption { + /** + * Specifies the envelopeEncryption property: Configuration of EnvelopeEncryption. + * + * @param envelopeEncryption Configuration of EnvelopeEncryption. + * @return the next definition stage. + */ + WithCreate withEnvelopeEncryption(EnvelopeEncryption envelopeEncryption); + } + /** The stage of the StreamingPolicy definition allowing to specify commonEncryptionCenc. */ + interface WithCommonEncryptionCenc { + /** + * Specifies the commonEncryptionCenc property: Configuration of CommonEncryptionCenc. + * + * @param commonEncryptionCenc Configuration of CommonEncryptionCenc. + * @return the next definition stage. + */ + WithCreate withCommonEncryptionCenc(CommonEncryptionCenc commonEncryptionCenc); + } + /** The stage of the StreamingPolicy definition allowing to specify commonEncryptionCbcs. */ + interface WithCommonEncryptionCbcs { + /** + * Specifies the commonEncryptionCbcs property: Configuration of CommonEncryptionCbcs. + * + * @param commonEncryptionCbcs Configuration of CommonEncryptionCbcs. + * @return the next definition stage. + */ + WithCreate withCommonEncryptionCbcs(CommonEncryptionCbcs commonEncryptionCbcs); + } + /** The stage of the StreamingPolicy definition allowing to specify noEncryption. */ + interface WithNoEncryption { + /** + * Specifies the noEncryption property: Configurations of NoEncryption. + * + * @param noEncryption Configurations of NoEncryption. + * @return the next definition stage. + */ + WithCreate withNoEncryption(NoEncryption noEncryption); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StreamingPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StreamingPolicy refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyCollection.java new file mode 100644 index 000000000000..c94b0013660b --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of StreamingPolicy items. */ +@Fluent +public final class StreamingPolicyCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingPolicyCollection.class); + + /* + * A collection of StreamingPolicy items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of StreamingPolicy items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of StreamingPolicy items. + * + * @param value the value value to set. + * @return the StreamingPolicyCollection object itself. + */ + public StreamingPolicyCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the StreamingPolicyCollection object itself. + */ + public StreamingPolicyCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyContentKey.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyContentKey.java new file mode 100644 index 000000000000..44d2aabb9e00 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyContentKey.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class to specify properties of content key. */ +@Fluent +public final class StreamingPolicyContentKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingPolicyContentKey.class); + + /* + * 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 the label property: Label can be used to specify Content Key when creating a Streaming Locator. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: 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 the policyName property: Policy used by Content Key. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: 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 the tracks property: Tracks which use this content key. + * + * @return the tracks value. + */ + public List tracks() { + return this.tracks; + } + + /** + * Set the tracks property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tracks() != null) { + tracks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyContentKeys.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyContentKeys.java new file mode 100644 index 000000000000..369283dbd3cf --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyContentKeys.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class to specify properties of all content keys in Streaming Policy. */ +@Fluent +public final class StreamingPolicyContentKeys { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingPolicyContentKeys.class); + + /* + * 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 the defaultKey property: Default content key for an encryption scheme. + * + * @return the defaultKey value. + */ + public DefaultKey defaultKey() { + return this.defaultKey; + } + + /** + * Set the defaultKey property: 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 the keyToTrackMappings property: Representing tracks needs separate content key. + * + * @return the keyToTrackMappings value. + */ + public List keyToTrackMappings() { + return this.keyToTrackMappings; + } + + /** + * Set the keyToTrackMappings property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (defaultKey() != null) { + defaultKey().validate(); + } + if (keyToTrackMappings() != null) { + keyToTrackMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyFairPlayConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyFairPlayConfiguration.java new file mode 100644 index 000000000000..748a183e67bb --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyFairPlayConfiguration.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class to specify configurations of FairPlay in Streaming Policy. */ +@Fluent +public final class StreamingPolicyFairPlayConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingPolicyFairPlayConfiguration.class); + + /* + * Template for the URL of the custom service delivering licenses to end + * user players. Not required when using Azure Media Services for issuing + * licenses. The template supports replaceable tokens that the service + * will update at runtime with the value specific to the request. The + * currently supported token values are {AlternativeMediaId}, which is + * replaced with the value of StreamingLocatorId.AlternativeMediaId, and + * {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /* + * All license to be persistent or not + */ + @JsonProperty(value = "allowPersistentLicense", required = true) + private boolean allowPersistentLicense; + + /** + * Get the customLicenseAcquisitionUrlTemplate property: Template for the URL of the custom service delivering + * licenses to end user players. Not required when using Azure Media Services for issuing licenses. The template + * supports replaceable tokens that the service will update at runtime with the value specific to the request. The + * currently supported token values are {AlternativeMediaId}, which is replaced with the value of + * StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + * + * @return the customLicenseAcquisitionUrlTemplate value. + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the customLicenseAcquisitionUrlTemplate property: Template for the URL of the custom service delivering + * licenses to end user players. Not required when using Azure Media Services for issuing licenses. The template + * supports replaceable tokens that the service will update at runtime with the value specific to the request. The + * currently supported token values are {AlternativeMediaId}, which is replaced with the value of + * StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set. + * @return the StreamingPolicyFairPlayConfiguration object itself. + */ + public StreamingPolicyFairPlayConfiguration withCustomLicenseAcquisitionUrlTemplate( + String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + + /** + * Get the allowPersistentLicense property: All license to be persistent or not. + * + * @return the allowPersistentLicense value. + */ + public boolean allowPersistentLicense() { + return this.allowPersistentLicense; + } + + /** + * Set the allowPersistentLicense property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyPlayReadyConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyPlayReadyConfiguration.java new file mode 100644 index 000000000000..8a8ef0c23a76 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyPlayReadyConfiguration.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class to specify configurations of PlayReady in Streaming Policy. */ +@Fluent +public final class StreamingPolicyPlayReadyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingPolicyPlayReadyConfiguration.class); + + /* + * Template for the URL of the custom service delivering licenses to end + * user players. Not required when using Azure Media Services for issuing + * licenses. The template supports replaceable tokens that the service + * will update at runtime with the value specific to the request. The + * currently supported token values are {AlternativeMediaId}, which is + * replaced with the value of StreamingLocatorId.AlternativeMediaId, and + * {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /* + * Custom attributes for PlayReady + */ + @JsonProperty(value = "playReadyCustomAttributes") + private String playReadyCustomAttributes; + + /** + * Get the customLicenseAcquisitionUrlTemplate property: Template for the URL of the custom service delivering + * licenses to end user players. Not required when using Azure Media Services for issuing licenses. The template + * supports replaceable tokens that the service will update at runtime with the value specific to the request. The + * currently supported token values are {AlternativeMediaId}, which is replaced with the value of + * StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + * + * @return the customLicenseAcquisitionUrlTemplate value. + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the customLicenseAcquisitionUrlTemplate property: Template for the URL of the custom service delivering + * licenses to end user players. Not required when using Azure Media Services for issuing licenses. The template + * supports replaceable tokens that the service will update at runtime with the value specific to the request. The + * currently supported token values are {AlternativeMediaId}, which is replaced with the value of + * StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set. + * @return the StreamingPolicyPlayReadyConfiguration object itself. + */ + public StreamingPolicyPlayReadyConfiguration withCustomLicenseAcquisitionUrlTemplate( + String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + + /** + * Get the playReadyCustomAttributes property: Custom attributes for PlayReady. + * + * @return the playReadyCustomAttributes value. + */ + public String playReadyCustomAttributes() { + return this.playReadyCustomAttributes; + } + + /** + * Set the playReadyCustomAttributes property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyStreamingProtocol.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyStreamingProtocol.java new file mode 100644 index 000000000000..ed73fd8a2efd --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyStreamingProtocol.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StreamingPolicyStreamingProtocol. */ +public final class StreamingPolicyStreamingProtocol extends ExpandableStringEnum { + /** Static value Hls for StreamingPolicyStreamingProtocol. */ + public static final StreamingPolicyStreamingProtocol HLS = fromString("Hls"); + + /** Static value Dash for StreamingPolicyStreamingProtocol. */ + public static final StreamingPolicyStreamingProtocol DASH = fromString("Dash"); + + /** Static value SmoothStreaming for StreamingPolicyStreamingProtocol. */ + public static final StreamingPolicyStreamingProtocol SMOOTH_STREAMING = fromString("SmoothStreaming"); + + /** Static value Download for StreamingPolicyStreamingProtocol. */ + public static final StreamingPolicyStreamingProtocol DOWNLOAD = fromString("Download"); + + /** + * Creates or finds a StreamingPolicyStreamingProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding StreamingPolicyStreamingProtocol. + */ + @JsonCreator + public static StreamingPolicyStreamingProtocol fromString(String name) { + return fromString(name, StreamingPolicyStreamingProtocol.class); + } + + /** @return known StreamingPolicyStreamingProtocol values. */ + public static Collection values() { + return values(StreamingPolicyStreamingProtocol.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyWidevineConfiguration.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyWidevineConfiguration.java new file mode 100644 index 000000000000..0a55a93c6e3a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicyWidevineConfiguration.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class to specify configurations of Widevine in Streaming Policy. */ +@Fluent +public final class StreamingPolicyWidevineConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StreamingPolicyWidevineConfiguration.class); + + /* + * Template for the URL of the custom service delivering licenses to end + * user players. Not required when using Azure Media Services for issuing + * licenses. The template supports replaceable tokens that the service + * will update at runtime with the value specific to the request. The + * currently supported token values are {AlternativeMediaId}, which is + * replaced with the value of StreamingLocatorId.AlternativeMediaId, and + * {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + */ + @JsonProperty(value = "customLicenseAcquisitionUrlTemplate") + private String customLicenseAcquisitionUrlTemplate; + + /** + * Get the customLicenseAcquisitionUrlTemplate property: Template for the URL of the custom service delivering + * licenses to end user players. Not required when using Azure Media Services for issuing licenses. The template + * supports replaceable tokens that the service will update at runtime with the value specific to the request. The + * currently supported token values are {AlternativeMediaId}, which is replaced with the value of + * StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + * + * @return the customLicenseAcquisitionUrlTemplate value. + */ + public String customLicenseAcquisitionUrlTemplate() { + return this.customLicenseAcquisitionUrlTemplate; + } + + /** + * Set the customLicenseAcquisitionUrlTemplate property: Template for the URL of the custom service delivering + * licenses to end user players. Not required when using Azure Media Services for issuing licenses. The template + * supports replaceable tokens that the service will update at runtime with the value specific to the request. The + * currently supported token values are {AlternativeMediaId}, which is replaced with the value of + * StreamingLocatorId.AlternativeMediaId, and {ContentKeyId}, which is replaced with the value of identifier of the + * key being requested. + * + * @param customLicenseAcquisitionUrlTemplate the customLicenseAcquisitionUrlTemplate value to set. + * @return the StreamingPolicyWidevineConfiguration object itself. + */ + public StreamingPolicyWidevineConfiguration withCustomLicenseAcquisitionUrlTemplate( + String customLicenseAcquisitionUrlTemplate) { + this.customLicenseAcquisitionUrlTemplate = customLicenseAcquisitionUrlTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StretchMode.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StretchMode.java new file mode 100644 index 000000000000..91e7fa47d14e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StretchMode.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StretchMode. */ +public final class StretchMode extends ExpandableStringEnum { + /** Static value None for StretchMode. */ + public static final StretchMode NONE = fromString("None"); + + /** Static value AutoSize for StretchMode. */ + public static final StretchMode AUTO_SIZE = fromString("AutoSize"); + + /** Static value AutoFit for StretchMode. */ + public static final StretchMode AUTO_FIT = fromString("AutoFit"); + + /** + * Creates or finds a StretchMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding StretchMode. + */ + @JsonCreator + public static StretchMode fromString(String name) { + return fromString(name, StretchMode.class); + } + + /** @return known StretchMode values. */ + public static Collection values() { + return values(StretchMode.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SyncStorageKeysInput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SyncStorageKeysInput.java new file mode 100644 index 000000000000..95f57649f2d5 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SyncStorageKeysInput.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The input to the sync storage keys request. */ +@Fluent +public final class SyncStorageKeysInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncStorageKeysInput.class); + + /* + * The ID of the storage account resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The ID of the storage account resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackPropertyCompareOperation.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackPropertyCompareOperation.java new file mode 100644 index 000000000000..4608ea344193 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackPropertyCompareOperation.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TrackPropertyCompareOperation. */ +public final class TrackPropertyCompareOperation extends ExpandableStringEnum { + /** Static value Unknown for TrackPropertyCompareOperation. */ + public static final TrackPropertyCompareOperation UNKNOWN = fromString("Unknown"); + + /** Static value Equal for TrackPropertyCompareOperation. */ + public static final TrackPropertyCompareOperation EQUAL = fromString("Equal"); + + /** + * Creates or finds a TrackPropertyCompareOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrackPropertyCompareOperation. + */ + @JsonCreator + public static TrackPropertyCompareOperation fromString(String name) { + return fromString(name, TrackPropertyCompareOperation.class); + } + + /** @return known TrackPropertyCompareOperation values. */ + public static Collection values() { + return values(TrackPropertyCompareOperation.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackPropertyCondition.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackPropertyCondition.java new file mode 100644 index 000000000000..0b7341afac22 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackPropertyCondition.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class to specify one track property condition. */ +@Fluent +public final class TrackPropertyCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrackPropertyCondition.class); + + /* + * Track property type + */ + @JsonProperty(value = "property", required = true) + private TrackPropertyType property; + + /* + * Track property condition operation + */ + @JsonProperty(value = "operation", required = true) + private TrackPropertyCompareOperation operation; + + /* + * Track property value + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the property property: Track property type. + * + * @return the property value. + */ + public TrackPropertyType property() { + return this.property; + } + + /** + * Set the property property: Track property type. + * + * @param property the property value to set. + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withProperty(TrackPropertyType property) { + this.property = property; + return this; + } + + /** + * Get the operation property: Track property condition operation. + * + * @return the operation value. + */ + public TrackPropertyCompareOperation operation() { + return this.operation; + } + + /** + * Set the operation property: Track property condition operation. + * + * @param operation the operation value to set. + * @return the TrackPropertyCondition object itself. + */ + public TrackPropertyCondition withOperation(TrackPropertyCompareOperation operation) { + this.operation = operation; + return this; + } + + /** + * Get the value property: Track property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (property() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property property in model TrackPropertyCondition")); + } + if (operation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operation in model TrackPropertyCondition")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackPropertyType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackPropertyType.java new file mode 100644 index 000000000000..ac23f4e7503f --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackPropertyType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TrackPropertyType. */ +public final class TrackPropertyType extends ExpandableStringEnum { + /** Static value Unknown for TrackPropertyType. */ + public static final TrackPropertyType UNKNOWN = fromString("Unknown"); + + /** Static value FourCC for TrackPropertyType. */ + public static final TrackPropertyType FOUR_CC = fromString("FourCC"); + + /** + * Creates or finds a TrackPropertyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrackPropertyType. + */ + @JsonCreator + public static TrackPropertyType fromString(String name) { + return fromString(name, TrackPropertyType.class); + } + + /** @return known TrackPropertyType values. */ + public static Collection values() { + return values(TrackPropertyType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackSelection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackSelection.java new file mode 100644 index 000000000000..c2fc399abe33 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackSelection.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class to select a track. */ +@Fluent +public final class TrackSelection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrackSelection.class); + + /* + * TrackSelections is a track property condition list which can specify + * track(s) + */ + @JsonProperty(value = "trackSelections") + private List trackSelections; + + /** + * Get the trackSelections property: TrackSelections is a track property condition list which can specify track(s). + * + * @return the trackSelections value. + */ + public List trackSelections() { + return this.trackSelections; + } + + /** + * Set the trackSelections property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (trackSelections() != null) { + trackSelections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transform.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transform.java new file mode 100644 index 000000000000..9d1474afd83d --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transform.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.mediaservices.fluent.models.TransformInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Transform. */ +public interface Transform { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the created property: The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' + * format. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the description property: An optional verbose description of the Transform. + * + * @return the description value. + */ + String description(); + + /** + * Gets the lastModified property: The UTC date and time when the Transform was last updated, in + * 'YYYY-MM-DDThh:mm:ssZ' format. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the outputs property: An array of one or more TransformOutputs that the Transform should generate. + * + * @return the outputs value. + */ + List outputs(); + + /** + * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.TransformInner object. + * + * @return the inner object. + */ + TransformInner innerModel(); + + /** The entirety of the Transform definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Transform definition stages. */ + interface DefinitionStages { + /** The first stage of the Transform definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Transform definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @return the next definition stage. + */ + WithCreate withExistingMediaService(String resourceGroupName, String accountName); + } + /** + * The stage of the Transform definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithDescription, DefinitionStages.WithOutputs { + /** + * Executes the create request. + * + * @return the created resource. + */ + Transform create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Transform create(Context context); + } + /** The stage of the Transform definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: An optional verbose description of the Transform.. + * + * @param description An optional verbose description of the Transform. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the Transform definition allowing to specify outputs. */ + interface WithOutputs { + /** + * Specifies the outputs property: An array of one or more TransformOutputs that the Transform should + * generate.. + * + * @param outputs An array of one or more TransformOutputs that the Transform should generate. + * @return the next definition stage. + */ + WithCreate withOutputs(List outputs); + } + } + /** + * Begins update for the Transform resource. + * + * @return the stage of resource update. + */ + Transform.Update update(); + + /** The template for Transform update. */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithOutputs { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Transform apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Transform apply(Context context); + } + /** The Transform update stages. */ + interface UpdateStages { + /** The stage of the Transform update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: An optional verbose description of the Transform.. + * + * @param description An optional verbose description of the Transform. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Transform update allowing to specify outputs. */ + interface WithOutputs { + /** + * Specifies the outputs property: An array of one or more TransformOutputs that the Transform should + * generate.. + * + * @param outputs An array of one or more TransformOutputs that the Transform should generate. + * @return the next definition stage. + */ + Update withOutputs(List outputs); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Transform refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Transform refresh(Context context); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TransformCollection.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TransformCollection.java new file mode 100644 index 000000000000..740abbcd2471 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TransformCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.fluent.models.TransformInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collection of Transform items. */ +@Fluent +public final class TransformCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransformCollection.class); + + /* + * A collection of Transform items. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link to the next page of the collection (when the collection contains + * too many results to return in one response). + */ + @JsonProperty(value = "@odata.nextLink") + private String odataNextLink; + + /** + * Get the value property: A collection of Transform items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of Transform items. + * + * @param value the value value to set. + * @return the TransformCollection object itself. + */ + public TransformCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @return the odataNextLink value. + */ + public String odataNextLink() { + return this.odataNextLink; + } + + /** + * Set the odataNextLink property: A link to the next page of the collection (when the collection contains too many + * results to return in one response). + * + * @param odataNextLink the odataNextLink value to set. + * @return the TransformCollection object itself. + */ + public TransformCollection withOdataNextLink(String odataNextLink) { + this.odataNextLink = odataNextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TransformOutput.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TransformOutput.java new file mode 100644 index 000000000000..f7e70068e673 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TransformOutput.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a TransformOutput, which are the rules to be applied while generating the desired output. + */ +@Fluent +public final class TransformOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransformOutput.class); + + /* + * 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'. + */ + @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. + */ + @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 the onError property: 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'. + * + * @return the onError value. + */ + public OnErrorType onError() { + return this.onError; + } + + /** + * Set the onError property: 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'. + * + * @param onError the onError value to set. + * @return the TransformOutput object itself. + */ + public TransformOutput withOnError(OnErrorType onError) { + this.onError = onError; + return this; + } + + /** + * Get the relativePriority property: 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. + * + * @return the relativePriority value. + */ + public Priority relativePriority() { + return this.relativePriority; + } + + /** + * Set the relativePriority property: 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. + * + * @param relativePriority the relativePriority value to set. + * @return the TransformOutput object itself. + */ + public TransformOutput withRelativePriority(Priority relativePriority) { + this.relativePriority = relativePriority; + return this; + } + + /** + * Get the preset property: 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 the preset property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (preset() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property preset in model TransformOutput")); + } else { + preset().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transforms.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transforms.java new file mode 100644 index 000000000000..9cb07ef544f6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transforms.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Transforms. */ +public interface 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * 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 orderby Specifies the key by which the result collection should be ordered. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of Transform items. + */ + PagedIterable list( + String resourceGroupName, String accountName, String filter, String orderby, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + Transform get(String resourceGroupName, String accountName, String transformName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String transformName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String transformName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String transformName, Context context); + + /** + * Gets a Transform. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + Transform getById(String id); + + /** + * Gets a Transform. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transform. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Transform. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Transform. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Transform resource. + * + * @param name resource name. + * @return the first stage of the new Transform definition. + */ + Transform.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TransportStreamFormat.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TransportStreamFormat.java new file mode 100644 index 000000000000..2cd89d5e9432 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TransportStreamFormat.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** 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") +@JsonFlatten +@Immutable +public class TransportStreamFormat extends MultiBitrateFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransportStreamFormat.class); + + /** {@inheritDoc} */ + @Override + public TransportStreamFormat withOutputFiles(List outputFiles) { + super.withOutputFiles(outputFiles); + return this; + } + + /** {@inheritDoc} */ + @Override + public TransportStreamFormat withFilenamePattern(String filenamePattern) { + super.withFilenamePattern(filenamePattern); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/UtcClipTime.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/UtcClipTime.java new file mode 100644 index 000000000000..adb7ac0573c2 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/UtcClipTime.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** + * Specifies the clip time as a Utc time position in the media file. The Utc time can point to a different position + * depending on whether the media file starts from a timestamp of zero or not. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.UtcClipTime") +@JsonFlatten +@Fluent +public class UtcClipTime extends ClipTime { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UtcClipTime.class); + + /* + * The time position on the timeline of the input media based on Utc time. + */ + @JsonProperty(value = "time", required = true) + private OffsetDateTime time; + + /** + * Get the time property: The time position on the timeline of the input media based on Utc time. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Set the time property: The time position on the timeline of the input media based on Utc time. + * + * @param time the time value to set. + * @return the UtcClipTime object itself. + */ + public UtcClipTime withTime(OffsetDateTime time) { + this.time = time; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (time() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property time in model UtcClipTime")); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Video.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Video.java new file mode 100644 index 000000000000..a2119fca914e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Video.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; + +/** Describes the basic properties for encoding the input video. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = Video.class) +@JsonTypeName("#Microsoft.Media.Video") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.Image", value = Image.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.H264Video", value = H264Video.class) +}) +@JsonFlatten +@Fluent +public class Video extends Codec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Video.class); + + /* + * The distance between two key frames. The value should be non-zero in the + * range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 + * seconds(PT2S). Note that this setting is ignored if + * VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will + * follow the input source setting. + */ + @JsonProperty(value = "keyFrameInterval") + private Duration keyFrameInterval; + + /* + * The resizing mode - how the input video will be resized to fit the + * desired output resolution(s). Default is AutoSize + */ + @JsonProperty(value = "stretchMode") + private StretchMode stretchMode; + + /* + * The Video Sync Mode + */ + @JsonProperty(value = "syncMode") + private VideoSyncMode syncMode; + + /** + * Get the keyFrameInterval property: The distance between two key frames. The value should be non-zero in the range + * [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is + * ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source + * setting. + * + * @return the keyFrameInterval value. + */ + public Duration keyFrameInterval() { + return this.keyFrameInterval; + } + + /** + * Set the keyFrameInterval property: The distance between two key frames. The value should be non-zero in the range + * [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is + * ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source + * setting. + * + * @param keyFrameInterval the keyFrameInterval value to set. + * @return the Video object itself. + */ + public Video withKeyFrameInterval(Duration keyFrameInterval) { + this.keyFrameInterval = keyFrameInterval; + return this; + } + + /** + * Get the stretchMode property: The resizing mode - how the input video will be resized to fit the desired output + * resolution(s). Default is AutoSize. + * + * @return the stretchMode value. + */ + public StretchMode stretchMode() { + return this.stretchMode; + } + + /** + * Set the stretchMode property: The resizing mode - how the input video will be resized to fit the desired output + * resolution(s). Default is AutoSize. + * + * @param stretchMode the stretchMode value to set. + * @return the Video object itself. + */ + public Video withStretchMode(StretchMode stretchMode) { + this.stretchMode = stretchMode; + return this; + } + + /** + * Get the syncMode property: The Video Sync Mode. + * + * @return the syncMode value. + */ + public VideoSyncMode syncMode() { + return this.syncMode; + } + + /** + * Set the syncMode property: The Video Sync Mode. + * + * @param syncMode the syncMode value to set. + * @return the Video object itself. + */ + public Video withSyncMode(VideoSyncMode syncMode) { + this.syncMode = syncMode; + return this; + } + + /** {@inheritDoc} */ + @Override + public Video withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoAnalyzerPreset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoAnalyzerPreset.java new file mode 100644 index 000000000000..f86b54e1f7df --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoAnalyzerPreset.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** + * 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") +@JsonFlatten +@Fluent +public class VideoAnalyzerPreset extends AudioAnalyzerPreset { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VideoAnalyzerPreset.class); + + /* + * Defines the type of insights that you want the service to generate. The + * allowed values are 'AudioInsightsOnly', 'VideoInsightsOnly', and + * 'AllInsights'. The default is AllInsights. If you set this to + * AllInsights and the input is audio only, then only audio insights are + * generated. Similarly if the input is video only, then only video + * insights are generated. It is recommended that you not use + * AudioInsightsOnly if you expect some of your inputs to be video only; or + * use VideoInsightsOnly if you expect some of your inputs to be audio + * only. Your Jobs in such conditions would error out. + */ + @JsonProperty(value = "insightsToExtract") + private InsightsType insightsToExtract; + + /** + * Get the insightsToExtract property: Defines the type of insights that you want the service to generate. The + * allowed values are 'AudioInsightsOnly', 'VideoInsightsOnly', and 'AllInsights'. The default is AllInsights. If + * you set this to AllInsights and the input is audio only, then only audio insights are generated. Similarly if the + * input is video only, then only video insights are generated. It is recommended that you not use AudioInsightsOnly + * if you expect some of your inputs to be video only; or use VideoInsightsOnly if you expect some of your inputs to + * be audio only. Your Jobs in such conditions would error out. + * + * @return the insightsToExtract value. + */ + public InsightsType insightsToExtract() { + return this.insightsToExtract; + } + + /** + * Set the insightsToExtract property: Defines the type of insights that you want the service to generate. The + * allowed values are 'AudioInsightsOnly', 'VideoInsightsOnly', and 'AllInsights'. The default is AllInsights. If + * you set this to AllInsights and the input is audio only, then only audio insights are generated. Similarly if the + * input is video only, then only video insights are generated. It is recommended that you not use AudioInsightsOnly + * if you expect some of your inputs to be video only; or use VideoInsightsOnly if you expect some of your inputs to + * be audio only. Your Jobs in such conditions would error out. + * + * @param insightsToExtract the insightsToExtract value to set. + * @return the VideoAnalyzerPreset object itself. + */ + public VideoAnalyzerPreset withInsightsToExtract(InsightsType insightsToExtract) { + this.insightsToExtract = insightsToExtract; + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoAnalyzerPreset withAudioLanguage(String audioLanguage) { + super.withAudioLanguage(audioLanguage); + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoAnalyzerPreset withMode(AudioAnalysisMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoAnalyzerPreset withExperimentalOptions(Map experimentalOptions) { + super.withExperimentalOptions(experimentalOptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoLayer.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoLayer.java new file mode 100644 index 000000000000..82c662fe3c1a --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoLayer.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +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. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = VideoLayer.class) +@JsonTypeName("#Microsoft.Media.VideoLayer") +@JsonSubTypes({@JsonSubTypes.Type(name = "#Microsoft.Media.H264Layer", value = H264Layer.class)}) +@JsonFlatten +@Fluent +public class VideoLayer extends Layer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VideoLayer.class); + + /* + * 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", required = true) + private int 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 bitrate property: 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 int bitrate() { + return this.bitrate; + } + + /** + * Set the bitrate property: 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(int bitrate) { + this.bitrate = bitrate; + return this; + } + + /** + * Get the maxBitrate property: 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 maxBitrate property: 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 bFrames property: 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 bFrames property: 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 frameRate property: 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 frameRate property: 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 slices property: 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 slices property: 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 the adaptiveBFrame property: 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 the adaptiveBFrame property: 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; + } + + /** {@inheritDoc} */ + @Override + public VideoLayer withWidth(String width) { + super.withWidth(width); + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoLayer withHeight(String height) { + super.withHeight(height); + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoLayer withLabel(String label) { + super.withLabel(label); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoOverlay.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoOverlay.java new file mode 100644 index 000000000000..359dbddbf92e --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoOverlay.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; + +/** Describes the properties of a video overlay. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeName("#Microsoft.Media.VideoOverlay") +@JsonFlatten +@Fluent +public class VideoOverlay extends Overlay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VideoOverlay.class); + + /* + * 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 position property: The location in the input video where the overlay is applied. + * + * @return the position value. + */ + public Rectangle position() { + return this.position; + } + + /** + * Set the position property: 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 property: 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 property: 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 the cropRectangle property: An optional rectangular window used to crop the overlay image or video. + * + * @return the cropRectangle value. + */ + public Rectangle cropRectangle() { + return this.cropRectangle; + } + + /** + * Set the cropRectangle property: 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; + } + + /** {@inheritDoc} */ + @Override + public VideoOverlay withInputLabel(String inputLabel) { + super.withInputLabel(inputLabel); + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoOverlay withStart(Duration start) { + super.withStart(start); + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoOverlay withEnd(Duration end) { + super.withEnd(end); + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoOverlay withFadeInDuration(Duration fadeInDuration) { + super.withFadeInDuration(fadeInDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoOverlay withFadeOutDuration(Duration fadeOutDuration) { + super.withFadeOutDuration(fadeOutDuration); + return this; + } + + /** {@inheritDoc} */ + @Override + public VideoOverlay withAudioGainLevel(Double audioGainLevel) { + super.withAudioGainLevel(audioGainLevel); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (position() != null) { + position().validate(); + } + if (cropRectangle() != null) { + cropRectangle().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoSyncMode.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoSyncMode.java new file mode 100644 index 000000000000..2b04e5361653 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoSyncMode.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VideoSyncMode. */ +public final class VideoSyncMode extends ExpandableStringEnum { + /** Static value Auto for VideoSyncMode. */ + public static final VideoSyncMode AUTO = fromString("Auto"); + + /** Static value Passthrough for VideoSyncMode. */ + public static final VideoSyncMode PASSTHROUGH = fromString("Passthrough"); + + /** Static value Cfr for VideoSyncMode. */ + public static final VideoSyncMode CFR = fromString("Cfr"); + + /** Static value Vfr for VideoSyncMode. */ + public static final VideoSyncMode VFR = fromString("Vfr"); + + /** + * Creates or finds a VideoSyncMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VideoSyncMode. + */ + @JsonCreator + public static VideoSyncMode fromString(String name) { + return fromString(name, VideoSyncMode.class); + } + + /** @return known VideoSyncMode values. */ + public static Collection values() { + return values(VideoSyncMode.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/package-info.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/package-info.java new file mode 100644 index 000000000000..228bc4581fd9 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for AzureMediaServices. This Swagger was generated by the API Framework. */ +package com.azure.resourcemanager.mediaservices.models; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/package-info.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/package-info.java new file mode 100644 index 000000000000..685611d45831 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for AzureMediaServices. This Swagger was generated by the API Framework. */ +package com.azure.resourcemanager.mediaservices; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/module-info.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/module-info.java new file mode 100644 index 000000000000..3c0a4f2ea1b6 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.mediaservices { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.mediaservices; + exports com.azure.resourcemanager.mediaservices.fluent; + exports com.azure.resourcemanager.mediaservices.fluent.models; + exports com.azure.resourcemanager.mediaservices.models; + + opens com.azure.resourcemanager.mediaservices.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.mediaservices.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/mediaservices/ci.yml b/sdk/mediaservices/ci.yml index ad3b5e3abe8d..b6264d1ed452 100644 --- a/sdk/mediaservices/ci.yml +++ b/sdk/mediaservices/ci.yml @@ -3,34 +3,35 @@ trigger: branches: include: - - master - - hotfix/* - - release/* + - master + - hotfix/* + - release/* paths: include: - - sdk/mediaservices/ + - sdk/mediaservices/ exclude: - - sdk/mediaservices/mgmt-v2015_10_01 - - sdk/mediaservices/mgmt-v2018_03_30_preview - - sdk/mediaservices/mgmt-v2018_06_01_preview - - sdk/mediaservices/mgmt-v2018_07_01 - - sdk/mediaservices/mgmt-v2019_05_01_preview + - sdk/mediaservices/mgmt-v2015_10_01 + - sdk/mediaservices/mgmt-v2018_03_30_preview + - sdk/mediaservices/mgmt-v2018_06_01_preview + - sdk/mediaservices/mgmt-v2018_07_01 + - sdk/mediaservices/mgmt-v2019_05_01_preview + pr: branches: include: - - master - - feature/* - - hotfix/* - - release/* + - master + - feature/* + - hotfix/* + - release/* paths: include: - - sdk/mediaservices/ + - sdk/mediaservices/ exclude: - - sdk/mediaservices/mgmt-v2015_10_01 - - sdk/mediaservices/mgmt-v2018_03_30_preview - - sdk/mediaservices/mgmt-v2018_06_01_preview - - sdk/mediaservices/mgmt-v2018_07_01 - - sdk/mediaservices/mgmt-v2019_05_01_preview + - sdk/mediaservices/mgmt-v2015_10_01 + - sdk/mediaservices/mgmt-v2018_03_30_preview + - sdk/mediaservices/mgmt-v2018_06_01_preview + - sdk/mediaservices/mgmt-v2018_07_01 + - sdk/mediaservices/mgmt-v2019_05_01_preview extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -38,6 +39,9 @@ extends: SDKType: data ServiceDirectory: mediaservices Artifacts: - - name: azure-media - groupId: com.microsoft.azure - safeName: azuremedia + - name: azure-media + groupId: com.microsoft.azure + safeName: azuremedia + - name: azure-resourcemanager-mediaservices + groupId: com.azure.resourcemanager + safeName: azureresourcemanagermediaservices diff --git a/sdk/mediaservices/pom.xml b/sdk/mediaservices/pom.xml index bd3c7433293a..fbb6a26c6c01 100644 --- a/sdk/mediaservices/pom.xml +++ b/sdk/mediaservices/pom.xml @@ -9,6 +9,7 @@ pom 1.0.0 + azure-resourcemanager-mediaservices microsoft-azure-media