From 999d9796f03bb6cefce9bc1cf4057df7b63e8dca Mon Sep 17 00:00:00 2001
From: SDK Automation <sdkautomation@microsoft.com>
Date: Wed, 27 May 2020 21:24:44 +0000
Subject: [PATCH 1/2] Update from master

---
 .../arm-mediaservices/LICENSE.txt             |  2 +-
 .../arm-mediaservices/src/models/index.ts     | 78 +++++++++++++++
 .../arm-mediaservices/src/models/mappers.ts   | 96 +++++++++++++++++++
 .../src/models/mediaservicesMappers.ts        |  4 +
 .../src/operations/mediaservices.ts           | 69 +++++++++++++
 5 files changed, 248 insertions(+), 1 deletion(-)

diff --git a/sdk/mediaservices/arm-mediaservices/LICENSE.txt b/sdk/mediaservices/arm-mediaservices/LICENSE.txt
index b73b4a1293c3..ea8fb1516028 100644
--- a/sdk/mediaservices/arm-mediaservices/LICENSE.txt
+++ b/sdk/mediaservices/arm-mediaservices/LICENSE.txt
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) 2019 Microsoft
+Copyright (c) 2020 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
diff --git a/sdk/mediaservices/arm-mediaservices/src/models/index.ts b/sdk/mediaservices/arm-mediaservices/src/models/index.ts
index a6a14ca891f5..27f2e0f9a292 100644
--- a/sdk/mediaservices/arm-mediaservices/src/models/index.ts
+++ b/sdk/mediaservices/arm-mediaservices/src/models/index.ts
@@ -372,6 +372,64 @@ export interface MediaService extends TrackedResource {
   storageAccounts?: StorageAccount[];
 }
 
+/**
+ * An interface representing ListEdgePoliciesInput.
+ */
+export interface ListEdgePoliciesInput {
+  /**
+   * Unique identifier of the edge device.
+   */
+  deviceId?: string;
+}
+
+/**
+ * An interface representing EdgeUsageDataEventHub.
+ */
+export interface EdgeUsageDataEventHub {
+  /**
+   * Name of the Event Hub where usage will be reported.
+   */
+  name?: string;
+  /**
+   * Namespace of the Event Hub where usage will be reported.
+   */
+  namespace?: string;
+  /**
+   * SAS token needed to interact with Event Hub.
+   */
+  token?: string;
+}
+
+/**
+ * An interface representing EdgeUsageDataCollectionPolicy.
+ */
+export interface EdgeUsageDataCollectionPolicy {
+  /**
+   * Usage data collection frequency in ISO 8601 duration format e.g. PT10M , PT5H.
+   */
+  dataCollectionFrequency?: string;
+  /**
+   * Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , PT5H.
+   */
+  dataReportingFrequency?: string;
+  /**
+   * Maximum time for which the functionality of the device will not be hampered for not reporting
+   * the usage data.
+   */
+  maxAllowedUnreportedUsageDuration?: string;
+  /**
+   * Details of Event Hub where the usage will be reported.
+   */
+  eventHubDetails?: EdgeUsageDataEventHub;
+}
+
+/**
+ * An interface representing EdgePolicies.
+ */
+export interface EdgePolicies {
+  usageDataCollectionPolicy?: EdgeUsageDataCollectionPolicy;
+}
+
 /**
  * A Media Services account.
  */
@@ -4400,6 +4458,26 @@ export type MediaservicesUpdateResponse = MediaService & {
     };
 };
 
+/**
+ * Contains response data for the listEdgePolicies operation.
+ */
+export type MediaservicesListEdgePoliciesResponse = EdgePolicies & {
+  /**
+   * The underlying HTTP response.
+   */
+  _response: msRest.HttpResponse & {
+      /**
+       * The response body as text (string format)
+       */
+      bodyAsText: string;
+
+      /**
+       * The response body as parsed JSON or XML
+       */
+      parsedBody: EdgePolicies;
+    };
+};
+
 /**
  * Contains response data for the listBySubscription operation.
  */
diff --git a/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts b/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts
index e7406f2f05ee..90045ee066ae 100644
--- a/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts
+++ b/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts
@@ -630,6 +630,102 @@ export const MediaService: msRest.CompositeMapper = {
   }
 };
 
