Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR @azure/arm-mediaservices] [Hub Generated] Review request for Microsoft.Media to add version stable/2020-05-01 #3533

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/mediaservices/arm-mediaservices/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Microsoft
Copyright (c) 2021 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
55 changes: 17 additions & 38 deletions sdk/mediaservices/arm-mediaservices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ npm install @azure/arm-mediaservices

### How to use

#### nodejs - Authentication, client creation and list all Assets as an example written in TypeScript.
This sample shows how to use Service Principal authentication with details obtained from the Azure Portal's API Access page in your Azure Media Services account.
It also demonstrates how to create the Media Services client and do a simple listing of all assets in the account. If no Assets have been created yet, the list will just return empty.

More detailed examples are available at the following Samples repository. Contributions are encouraged!
- [Azure Media Services v3 Node samples](https://github.com/Azure-Samples/media-services-v3-node-tutorials)
#### nodejs - client creation and list accountFilters as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

Expand All @@ -31,38 +26,22 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0"

##### Sample code

While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package
```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { AzureMediaServices, AzureMediaServicesModels, AzureMediaServicesMappers } from "@azure/arm-mediaservices";

export async function main() {
// Go to the Azure Portal and copy the values obtained
// from your Media Services account's API Access page into the constants
const clientId = "<<Enter the AadClientId value from the Azure Portal>>";
const secret = "<<Enter the AadSecret value from the Azure Portal>>";
const tenantDomain = "<<Enter the AadTenantDomain value from the Azure portal>>";
const subscriptionId = "<<Enter the SubscriptionId value from the Azure portal>>";
const resourceGroup = "<<Enter the ResourceGroup value from the Azure portal>>";
const accountName = "<<Enter the AccountName value from the Azure portal>>";


const creds = await msRestNodeAuth.loginWithServicePrincipalSecret(clientId, secret, tenantDomain);
const mediaClient = new AzureMediaServices(creds, subscriptionId);

// List Assets in Account
console.log("Listing Assets Names in account:")
var assets = await mediaClient.assets.list(resourceGroup, accountName);

assets.forEach(asset => {
console.log(asset.name);
});

}

main().catch((err) => {
console.error("Error running sample:", err.message);
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const { AzureMediaServices } = require("@azure/arm-mediaservices");
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new AzureMediaServices(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const accountName = "testaccountName";
client.accountFilters.list(resourceGroupName, accountName).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

Expand Down Expand Up @@ -102,7 +81,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
const client = new Azure.ArmMediaservices.AzureMediaServices(res.creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const accountName = "testaccountName";
client.assets.list(resourceGroupName, accountName).then((result) => {
client.accountFilters.list(resourceGroupName, accountName).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
Expand Down
4 changes: 2 additions & 2 deletions sdk/mediaservices/arm-mediaservices/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const config = {
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
133 changes: 123 additions & 10 deletions sdk/mediaservices/arm-mediaservices/src/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down Expand Up @@ -82,11 +82,12 @@ export interface FilterTrackSelection {
}

/**
* An interface representing Resource.
* Common fields that are returned in the response for all Azure Resource Manager resources
* @summary Resource
*/
export interface Resource extends BaseResource {
/**
* Fully qualified resource Id for the resource. Ex -
* Fully qualified resource ID for the resource. Ex -
* /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
Expand All @@ -97,16 +98,17 @@ export interface Resource extends BaseResource {
*/
readonly name?: string;
/**
* The type of the resource. Ex- Microsoft.Compute/virtualMachines or
* Microsoft.Storage/storageAccounts.
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
* "Microsoft.Storage/storageAccounts"
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly type?: string;
}

/**
* The resource model definition for a ARM proxy resource. It will have everything other than
* required location and tags
* The resource model definition for a Azure Resource Manager proxy resource. It will not have tags
* and a location
* @summary Proxy Resource
*/
export interface ProxyResource extends Resource {
}
Expand Down Expand Up @@ -162,7 +164,9 @@ export interface ApiError {
}

/**
* The resource model definition for a ARM tracked top level resource
* The resource model definition for an Azure Resource Manager tracked top level resource which has
* 'tags' and a 'location'
* @summary Tracked Resource
*/
export interface TrackedResource extends Resource {
/**
Expand All @@ -176,7 +180,8 @@ export interface TrackedResource extends Resource {
}

/**
* The resource model definition for a Azure Resource Manager resource with an etag.
* The resource model definition for an Azure Resource Manager resource with an etag.
* @summary Entity Resource
*/
export interface AzureEntityResource extends Resource {
/**
Expand Down Expand Up @@ -4001,6 +4006,26 @@ export interface AssetsListOptionalParams extends msRest.RequestOptionsBase {
orderby?: string;
}

/**
* Optional Parameters.
*/
export interface AssetsListNextOptionalParams extends msRest.RequestOptionsBase {
/**
* Restricts the set of items returned.
*/
filter?: string;
/**
* 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.
*/
top?: number;
/**
* Specifies the key by which the result collection should be ordered.
*/
orderby?: string;
}

/**
* Optional Parameters.
*/
Expand All @@ -4021,6 +4046,26 @@ export interface ContentKeyPoliciesListOptionalParams extends msRest.RequestOpti
orderby?: string;
}

/**
* Optional Parameters.
*/
export interface ContentKeyPoliciesListNextOptionalParams extends msRest.RequestOptionsBase {
/**
* Restricts the set of items returned.
*/
filter?: string;
/**
* 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.
*/
top?: number;
/**
* Specifies the key by which the result collection should be ordered.
*/
orderby?: string;
}

/**
* Optional Parameters.
*/
Expand All @@ -4035,6 +4080,20 @@ export interface TransformsListOptionalParams extends msRest.RequestOptionsBase
orderby?: string;
}

/**
* Optional Parameters.
*/
export interface TransformsListNextOptionalParams extends msRest.RequestOptionsBase {
/**
* Restricts the set of items returned.
*/
filter?: string;
/**
* Specifies the key by which the result collection should be ordered.
*/
orderby?: string;
}

/**
* Optional Parameters.
*/
Expand All @@ -4049,6 +4108,20 @@ export interface JobsListOptionalParams extends msRest.RequestOptionsBase {
orderby?: string;
}

/**
* Optional Parameters.
*/
export interface JobsListNextOptionalParams extends msRest.RequestOptionsBase {
/**
* Restricts the set of items returned.
*/
filter?: string;
/**
* Specifies the key by which the result collection should be ordered.
*/
orderby?: string;
}

/**
* Optional Parameters.
*/
Expand All @@ -4069,6 +4142,26 @@ export interface StreamingPoliciesListOptionalParams extends msRest.RequestOptio
orderby?: string;
}

/**
* Optional Parameters.
*/
export interface StreamingPoliciesListNextOptionalParams extends msRest.RequestOptionsBase {
/**
* Restricts the set of items returned.
*/
filter?: string;
/**
* 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.
*/
top?: number;
/**
* Specifies the key by which the result collection should be ordered.
*/
orderby?: string;
}

/**
* Optional Parameters.
*/
Expand All @@ -4089,6 +4182,26 @@ export interface StreamingLocatorsListOptionalParams extends msRest.RequestOptio
orderby?: string;
}

/**
* Optional Parameters.
*/
export interface StreamingLocatorsListNextOptionalParams extends msRest.RequestOptionsBase {
/**
* Restricts the set of items returned.
*/
filter?: string;
/**
* 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.
*/
top?: number;
/**
* Specifies the key by which the result collection should be ordered.
*/
orderby?: string;
}

/**
* Optional Parameters.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Loading