Skip to content

Commit

Permalink
CodeGen from PR 17540 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 33267776c8fa4851266f10fb581d39dbe21326bb into 938d33ac71d661bfa53946ad4fa72c7fdbf2dfcf
  • Loading branch information
SDKAuto committed Feb 1, 2022
1 parent ff07737 commit 9b540bf
Show file tree
Hide file tree
Showing 371 changed files with 18,350 additions and 3,411 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 1.1.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-02-01)

- 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-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## 1.1.0-beta.2 (2021-07-16)

Expand Down
60 changes: 58 additions & 2 deletions sdk/mediaservices/azure-resourcemanager-mediaservices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for MediaServices Management SDK. This Swagger was generated by the API Framework. Package tag package-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-mediaservices</artifactId>
<version>1.1.0-beta.2</version>
<version>1.1.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down Expand Up @@ -74,6 +74,62 @@ See [API design][design] for general introduction on design and key concepts on

## Examples

```java
// storage account
StorageAccount storageAccount = storageManager.storageAccounts().define(STORAGE_ACCOUNT)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroup)
.create();

// media service account
MediaService account = manager.mediaservices().define(ACCOUNT)
.withRegion(Region.US_WEST3)
.withExistingResourceGroup(resourceGroup)
.withStorageAccounts(Collections.singletonList(
new com.azure.resourcemanager.mediaservices.models.StorageAccount()
.withId(storageAccount.id())
.withType(StorageAccountType.PRIMARY)))
.create();

// transform
Transform transform = manager.transforms()
.define("transform1")
.withExistingMediaService(resourceGroup, ACCOUNT)
.withOutputs(Collections.singletonList(new TransformOutput()
.withPreset(new BuiltInStandardEncoderPreset()
.withPresetName(EncoderNamedPreset.CONTENT_AWARE_ENCODING))))
.create();

// output asset
Asset asset = manager.assets()
.define("output1")
.withExistingMediaService(resourceGroup, ACCOUNT)
.create();

// input uri
String jobHttpBaseUri = "https://nimbuscdn-nimbuspm.streaming.mediaservices.windows.net/2b533311-b215-4409-80af-529c3e853622/";
String jobFile = "Ignite-short.mp4";

// job
Job job = manager.jobs().define("job1")
.withExistingTransform(resourceGroup, ACCOUNT, "transform1")
.withInput(new JobInputHttp()
.withFiles(Collections.singletonList(jobFile))
.withBaseUri(jobHttpBaseUri)
.withLabel("input1"))
.withOutputs(Collections.singletonList(new JobOutputAsset().withAssetName("output1")))
.create();

// wait for job completion
JobState jobState = job.state();
while (!(jobState == JobState.CANCELED || jobState == JobState.ERROR || jobState == JobState.FINISHED)) {
sleepIfRunningAgainstService(10 * 1000); // wait 10 seconds
jobState = job.refresh().state();
}

// refresh output asset after job finished
asset.refresh();
```
[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/mediaservices/azure-resourcemanager-mediaservices/SAMPLE.md)


Expand Down
3,687 changes: 3,566 additions & 121 deletions sdk/mediaservices/azure-resourcemanager-mediaservices/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for MediaServices Management</name>
<description>This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-2021-06.</description>
<description>This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-2021-11.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand All @@ -39,7 +39,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
Expand All @@ -30,13 +31,18 @@
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.MediaServiceOperationResultsImpl;
import com.azure.resourcemanager.mediaservices.implementation.MediaServiceOperationStatusesImpl;
import com.azure.resourcemanager.mediaservices.implementation.MediaservicesImpl;
import com.azure.resourcemanager.mediaservices.implementation.OperationResultsImpl;
import com.azure.resourcemanager.mediaservices.implementation.OperationStatusesImpl;
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.TracksImpl;
import com.azure.resourcemanager.mediaservices.implementation.TransformsImpl;
import com.azure.resourcemanager.mediaservices.models.AccountFilters;
import com.azure.resourcemanager.mediaservices.models.AssetFilters;
Expand All @@ -46,22 +52,30 @@
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.MediaServiceOperationResults;
import com.azure.resourcemanager.mediaservices.models.MediaServiceOperationStatuses;
import com.azure.resourcemanager.mediaservices.models.Mediaservices;
import com.azure.resourcemanager.mediaservices.models.OperationResults;
import com.azure.resourcemanager.mediaservices.models.OperationStatuses;
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.Tracks;
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;
import java.util.stream.Collectors;