+export const ListEdgePoliciesInput: msRest.CompositeMapper = {
+  serializedName: "ListEdgePoliciesInput",
+  type: {
+    name: "Composite",
+    className: "ListEdgePoliciesInput",
+    modelProperties: {
+      deviceId: {
+        serializedName: "deviceId",
+        type: {
+          name: "String"
+        }
+      }
+    }
+  }
+};
+
+export const EdgeUsageDataEventHub: msRest.CompositeMapper = {
+  serializedName: "EdgeUsageDataEventHub",
+  type: {
+    name: "Composite",
+    className: "EdgeUsageDataEventHub",
+    modelProperties: {
+      name: {
+        serializedName: "name",
+        type: {
+          name: "String"
+        }
+      },
+      namespace: {
+        serializedName: "namespace",
+        type: {
+          name: "String"
+        }
+      },
+      token: {
+        serializedName: "token",
+        type: {
+          name: "String"
+        }
+      }
+    }
+  }
+};
+
+export const EdgeUsageDataCollectionPolicy: msRest.CompositeMapper = {
+  serializedName: "EdgeUsageDataCollectionPolicy",
+  type: {
+    name: "Composite",
+    className: "EdgeUsageDataCollectionPolicy",
+    modelProperties: {
+      dataCollectionFrequency: {
+        serializedName: "dataCollectionFrequency",
+        type: {
+          name: "String"
+        }
+      },
+      dataReportingFrequency: {
+        serializedName: "dataReportingFrequency",
+        type: {
+          name: "String"
+        }
+      },
+      maxAllowedUnreportedUsageDuration: {
+        serializedName: "maxAllowedUnreportedUsageDuration",
+        type: {
+          name: "String"
+        }
+      },
+      eventHubDetails: {
+        serializedName: "eventHubDetails",
+        type: {
+          name: "Composite",
+          className: "EdgeUsageDataEventHub"
+        }
+      }
+    }
+  }
+};
+
+export const EdgePolicies: msRest.CompositeMapper = {
+  serializedName: "EdgePolicies",
+  type: {
+    name: "Composite",
+    className: "EdgePolicies",
+    modelProperties: {
+      usageDataCollectionPolicy: {
+        serializedName: "usageDataCollectionPolicy",
+        type: {
+          name: "Composite",
+          className: "EdgeUsageDataCollectionPolicy"
+        }
+      }
+    }
+  }
+};
+
 export const SubscriptionMediaService: msRest.CompositeMapper = {
   serializedName: "SubscriptionMediaService",
   type: {
diff --git a/sdk/mediaservices/arm-mediaservices/src/models/mediaservicesMappers.ts b/sdk/mediaservices/arm-mediaservices/src/models/mediaservicesMappers.ts
index 77108f268767..edb31ff40d85 100644
--- a/sdk/mediaservices/arm-mediaservices/src/models/mediaservicesMappers.ts
+++ b/sdk/mediaservices/arm-mediaservices/src/models/mediaservicesMappers.ts
@@ -56,6 +56,9 @@ export {
   CrossSiteAccessPolicies,
   DefaultKey,
   Deinterlace,
+  EdgePolicies,
+  EdgeUsageDataCollectionPolicy,
+  EdgeUsageDataEventHub,
   EnabledProtocols,
   EnvelopeEncryption,
   FaceDetectorPreset,
@@ -85,6 +88,7 @@ export {
   JpgImage,
   JpgLayer,
   Layer,
+  ListEdgePoliciesInput,
   LiveEvent,
   LiveEventEncoding,
   LiveEventEndpoint,
diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts b/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts
index 7cc6495c02ac..92537cb6726a 100644
--- a/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts
+++ b/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts
@@ -233,6 +233,43 @@ export class Mediaservices {
       callback);
   }
 
+  /**
+   * List the media edge policies associated with the Media Services account.
+   * @summary 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 [options] The optional parameters
+   * @returns Promise<Models.MediaservicesListEdgePoliciesResponse>
+   */
+  listEdgePolicies(resourceGroupName: string, accountName: string, parameters: Models.ListEdgePoliciesInput, options?: msRest.RequestOptionsBase): Promise<Models.MediaservicesListEdgePoliciesResponse>;
+  /**
+   * @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 callback The callback
+   */
+  listEdgePolicies(resourceGroupName: string, accountName: string, parameters: Models.ListEdgePoliciesInput, callback: msRest.ServiceCallback<Models.EdgePolicies>): void;
+  /**
+   * @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 options The optional parameters
+   * @param callback The callback
+   */
+  listEdgePolicies(resourceGroupName: string, accountName: string, parameters: Models.ListEdgePoliciesInput, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.EdgePolicies>): void;
+  listEdgePolicies(resourceGroupName: string, accountName: string, parameters: Models.ListEdgePoliciesInput, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.EdgePolicies>, callback?: msRest.ServiceCallback<Models.EdgePolicies>): Promise<Models.MediaservicesListEdgePoliciesResponse> {
+    return this.client.sendOperationRequest(
+      {
+        resourceGroupName,
+        accountName,
+        parameters,
+        options
+      },
+      listEdgePoliciesOperationSpec,
+      callback) as Promise<Models.MediaservicesListEdgePoliciesResponse>;
+  }
+
   /**
    * List Media Services accounts in the subscription.
    * @summary List Media Services accounts
@@ -517,6 +554,38 @@ const syncStorageKeysOperationSpec: msRest.OperationSpec = {
   serializer
 };
 
+const listEdgePoliciesOperationSpec: msRest.OperationSpec = {
+  httpMethod: "POST",
+  path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/listEdgePolicies",
+  urlParameters: [
+    Parameters.subscriptionId,
+    Parameters.resourceGroupName,
+    Parameters.accountName
+  ],
+  queryParameters: [
+    Parameters.apiVersion
+  ],
+  headerParameters: [
+    Parameters.acceptLanguage
+  ],
+  requestBody: {
+    parameterPath: "parameters",
+    mapper: {
+      ...Mappers.ListEdgePoliciesInput,
+      required: true
+    }
+  },
+  responses: {
+    200: {
+      bodyMapper: Mappers.EdgePolicies
+    },
+    default: {
+      bodyMapper: Mappers.ApiError
+    }
+  },
+  serializer
+};
+
 const listBySubscriptionOperationSpec: msRest.OperationSpec = {
   httpMethod: "GET",
   path: "subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices",

From fbc1dfe56eea9bd0c13876ec73efb1beafb1a55b Mon Sep 17 00:00:00 2001
From: Changlong Liu <changlong.liu@microsoft.com>
Date: Sat, 30 May 2020 19:00:57 +0800
Subject: [PATCH 2/2] version

---
 sdk/mediaservices/arm-mediaservices/package.json          | 2 +-
 .../arm-mediaservices/src/azureMediaServicesContext.ts    | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sdk/mediaservices/arm-mediaservices/package.json b/sdk/mediaservices/arm-mediaservices/package.json
index 4294e685ca38..81f83a885a2c 100644
--- a/sdk/mediaservices/arm-mediaservices/package.json
+++ b/sdk/mediaservices/arm-mediaservices/package.json
@@ -2,7 +2,7 @@
   "name": "@azure/arm-mediaservices",
   "author": "Microsoft Corporation",
   "description": "AzureMediaServices Library with typescript type definitions for node.js and browser.",
-  "version": "7.1.0",
+  "version": "7.2.0",
   "dependencies": {
     "@azure/ms-rest-azure-js": "^2.0.1",
     "@azure/ms-rest-js": "^2.0.4",
diff --git a/sdk/mediaservices/arm-mediaservices/src/azureMediaServicesContext.ts b/sdk/mediaservices/arm-mediaservices/src/azureMediaServicesContext.ts
index 50aa7cfc68fa..69a3d868873c 100644
--- a/sdk/mediaservices/arm-mediaservices/src/azureMediaServicesContext.ts
+++ b/sdk/mediaservices/arm-mediaservices/src/azureMediaServicesContext.ts
@@ -13,7 +13,7 @@ import * as msRest from "@azure/ms-rest-js";
 import * as msRestAzure from "@azure/ms-rest-azure-js";
 
 const packageName = "@azure/arm-mediaservices";
-const packageVersion = "7.1.0";
+const packageVersion = "7.2.0";
 
 export class AzureMediaServicesContext extends msRestAzure.AzureServiceClient {
   credentials: msRest.ServiceClientCredentials;
@@ -37,7 +37,7 @@ export class AzureMediaServicesContext extends msRestAzure.AzureServiceClient {
     if (!options) {
       options = {};
     }
-    if(!options.userAgent) {
+    if (!options.userAgent) {
       const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
       options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
     }
@@ -52,10 +52,10 @@ export class AzureMediaServicesContext extends msRestAzure.AzureServiceClient {
     this.credentials = credentials;
     this.subscriptionId = subscriptionId;
 
-    if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
+    if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
       this.acceptLanguage = options.acceptLanguage;
     }
-    if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
+    if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
       this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
     }
   }