diff --git a/services/mediaservices/mgmt/2018-07-01/media/mediaapi/interfaces.go b/services/mediaservices/mgmt/2018-07-01/media/mediaapi/interfaces.go index 736f2218bb42..f28edc40d21c 100644 --- a/services/mediaservices/mgmt/2018-07-01/media/mediaapi/interfaces.go +++ b/services/mediaservices/mgmt/2018-07-01/media/mediaapi/interfaces.go @@ -53,6 +53,7 @@ type MediaservicesClientAPI interface { ListComplete(ctx context.Context, resourceGroupName string) (result media.ServiceCollectionIterator, err error) ListBySubscription(ctx context.Context) (result media.SubscriptionMediaServiceCollectionPage, err error) ListBySubscriptionComplete(ctx context.Context) (result media.SubscriptionMediaServiceCollectionIterator, err error) + ListEdgePolicies(ctx context.Context, resourceGroupName string, accountName string, parameters media.ListEdgePoliciesInput) (result media.EdgePolicies, err error) SyncStorageKeys(ctx context.Context, resourceGroupName string, accountName string, parameters media.SyncStorageKeysInput) (result autorest.Response, err error) Update(ctx context.Context, resourceGroupName string, accountName string, parameters media.Service) (result media.Service, err error) } diff --git a/services/mediaservices/mgmt/2018-07-01/media/mediaservices.go b/services/mediaservices/mgmt/2018-07-01/media/mediaservices.go index 851bc9314877..44785c1d8c95 100644 --- a/services/mediaservices/mgmt/2018-07-01/media/mediaservices.go +++ b/services/mediaservices/mgmt/2018-07-01/media/mediaservices.go @@ -566,6 +566,85 @@ func (client MediaservicesClient) ListBySubscriptionComplete(ctx context.Context return } +// ListEdgePolicies list the media edge policies associated with the Media Services account. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// parameters - the request parameters +func (client MediaservicesClient) ListEdgePolicies(ctx context.Context, resourceGroupName string, accountName string, parameters ListEdgePoliciesInput) (result EdgePolicies, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MediaservicesClient.ListEdgePolicies") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListEdgePoliciesPreparer(ctx, resourceGroupName, accountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "ListEdgePolicies", nil, "Failure preparing request") + return + } + + resp, err := client.ListEdgePoliciesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "ListEdgePolicies", resp, "Failure sending request") + return + } + + result, err = client.ListEdgePoliciesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "ListEdgePolicies", resp, "Failure responding to request") + } + + return +} + +// ListEdgePoliciesPreparer prepares the ListEdgePolicies request. +func (client MediaservicesClient) ListEdgePoliciesPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters ListEdgePoliciesInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/listEdgePolicies", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListEdgePoliciesSender sends the ListEdgePolicies request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) ListEdgePoliciesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListEdgePoliciesResponder handles the response to the ListEdgePolicies request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) ListEdgePoliciesResponder(resp *http.Response) (result EdgePolicies, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // SyncStorageKeys synchronizes storage account keys for a storage account associated with the Media Service account. // Parameters: // resourceGroupName - the name of the resource group within the Azure subscription. diff --git a/services/mediaservices/mgmt/2018-07-01/media/models.go b/services/mediaservices/mgmt/2018-07-01/media/models.go index cd29ffc08fa5..3000538b8799 100644 --- a/services/mediaservices/mgmt/2018-07-01/media/models.go +++ b/services/mediaservices/mgmt/2018-07-01/media/models.go @@ -4493,6 +4493,34 @@ type Deinterlace struct { Mode DeinterlaceMode `json:"mode,omitempty"` } +// EdgePolicies ... +type EdgePolicies struct { + autorest.Response `json:"-"` + UsageDataCollectionPolicy *EdgeUsageDataCollectionPolicy `json:"usageDataCollectionPolicy,omitempty"` +} + +// EdgeUsageDataCollectionPolicy ... +type EdgeUsageDataCollectionPolicy struct { + // DataCollectionFrequency - Usage data collection frequency in ISO 8601 duration format e.g. PT10M , PT5H. + DataCollectionFrequency *string `json:"dataCollectionFrequency,omitempty"` + // DataReportingFrequency - Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , PT5H. + DataReportingFrequency *string `json:"dataReportingFrequency,omitempty"` + // MaxAllowedUnreportedUsageDuration - Maximum time for which the functionality of the device will not be hampered for not reporting the usage data. + MaxAllowedUnreportedUsageDuration *string `json:"maxAllowedUnreportedUsageDuration,omitempty"` + // EventHubDetails - Details of Event Hub where the usage will be reported. + EventHubDetails *EdgeUsageDataEventHub `json:"eventHubDetails,omitempty"` +} + +// EdgeUsageDataEventHub ... +type EdgeUsageDataEventHub struct { + // Name - Name of the Event Hub where usage will be reported. + Name *string `json:"name,omitempty"` + // Namespace - Namespace of the Event Hub where usage will be reported. + Namespace *string `json:"namespace,omitempty"` + // Token - SAS token needed to interact with Event Hub. + Token *string `json:"token,omitempty"` +} + // EnabledProtocols class to specify which protocols are enabled type EnabledProtocols struct { // Download - Enable Download protocol or not @@ -6959,6 +6987,12 @@ type ListContentKeysResponse struct { ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"` } +// ListEdgePoliciesInput ... +type ListEdgePoliciesInput struct { + // DeviceID - Unique identifier of the edge device. + DeviceID *string `json:"deviceId,omitempty"` +} + // ListPathsResponse class of response for listPaths action type ListPathsResponse struct { autorest.Response `json:"-"` diff --git a/services/mediaservices/mgmt/2018-07-01/media/version.go b/services/mediaservices/mgmt/2018-07-01/media/version.go index 9e4f1d9a5da1..65148870fa77 100644 --- a/services/mediaservices/mgmt/2018-07-01/media/version.go +++ b/services/mediaservices/mgmt/2018-07-01/media/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " media/2018-07-01" + return "Azure-SDK-For-Go/" + Version() + " media/2018-07-01" } // Version returns the semantic version (see http://semver.org) of the client.