/** 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;
Expand All @@ -72,12 +86,20 @@ public final class MediaServicesManager {

private Locations locations;

private AccountFilters accountFilters;
private MediaServiceOperationStatuses mediaServiceOperationStatuses;

private MediaServiceOperationResults mediaServiceOperationResults;

private Assets assets;

private AssetFilters assetFilters;

private Tracks tracks;

private OperationStatuses operationStatuses;

private OperationResults operationResults;

private ContentKeyPolicies contentKeyPolicies;

private Transforms transforms;
Expand Down Expand Up @@ -230,7 +252,7 @@ public MediaServicesManager authenticate(TokenCredential credential, AzureProfil
.append("-")
.append("com.azure.resourcemanager.mediaservices")
.append("/")
.append("1.1.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -253,11 +275,24 @@ public MediaServicesManager authenticate(TokenCredential credential, AzureProfil
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies);
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
Expand All @@ -269,6 +304,14 @@ public MediaServicesManager authenticate(TokenCredential credential, AzureProfil
}
}

/** @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) {
Expand Down Expand Up @@ -310,12 +353,22 @@ public Locations locations() {
return locations;
}

/** @return Resource collection API of AccountFilters. */
public AccountFilters accountFilters() {
if (this.accountFilters == null) {
this.accountFilters = new AccountFiltersImpl(clientObject.getAccountFilters(), this);
/** @return Resource collection API of MediaServiceOperationStatuses. */
public MediaServiceOperationStatuses mediaServiceOperationStatuses() {
if (this.mediaServiceOperationStatuses == null) {
this.mediaServiceOperationStatuses =
new MediaServiceOperationStatusesImpl(clientObject.getMediaServiceOperationStatuses(), this);
}
return accountFilters;
return mediaServiceOperationStatuses;
}

/** @return Resource collection API of MediaServiceOperationResults. */
public MediaServiceOperationResults mediaServiceOperationResults() {
if (this.mediaServiceOperationResults == null) {
this.mediaServiceOperationResults =
new MediaServiceOperationResultsImpl(clientObject.getMediaServiceOperationResults(), this);
}
return mediaServiceOperationResults;
}

/** @return Resource collection API of Assets. */
Expand All @@ -334,6 +387,30 @@ public AssetFilters assetFilters() {
return assetFilters;
}

/** @return Resource collection API of Tracks. */
public Tracks tracks() {
if (this.tracks == null) {
this.tracks = new TracksImpl(clientObject.getTracks(), this);
}
return tracks;
}

/** @return Resource collection API of OperationStatuses. */
public OperationStatuses operationStatuses() {
if (this.operationStatuses == null) {
this.operationStatuses = new OperationStatusesImpl(clientObject.getOperationStatuses(), this);
}
return operationStatuses;
}

/** @return Resource collection API of OperationResults. */
public OperationResults operationResults() {
if (this.operationResults == null) {
this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this);
}
return operationResults;
}

/** @return Resource collection API of ContentKeyPolicies. */
public ContentKeyPolicies contentKeyPolicies() {
if (this.contentKeyPolicies == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public interface AccountFiltersClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException 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.
* @return the details of an Account Filter in the Media Services account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AccountFilterInner> getWithResponse(
Expand Down Expand Up @@ -97,7 +97,7 @@ AccountFilterInner createOrUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.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.
* @return an Account Filter along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AccountFilterInner> createOrUpdateWithResponse(
Expand Down Expand Up @@ -130,7 +130,7 @@ Response<AccountFilterInner> createOrUpdateWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException 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.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(String resourceGroupName, String accountName, String filterName, Context context);
Expand Down Expand Up @@ -162,7 +162,7 @@ AccountFilterInner update(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.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.
* @return an Account Filter along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AccountFilterInner> updateWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ PagedIterable<AssetFilterInner> list(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException 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.
* @return the details of an Asset Filter associated with the specified Asset along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AssetFilterInner> getWithResponse(
Expand Down Expand Up @@ -104,7 +104,7 @@ AssetFilterInner createOrUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.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.
* @return an Asset Filter along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AssetFilterInner> createOrUpdateWithResponse(
Expand Down Expand Up @@ -140,7 +140,7 @@ Response<AssetFilterInner> createOrUpdateWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException 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.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(
Expand Down Expand Up @@ -175,7 +175,7 @@ AssetFilterInner update(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.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.
* @return an Asset Filter along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AssetFilterInner> updateWithResponse(
Expand Down
Loading

0 comments on commit 9b540bf

Please sign in to comment.