diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md b/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md index 28abca78e56c..9ede059dd157 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md +++ b/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md @@ -1,5 +1,53 @@ # Release History +## 3.1.0 (2022-09-01) +### Features Added + +- New const `AsyncOperationStatusInProgress` +- New const `SecurityLevelSL150` +- New const `AsyncOperationStatusSucceeded` +- New const `SecurityLevelUnknown` +- New const `AsyncOperationStatusFailed` +- New const `SecurityLevelSL3000` +- New const `SecurityLevelSL2000` +- New type alias `AsyncOperationStatus` +- New type alias `SecurityLevel` +- New function `*LiveEventsClient.OperationLocation(context.Context, string, string, string, string, *LiveEventsClientOperationLocationOptions) (LiveEventsClientOperationLocationResponse, error)` +- New function `*LiveOutputsClient.OperationLocation(context.Context, string, string, string, string, string, *LiveOutputsClientOperationLocationOptions) (LiveOutputsClientOperationLocationResponse, error)` +- New function `*StreamingEndpointsClient.OperationLocation(context.Context, string, string, string, string, *StreamingEndpointsClientOperationLocationOptions) (StreamingEndpointsClientOperationLocationResponse, error)` +- New function `*LiveOutputsClient.AsyncOperation(context.Context, string, string, string, *LiveOutputsClientAsyncOperationOptions) (LiveOutputsClientAsyncOperationResponse, error)` +- New function `PossibleAsyncOperationStatusValues() []AsyncOperationStatus` +- New function `*StreamingEndpointsClient.AsyncOperation(context.Context, string, string, string, *StreamingEndpointsClientAsyncOperationOptions) (StreamingEndpointsClientAsyncOperationResponse, error)` +- New function `PossibleSecurityLevelValues() []SecurityLevel` +- New function `*LiveEventsClient.AsyncOperation(context.Context, string, string, string, *LiveEventsClientAsyncOperationOptions) (LiveEventsClientAsyncOperationResponse, error)` +- New struct `AsyncOperationResult` +- New struct `ClearKeyEncryptionConfiguration` +- New struct `DashSettings` +- New struct `LiveEventsClientAsyncOperationOptions` +- New struct `LiveEventsClientAsyncOperationResponse` +- New struct `LiveEventsClientOperationLocationOptions` +- New struct `LiveEventsClientOperationLocationResponse` +- New struct `LiveOutputsClientAsyncOperationOptions` +- New struct `LiveOutputsClientAsyncOperationResponse` +- New struct `LiveOutputsClientOperationLocationOptions` +- New struct `LiveOutputsClientOperationLocationResponse` +- New struct `StreamingEndpointsClientAsyncOperationOptions` +- New struct `StreamingEndpointsClientAsyncOperationResponse` +- New struct `StreamingEndpointsClientOperationLocationOptions` +- New struct `StreamingEndpointsClientOperationLocationResponse` +- New field `FileName` in struct `AudioTrack` +- New field `HlsSettings` in struct `AudioTrack` +- New field `LanguageCode` in struct `AudioTrack` +- New field `Mpeg4TrackID` in struct `AudioTrack` +- New field `BitRate` in struct `AudioTrack` +- New field `DashSettings` in struct `AudioTrack` +- New field `DisplayName` in struct `AudioTrack` +- New field `RewindWindowLength` in struct `LiveOutputProperties` +- New field `ClearKeyEncryptionConfiguration` in struct `CommonEncryptionCbcs` +- New field `SecurityLevel` in struct `ContentKeyPolicyPlayReadyLicense` +- New field `ClearKeyEncryptionConfiguration` in struct `CommonEncryptionCenc` + + ## 3.0.0 (2022-06-24) ### Breaking Changes diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go index 6b42b6fbde46..8a6d44ce08c5 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go @@ -57,7 +57,7 @@ func NewAccountFiltersClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates or updates an Account Filter in the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // filterName - The Account Filter name @@ -103,7 +103,7 @@ func (client *AccountFiltersClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +120,7 @@ func (client *AccountFiltersClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes an Account Filter in the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // filterName - The Account Filter name @@ -164,7 +164,7 @@ func (client *AccountFiltersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +172,7 @@ func (client *AccountFiltersClient) deleteCreateRequest(ctx context.Context, res // Get - Get the details of an Account Filter in the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // filterName - The Account Filter name @@ -216,7 +216,7 @@ func (client *AccountFiltersClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,7 +233,7 @@ func (client *AccountFiltersClient) getHandleResponse(resp *http.Response) (Acco // NewListPager - List Account Filters in the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // options - AccountFiltersClientListOptions contains the optional parameters for the AccountFiltersClient.List method. @@ -285,7 +285,7 @@ func (client *AccountFiltersClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,7 +302,7 @@ func (client *AccountFiltersClient) listHandleResponse(resp *http.Response) (Acc // Update - Updates an existing Account Filter in the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // filterName - The Account Filter name @@ -347,7 +347,7 @@ func (client *AccountFiltersClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client_example_test.go deleted file mode 100644 index 2fa5f2c9bc16..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client_example_test.go +++ /dev/null @@ -1,196 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accountFilters-list-all.json -func ExampleAccountFiltersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", - "contosomedia", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accountFilters-get-by-name.json -func ExampleAccountFiltersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosomedia", - "accountFilterWithTrack", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accountFilters-create.json -func ExampleAccountFiltersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "contoso", - "contosomedia", - "newAccountFilter", - armmediaservices.AccountFilter{ - Properties: &armmediaservices.MediaFilterProperties{ - FirstQuality: &armmediaservices.FirstQuality{ - Bitrate: to.Ptr[int32](128000), - }, - PresentationTimeRange: &armmediaservices.PresentationTimeRange{ - EndTimestamp: to.Ptr[int64](170000000), - ForceEndTimestamp: to.Ptr(false), - LiveBackoffDuration: to.Ptr[int64](0), - PresentationWindowDuration: to.Ptr[int64](9223372036854775000), - StartTimestamp: to.Ptr[int64](0), - Timescale: to.Ptr[int64](10000000), - }, - Tracks: []*armmediaservices.FilterTrackSelection{ - { - TrackSelections: []*armmediaservices.FilterTrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeType), - Value: to.Ptr("Audio"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationNotEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeLanguage), - Value: to.Ptr("en"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationNotEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeFourCC), - Value: to.Ptr("EC-3"), - }}, - }, - { - TrackSelections: []*armmediaservices.FilterTrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeType), - Value: to.Ptr("Video"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeBitrate), - Value: to.Ptr("3000000-5000000"), - }}, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accountFilters-delete.json -func ExampleAccountFiltersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contoso", - "contosomedia", - "accountFilterWithTimeWindowAndTrack", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accountFilters-update.json -func ExampleAccountFiltersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "contoso", - "contosomedia", - "accountFilterWithTimeWindowAndTrack", - armmediaservices.AccountFilter{ - Properties: &armmediaservices.MediaFilterProperties{ - FirstQuality: &armmediaservices.FirstQuality{ - Bitrate: to.Ptr[int32](128000), - }, - PresentationTimeRange: &armmediaservices.PresentationTimeRange{ - EndTimestamp: to.Ptr[int64](170000000), - ForceEndTimestamp: to.Ptr(false), - LiveBackoffDuration: to.Ptr[int64](0), - PresentationWindowDuration: to.Ptr[int64](9223372036854775000), - StartTimestamp: to.Ptr[int64](10), - Timescale: to.Ptr[int64](10000000), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go index bd44a3ea5c82..aa4270f2f97f 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go @@ -57,7 +57,7 @@ func NewAssetFiltersClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Creates or updates an Asset Filter associated with the specified Asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -108,7 +108,7 @@ func (client *AssetFiltersClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,7 +125,7 @@ func (client *AssetFiltersClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes an Asset Filter associated with the specified Asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -174,7 +174,7 @@ func (client *AssetFiltersClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *AssetFiltersClient) deleteCreateRequest(ctx context.Context, resou // Get - Get the details of an Asset Filter associated with the specified Asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -231,7 +231,7 @@ func (client *AssetFiltersClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *AssetFiltersClient) getHandleResponse(resp *http.Response) (AssetF // NewListPager - List Asset Filters associated with the specified Asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -305,7 +305,7 @@ func (client *AssetFiltersClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +322,7 @@ func (client *AssetFiltersClient) listHandleResponse(resp *http.Response) (Asset // Update - Updates an existing Asset Filter associated with the specified Asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -372,7 +372,7 @@ func (client *AssetFiltersClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client_example_test.go deleted file mode 100644 index 07366f7f5ffe..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client_example_test.go +++ /dev/null @@ -1,201 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assetFilters-list-all.json -func ExampleAssetFiltersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", - "contosomedia", - "ClimbingMountRainer", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assetFilters-get-by-name.json -func ExampleAssetFiltersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "assetFilterWithTimeWindowAndTrack", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assetFilters-create.json -func ExampleAssetFiltersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "newAssetFilter", - armmediaservices.AssetFilter{ - Properties: &armmediaservices.MediaFilterProperties{ - FirstQuality: &armmediaservices.FirstQuality{ - Bitrate: to.Ptr[int32](128000), - }, - PresentationTimeRange: &armmediaservices.PresentationTimeRange{ - EndTimestamp: to.Ptr[int64](170000000), - ForceEndTimestamp: to.Ptr(false), - LiveBackoffDuration: to.Ptr[int64](0), - PresentationWindowDuration: to.Ptr[int64](9223372036854775000), - StartTimestamp: to.Ptr[int64](0), - Timescale: to.Ptr[int64](10000000), - }, - Tracks: []*armmediaservices.FilterTrackSelection{ - { - TrackSelections: []*armmediaservices.FilterTrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeType), - Value: to.Ptr("Audio"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationNotEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeLanguage), - Value: to.Ptr("en"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationNotEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeFourCC), - Value: to.Ptr("EC-3"), - }}, - }, - { - TrackSelections: []*armmediaservices.FilterTrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeType), - Value: to.Ptr("Video"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeBitrate), - Value: to.Ptr("3000000-5000000"), - }}, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assetFilters-delete.json -func ExampleAssetFiltersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "assetFilterWithTimeWindowAndTrack", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assetFilters-update.json -func ExampleAssetFiltersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "assetFilterWithTimeWindowAndTrack", - armmediaservices.AssetFilter{ - Properties: &armmediaservices.MediaFilterProperties{ - FirstQuality: &armmediaservices.FirstQuality{ - Bitrate: to.Ptr[int32](128000), - }, - PresentationTimeRange: &armmediaservices.PresentationTimeRange{ - EndTimestamp: to.Ptr[int64](170000000), - ForceEndTimestamp: to.Ptr(false), - LiveBackoffDuration: to.Ptr[int64](0), - PresentationWindowDuration: to.Ptr[int64](9223372036854775000), - StartTimestamp: to.Ptr[int64](10), - Timescale: to.Ptr[int64](10000000), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go index 479ba3815e49..a757ca1b0a98 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go @@ -58,7 +58,7 @@ func NewAssetsClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or updates an Asset in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -103,7 +103,7 @@ func (client *AssetsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +120,7 @@ func (client *AssetsClient) createOrUpdateHandleResponse(resp *http.Response) (A // Delete - Deletes an Asset in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -164,7 +164,7 @@ func (client *AssetsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +172,7 @@ func (client *AssetsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get the details of an Asset in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -216,7 +216,7 @@ func (client *AssetsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *AssetsClient) getHandleResponse(resp *http.Response) (AssetsClient // GetEncryptionKey - Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services // API // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -278,7 +278,7 @@ func (client *AssetsClient) getEncryptionKeyCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -295,7 +295,7 @@ func (client *AssetsClient) getEncryptionKeyHandleResponse(resp *http.Response) // NewListPager - List Assets in the Media Services account with optional filtering and ordering // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // options - AssetsClientListOptions contains the optional parameters for the AssetsClient.List method. @@ -347,7 +347,7 @@ func (client *AssetsClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -374,7 +374,7 @@ func (client *AssetsClient) listHandleResponse(resp *http.Response) (AssetsClien // ListContainerSas - Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset // content. The signatures are derived from the storage account keys. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -419,7 +419,7 @@ func (client *AssetsClient) listContainerSasCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -436,7 +436,7 @@ func (client *AssetsClient) listContainerSasHandleResponse(resp *http.Response) // ListStreamingLocators - Lists Streaming Locators which are associated with this asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -481,7 +481,7 @@ func (client *AssetsClient) listStreamingLocatorsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -498,7 +498,7 @@ func (client *AssetsClient) listStreamingLocatorsHandleResponse(resp *http.Respo // Update - Updates an existing Asset in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -543,7 +543,7 @@ func (client *AssetsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assets_client_example_test.go deleted file mode 100644 index c3e922d35990..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client_example_test.go +++ /dev/null @@ -1,223 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assets-list-in-date-range.json -func ExampleAssetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", - "contosomedia", - &armmediaservices.AssetsClientListOptions{Filter: to.Ptr("properties/created gt 2012-06-01 and properties/created lt 2013-07-01"), - Top: nil, - Orderby: to.Ptr("properties/created"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assets-get-by-name.json -func ExampleAssetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosomedia", - "ClimbingMountAdams", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assets-create.json -func ExampleAssetsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "contoso", - "contosomedia", - "ClimbingMountLogan", - armmediaservices.Asset{ - Properties: &armmediaservices.AssetProperties{ - Description: to.Ptr("A documentary showing the ascent of Mount Logan"), - StorageAccountName: to.Ptr("storage0"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assets-delete.json -func ExampleAssetsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contoso", - "contosomedia", - "ClimbingMountAdams", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assets-update.json -func ExampleAssetsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "contoso", - "contosomedia", - "ClimbingMountBaker", - armmediaservices.Asset{ - Properties: &armmediaservices.AssetProperties{ - Description: to.Ptr("A documentary showing the ascent of Mount Baker in HD"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assets-list-sas-urls.json -func ExampleAssetsClient_ListContainerSas() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListContainerSas(ctx, - "contoso", - "contosomedia", - "ClimbingMountBaker", - armmediaservices.ListContainerSasInput{ - ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T10:00:00.007Z"); return t }()), - Permissions: to.Ptr(armmediaservices.AssetContainerPermissionReadWrite), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assets-get-encryption-keys.json -func ExampleAssetsClient_GetEncryptionKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetEncryptionKey(ctx, - "contoso", - "contosomedia", - "ClimbingMountSaintHelens", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/assets-list-streaming-locators.json -func ExampleAssetsClient_ListStreamingLocators() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListStreamingLocators(ctx, - "contoso", - "contosomedia", - "ClimbingMountSaintHelens", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go index 65534a5e6792..5112c1fc2a74 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go @@ -58,7 +58,7 @@ func NewAssetTrackOperationResultsClient(subscriptionID string, credential azcor // Get - Get asset track operation result. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -113,7 +113,7 @@ func (client *AssetTrackOperationResultsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client_example_test.go deleted file mode 100644 index 670414cb55bb..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client_example_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/asset-tracks-operation-result-by-id.json -func ExampleAssetTrackOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetTrackOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "text1", - "e78f8d40-7aaa-4f2f-8ae6-73987e7c5a08", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go index 83daf50035ac..b0b154abc42e 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go @@ -57,7 +57,7 @@ func NewAssetTrackOperationStatusesClient(subscriptionID string, credential azco // Get - Get asset track operation status. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -112,7 +112,7 @@ func (client *AssetTrackOperationStatusesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client_example_test.go deleted file mode 100644 index 330d93cafc48..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client_example_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json -func ExampleAssetTrackOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetTrackOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "text1", - "86835197-3b47-402e-b313-70b82eaba296", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/autorest.md b/sdk/resourcemanager/mediaservices/armmediaservices/autorest.md index 4f54a80d4bcc..031bc37fce32 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/autorest.md +++ b/sdk/resourcemanager/mediaservices/armmediaservices/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/42ca0236ef14093f5aff0694efa34d5594e814a0/specification/mediaservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/42ca0236ef14093f5aff0694efa34d5594e814a0/specification/mediaservices/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mediaservices/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mediaservices/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.0.0 +module-version: 3.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/constants.go b/sdk/resourcemanager/mediaservices/armmediaservices/constants.go index 975b13717ffa..17b35bb8ccb6 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/constants.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/constants.go @@ -11,7 +11,7 @@ package armmediaservices const ( moduleName = "armmediaservices" - moduleVersion = "v3.0.0" + moduleVersion = "v3.1.0" ) // AacAudioProfile - The encoding profile to be used when encoding audio with AAC. @@ -131,6 +131,24 @@ func PossibleAssetStorageEncryptionFormatValues() []AssetStorageEncryptionFormat } } +// AsyncOperationStatus - Operation status of the async operation. +type AsyncOperationStatus string + +const ( + AsyncOperationStatusFailed AsyncOperationStatus = "Failed" + AsyncOperationStatusInProgress AsyncOperationStatus = "InProgress" + AsyncOperationStatusSucceeded AsyncOperationStatus = "Succeeded" +) + +// PossibleAsyncOperationStatusValues returns the possible values for the AsyncOperationStatus const type. +func PossibleAsyncOperationStatusValues() []AsyncOperationStatus { + return []AsyncOperationStatus{ + AsyncOperationStatusFailed, + AsyncOperationStatusInProgress, + AsyncOperationStatusSucceeded, + } +} + // AttributeFilter - The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. type AttributeFilter string @@ -1284,6 +1302,30 @@ func PossibleRotationValues() []Rotation { } } +// SecurityLevel - The security level. +type SecurityLevel string + +const ( + // SecurityLevelSL150 - For clients under development or test. No protection against unauthorized use. + SecurityLevelSL150 SecurityLevel = "SL150" + // SecurityLevelSL2000 - For hardened devices and applications consuming commercial content. Software or hardware protection. + SecurityLevelSL2000 SecurityLevel = "SL2000" + // SecurityLevelSL3000 - For hardened devices only. Hardware protection. + SecurityLevelSL3000 SecurityLevel = "SL3000" + // SecurityLevelUnknown - Represents a SecurityLevel that is unavailable in current API version. + SecurityLevelUnknown SecurityLevel = "Unknown" +) + +// PossibleSecurityLevelValues returns the possible values for the SecurityLevel const type. +func PossibleSecurityLevelValues() []SecurityLevel { + return []SecurityLevel{ + SecurityLevelSL150, + SecurityLevelSL2000, + SecurityLevelSL3000, + SecurityLevelUnknown, + } +} + // StorageAccountType - The type of the storage account. type StorageAccountType string diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go index 79b11992a644..1380356e1c9a 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go @@ -58,7 +58,7 @@ func NewContentKeyPoliciesClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Create or update a Content Key Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // contentKeyPolicyName - The Content Key Policy name. @@ -104,7 +104,7 @@ func (client *ContentKeyPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,7 @@ func (client *ContentKeyPoliciesClient) createOrUpdateHandleResponse(resp *http. // Delete - Deletes a Content Key Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // contentKeyPolicyName - The Content Key Policy name. @@ -166,7 +166,7 @@ func (client *ContentKeyPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +174,7 @@ func (client *ContentKeyPoliciesClient) deleteCreateRequest(ctx context.Context, // Get - Get the details of a Content Key Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // contentKeyPolicyName - The Content Key Policy name. @@ -218,7 +218,7 @@ func (client *ContentKeyPoliciesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,7 @@ func (client *ContentKeyPoliciesClient) getHandleResponse(resp *http.Response) ( // GetPolicyPropertiesWithSecrets - Get a Content Key Policy including secret values // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // contentKeyPolicyName - The Content Key Policy name. @@ -280,7 +280,7 @@ func (client *ContentKeyPoliciesClient) getPolicyPropertiesWithSecretsCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -297,7 +297,7 @@ func (client *ContentKeyPoliciesClient) getPolicyPropertiesWithSecretsHandleResp // NewListPager - Lists the Content Key Policies in the account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // options - ContentKeyPoliciesClientListOptions contains the optional parameters for the ContentKeyPoliciesClient.List method. @@ -349,7 +349,7 @@ func (client *ContentKeyPoliciesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -375,7 +375,7 @@ func (client *ContentKeyPoliciesClient) listHandleResponse(resp *http.Response) // Update - Updates an existing Content Key Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // contentKeyPolicyName - The Content Key Policy name. @@ -421,7 +421,7 @@ func (client *ContentKeyPoliciesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client_example_test.go deleted file mode 100644 index 8812779e26d4..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client_example_test.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/content-key-policies-list-by-lastModified.json -func ExampleContentKeyPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", - "contosomedia", - &armmediaservices.ContentKeyPoliciesClientListOptions{Filter: nil, - Top: nil, - Orderby: to.Ptr("properties/lastModified"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/content-key-policies-get-by-name.json -func ExampleContentKeyPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosomedia", - "PolicyWithMultipleOptions", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/content-key-policies-create-nodrm-token.json -func ExampleContentKeyPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "contoso", - "contosomedia", - "PolicyWithClearKeyOptionAndSwtTokenRestriction", - armmediaservices.ContentKeyPolicy{ - Properties: &armmediaservices.ContentKeyPolicyProperties{ - Description: to.Ptr("ArmPolicyDescription"), - Options: []*armmediaservices.ContentKeyPolicyOption{ - { - Name: to.Ptr("ClearKeyOption"), - Configuration: &armmediaservices.ContentKeyPolicyClearKeyConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"), - }, - Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"), - Audience: to.Ptr("urn:audience"), - Issuer: to.Ptr("urn:issuer"), - PrimaryVerificationKey: &armmediaservices.ContentKeyPolicySymmetricTokenKey{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"), - KeyValue: []byte("AAAAAAAAAAAAAAAAAAAAAA=="), - }, - RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeSwt), - }, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/content-key-policies-delete.json -func ExampleContentKeyPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contoso", - "contosomedia", - "PolicyWithPlayReadyOptionAndOpenRestriction", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/content-key-policies-update.json -func ExampleContentKeyPoliciesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "contoso", - "contosomedia", - "PolicyWithClearKeyOptionAndTokenRestriction", - armmediaservices.ContentKeyPolicy{ - Properties: &armmediaservices.ContentKeyPolicyProperties{ - Description: to.Ptr("Updated Policy"), - Options: []*armmediaservices.ContentKeyPolicyOption{ - { - Name: to.Ptr("ClearKeyOption"), - Configuration: &armmediaservices.ContentKeyPolicyClearKeyConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"), - }, - Restriction: &armmediaservices.ContentKeyPolicyOpenRestriction{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyOpenRestriction"), - }, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/content-key-policies-get-with-secrets.json -func ExampleContentKeyPoliciesClient_GetPolicyPropertiesWithSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetPolicyPropertiesWithSecrets(ctx, - "contoso", - "contosomedia", - "PolicyWithMultipleOptions", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/go.mod b/sdk/resourcemanager/mediaservices/armmediaservices/go.mod index 5622f304be8f..47b810361a51 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/go.mod +++ b/sdk/resourcemanager/mediaservices/armmediaservices/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armme go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/go.sum b/sdk/resourcemanager/mediaservices/armmediaservices/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/go.sum +++ b/sdk/resourcemanager/mediaservices/armmediaservices/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client_example_test.go deleted file mode 100644 index 5b9356e0f0bb..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client_example_test.go +++ /dev/null @@ -1,193 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-created.json -func ExampleJobsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", - "contosomedia", - "exampleTransform", - &armmediaservices.JobsClientListOptions{Filter: to.Ptr("properties/created ge 2021-11-01T00:00:10.0000000Z and properties/created le 2021-11-01T00:00:20.0000000Z"), - Orderby: to.Ptr("properties/created"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-get-by-name.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contosoresources", - "contosomedia", - "exampleTransform", - "job1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-create.json -func ExampleJobsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, - "contosoresources", - "contosomedia", - "exampleTransform", - "job1", - armmediaservices.Job{ - Properties: &armmediaservices.JobProperties{ - CorrelationData: map[string]*string{ - "Key 2": to.Ptr("Value 2"), - "key1": to.Ptr("value1"), - }, - Input: &armmediaservices.JobInputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobInputAsset"), - AssetName: to.Ptr("job1-InputAsset"), - }, - Outputs: []armmediaservices.JobOutputClassification{ - &armmediaservices.JobOutputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobOutputAsset"), - AssetName: to.Ptr("job1-OutputAsset"), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-delete.json -func ExampleJobsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contosoresources", - "contosomedia", - "exampleTransform", - "jobToDelete", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-update.json -func ExampleJobsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "contosoresources", - "contosomedia", - "exampleTransform", - "job1", - armmediaservices.Job{ - Properties: &armmediaservices.JobProperties{ - Description: to.Ptr("Example job to illustrate update."), - Input: &armmediaservices.JobInputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobInputAsset"), - AssetName: to.Ptr("job1-InputAsset"), - }, - Outputs: []armmediaservices.JobOutputClassification{ - &armmediaservices.JobOutputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobOutputAsset"), - AssetName: to.Ptr("job1-OutputAsset"), - }}, - Priority: to.Ptr(armmediaservices.PriorityHigh), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-cancel.json -func ExampleJobsClient_CancelJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CancelJob(ctx, - "contosoresources", - "contosomedia", - "exampleTransform", - "job1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go index 3f9a22771c31..e140c0d26c5a 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go @@ -58,7 +58,7 @@ func NewLiveEventsClient(subscriptionID string, credential azcore.TokenCredentia // BeginAllocate - A live event is in StandBy state after allocation completes, and is ready to start. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -78,7 +78,7 @@ func (client *LiveEventsClient) BeginAllocate(ctx context.Context, resourceGroup // Allocate - A live event is in StandBy state after allocation completes, and is ready to start. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *LiveEventsClient) allocate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginAllocateOptions) (*http.Response, error) { req, err := client.allocateCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -118,15 +118,77 @@ func (client *LiveEventsClient) allocateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// AsyncOperation - Get a live event operation status. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-08-01 +// resourceGroupName - The name of the resource group within the Azure subscription. +// accountName - The Media Services account name. +// operationID - The ID of an ongoing async operation. +// options - LiveEventsClientAsyncOperationOptions contains the optional parameters for the LiveEventsClient.AsyncOperation +// method. +func (client *LiveEventsClient) AsyncOperation(ctx context.Context, resourceGroupName string, accountName string, operationID string, options *LiveEventsClientAsyncOperationOptions) (LiveEventsClientAsyncOperationResponse, error) { + req, err := client.asyncOperationCreateRequest(ctx, resourceGroupName, accountName, operationID, options) + if err != nil { + return LiveEventsClientAsyncOperationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LiveEventsClientAsyncOperationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LiveEventsClientAsyncOperationResponse{}, runtime.NewResponseError(resp) + } + return client.asyncOperationHandleResponse(resp) +} + +// asyncOperationCreateRequest creates the AsyncOperation request. +func (client *LiveEventsClient) asyncOperationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, operationID string, options *LiveEventsClientAsyncOperationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEventOperations/{operationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// asyncOperationHandleResponse handles the AsyncOperation response. +func (client *LiveEventsClient) asyncOperationHandleResponse(resp *http.Response) (LiveEventsClientAsyncOperationResponse, error) { + result := LiveEventsClientAsyncOperationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AsyncOperationResult); err != nil { + return LiveEventsClientAsyncOperationResponse{}, err + } + return result, nil +} + // BeginCreate - Creates a new live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -146,7 +208,7 @@ func (client *LiveEventsClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Creates a new live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *LiveEventsClient) create(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, options *LiveEventsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, liveEventName, parameters, options) if err != nil { @@ -186,7 +248,7 @@ func (client *LiveEventsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AutoStart != nil { reqQP.Set("autoStart", strconv.FormatBool(*options.AutoStart)) } @@ -197,7 +259,7 @@ func (client *LiveEventsClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Deletes a live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -216,7 +278,7 @@ func (client *LiveEventsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *LiveEventsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -256,7 +318,7 @@ func (client *LiveEventsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +326,7 @@ func (client *LiveEventsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets properties of a live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -308,7 +370,7 @@ func (client *LiveEventsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +387,7 @@ func (client *LiveEventsClient) getHandleResponse(resp *http.Response) (LiveEven // NewListPager - Lists all the live events in the account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // options - LiveEventsClientListOptions contains the optional parameters for the LiveEventsClient.List method. @@ -377,7 +439,7 @@ func (client *LiveEventsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,11 +454,78 @@ func (client *LiveEventsClient) listHandleResponse(resp *http.Response) (LiveEve return result, nil } +// OperationLocation - Get a live event operation status. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-08-01 +// resourceGroupName - The name of the resource group within the Azure subscription. +// accountName - The Media Services account name. +// liveEventName - The name of the live event, maximum length is 32. +// operationID - The ID of an ongoing async operation. +// options - LiveEventsClientOperationLocationOptions contains the optional parameters for the LiveEventsClient.OperationLocation +// method. +func (client *LiveEventsClient) OperationLocation(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, operationID string, options *LiveEventsClientOperationLocationOptions) (LiveEventsClientOperationLocationResponse, error) { + req, err := client.operationLocationCreateRequest(ctx, resourceGroupName, accountName, liveEventName, operationID, options) + if err != nil { + return LiveEventsClientOperationLocationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LiveEventsClientOperationLocationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return LiveEventsClientOperationLocationResponse{}, runtime.NewResponseError(resp) + } + return client.operationLocationHandleResponse(resp) +} + +// operationLocationCreateRequest creates the OperationLocation request. +func (client *LiveEventsClient) operationLocationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, operationID string, options *LiveEventsClientOperationLocationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/operationLocations/{operationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if liveEventName == "" { + return nil, errors.New("parameter liveEventName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{liveEventName}", url.PathEscape(liveEventName)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// operationLocationHandleResponse handles the OperationLocation response. +func (client *LiveEventsClient) operationLocationHandleResponse(resp *http.Response) (LiveEventsClientOperationLocationResponse, error) { + result := LiveEventsClientOperationLocationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LiveEvent); err != nil { + return LiveEventsClientOperationLocationResponse{}, err + } + return result, nil +} + // BeginReset - 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. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -417,7 +546,7 @@ func (client *LiveEventsClient) BeginReset(ctx context.Context, resourceGroupNam // will be started again. All assets used by the live outputs and streaming locators // created on these assets are unaffected. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *LiveEventsClient) reset(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginResetOptions) (*http.Response, error) { req, err := client.resetCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -457,7 +586,7 @@ func (client *LiveEventsClient) resetCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,7 +594,7 @@ func (client *LiveEventsClient) resetCreateRequest(ctx context.Context, resource // BeginStart - A live event in Stopped or StandBy state will be in Running state after the start operation completes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -484,7 +613,7 @@ func (client *LiveEventsClient) BeginStart(ctx context.Context, resourceGroupNam // Start - A live event in Stopped or StandBy state will be in Running state after the start operation completes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *LiveEventsClient) start(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -524,7 +653,7 @@ func (client *LiveEventsClient) startCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -532,7 +661,7 @@ func (client *LiveEventsClient) startCreateRequest(ctx context.Context, resource // BeginStop - Stops a running live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -552,7 +681,7 @@ func (client *LiveEventsClient) BeginStop(ctx context.Context, resourceGroupName // Stop - Stops a running live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *LiveEventsClient) stop(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEventActionInput, options *LiveEventsClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, accountName, liveEventName, parameters, options) if err != nil { @@ -592,7 +721,7 @@ func (client *LiveEventsClient) stopCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -600,7 +729,7 @@ func (client *LiveEventsClient) stopCreateRequest(ctx context.Context, resourceG // BeginUpdate - Updates settings on an existing live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -620,7 +749,7 @@ func (client *LiveEventsClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates settings on an existing live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *LiveEventsClient) update(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, options *LiveEventsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, liveEventName, parameters, options) if err != nil { @@ -660,7 +789,7 @@ func (client *LiveEventsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client_example_test.go deleted file mode 100644 index 6c82f2b996da..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client_example_test.go +++ /dev/null @@ -1,320 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveevent-list-all.json -func ExampleLiveEventsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("mediaresources", - "slitestmedia10", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveevent-list-by-name.json -func ExampleLiveEventsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveevent-create.json -func ExampleLiveEventsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - armmediaservices.LiveEvent{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armmediaservices.LiveEventProperties{ - Description: to.Ptr("test event 1"), - Input: &armmediaservices.LiveEventInput{ - AccessControl: &armmediaservices.LiveEventInputAccessControl{ - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowAll"), - Address: to.Ptr("0.0.0.0"), - SubnetPrefixLength: to.Ptr[int32](0), - }}, - }, - }, - KeyFrameIntervalDuration: to.Ptr("PT6S"), - StreamingProtocol: to.Ptr(armmediaservices.LiveEventInputProtocolRTMP), - }, - Preview: &armmediaservices.LiveEventPreview{ - AccessControl: &armmediaservices.LiveEventPreviewAccessControl{ - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowAll"), - Address: to.Ptr("0.0.0.0"), - SubnetPrefixLength: to.Ptr[int32](0), - }}, - }, - }, - }, - }, - }, - &armmediaservices.LiveEventsClientBeginCreateOptions{AutoStart: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveevent-update.json -func ExampleLiveEventsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - armmediaservices.LiveEvent{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - "tag3": to.Ptr("value3"), - }, - Properties: &armmediaservices.LiveEventProperties{ - Description: to.Ptr("test event updated"), - Input: &armmediaservices.LiveEventInput{ - AccessControl: &armmediaservices.LiveEventInputAccessControl{ - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowOne"), - Address: to.Ptr("192.1.1.0"), - }}, - }, - }, - KeyFrameIntervalDuration: to.Ptr("PT6S"), - StreamingProtocol: to.Ptr(armmediaservices.LiveEventInputProtocolFragmentedMP4), - }, - Preview: &armmediaservices.LiveEventPreview{ - AccessControl: &armmediaservices.LiveEventPreviewAccessControl{ - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowOne"), - Address: to.Ptr("192.1.1.0"), - }}, - }, - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveevent-delete.json -func ExampleLiveEventsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveevent-allocate.json -func ExampleLiveEventsClient_BeginAllocate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAllocate(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveevent-start.json -func ExampleLiveEventsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveevent-stop.json -func ExampleLiveEventsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - armmediaservices.LiveEventActionInput{ - RemoveOutputsOnStop: to.Ptr(false), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveevent-reset.json -func ExampleLiveEventsClient_BeginReset() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReset(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go index f902cc48122c..4817e9850dc7 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go @@ -55,9 +55,71 @@ func NewLiveOutputsClient(subscriptionID string, credential azcore.TokenCredenti return client, nil } +// AsyncOperation - Get a Live Output operation status. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-08-01 +// resourceGroupName - The name of the resource group within the Azure subscription. +// accountName - The Media Services account name. +// operationID - The ID of an ongoing async operation. +// options - LiveOutputsClientAsyncOperationOptions contains the optional parameters for the LiveOutputsClient.AsyncOperation +// method. +func (client *LiveOutputsClient) AsyncOperation(ctx context.Context, resourceGroupName string, accountName string, operationID string, options *LiveOutputsClientAsyncOperationOptions) (LiveOutputsClientAsyncOperationResponse, error) { + req, err := client.asyncOperationCreateRequest(ctx, resourceGroupName, accountName, operationID, options) + if err != nil { + return LiveOutputsClientAsyncOperationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LiveOutputsClientAsyncOperationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LiveOutputsClientAsyncOperationResponse{}, runtime.NewResponseError(resp) + } + return client.asyncOperationHandleResponse(resp) +} + +// asyncOperationCreateRequest creates the AsyncOperation request. +func (client *LiveOutputsClient) asyncOperationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, operationID string, options *LiveOutputsClientAsyncOperationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveOutputOperations/{operationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// asyncOperationHandleResponse handles the AsyncOperation response. +func (client *LiveOutputsClient) asyncOperationHandleResponse(resp *http.Response) (LiveOutputsClientAsyncOperationResponse, error) { + result := LiveOutputsClientAsyncOperationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AsyncOperationResult); err != nil { + return LiveOutputsClientAsyncOperationResponse{}, err + } + return result, nil +} + // BeginCreate - Creates a new live output. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -78,7 +140,7 @@ func (client *LiveOutputsClient) BeginCreate(ctx context.Context, resourceGroupN // Create - Creates a new live output. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *LiveOutputsClient) create(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, parameters LiveOutput, options *LiveOutputsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, parameters, options) if err != nil { @@ -122,7 +184,7 @@ func (client *LiveOutputsClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -130,7 +192,7 @@ func (client *LiveOutputsClient) createCreateRequest(ctx context.Context, resour // BeginDelete - Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -150,7 +212,7 @@ func (client *LiveOutputsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *LiveOutputsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, options *LiveOutputsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, options) if err != nil { @@ -194,7 +256,7 @@ func (client *LiveOutputsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +264,7 @@ func (client *LiveOutputsClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets a live output. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -251,7 +313,7 @@ func (client *LiveOutputsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +330,7 @@ func (client *LiveOutputsClient) getHandleResponse(resp *http.Response) (LiveOut // NewListPager - Lists the live outputs of a live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // liveEventName - The name of the live event, maximum length is 32. @@ -325,7 +387,7 @@ func (client *LiveOutputsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,3 +401,75 @@ func (client *LiveOutputsClient) listHandleResponse(resp *http.Response) (LiveOu } return result, nil } + +// OperationLocation - Get a Live Output operation status. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-08-01 +// resourceGroupName - The name of the resource group within the Azure subscription. +// accountName - The Media Services account name. +// liveEventName - The name of the live event, maximum length is 32. +// liveOutputName - The name of the live output. +// operationID - The ID of an ongoing async operation. +// options - LiveOutputsClientOperationLocationOptions contains the optional parameters for the LiveOutputsClient.OperationLocation +// method. +func (client *LiveOutputsClient) OperationLocation(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, operationID string, options *LiveOutputsClientOperationLocationOptions) (LiveOutputsClientOperationLocationResponse, error) { + req, err := client.operationLocationCreateRequest(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, operationID, options) + if err != nil { + return LiveOutputsClientOperationLocationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LiveOutputsClientOperationLocationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return LiveOutputsClientOperationLocationResponse{}, runtime.NewResponseError(resp) + } + return client.operationLocationHandleResponse(resp) +} + +// operationLocationCreateRequest creates the OperationLocation request. +func (client *LiveOutputsClient) operationLocationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, operationID string, options *LiveOutputsClientOperationLocationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/liveOutputs/{liveOutputName}/operationLocations/{operationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if liveEventName == "" { + return nil, errors.New("parameter liveEventName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{liveEventName}", url.PathEscape(liveEventName)) + if liveOutputName == "" { + return nil, errors.New("parameter liveOutputName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{liveOutputName}", url.PathEscape(liveOutputName)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// operationLocationHandleResponse handles the OperationLocation response. +func (client *LiveOutputsClient) operationLocationHandleResponse(resp *http.Response) (LiveOutputsClientOperationLocationResponse, error) { + result := LiveOutputsClientOperationLocationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LiveOutput); err != nil { + return LiveOutputsClientOperationLocationResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client_example_test.go deleted file mode 100644 index 72f9619ca286..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client_example_test.go +++ /dev/null @@ -1,134 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveoutput-list-all.json -func ExampleLiveOutputsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("mediaresources", - "slitestmedia10", - "myLiveEvent1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveoutput-list-by-name.json -func ExampleLiveOutputsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - "myLiveOutput1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveoutput-create.json -func ExampleLiveOutputsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - "myLiveOutput1", - armmediaservices.LiveOutput{ - Properties: &armmediaservices.LiveOutputProperties{ - Description: to.Ptr("test live output 1"), - ArchiveWindowLength: to.Ptr("PT5M"), - AssetName: to.Ptr("6f3264f5-a189-48b4-a29a-a40f22575212"), - Hls: &armmediaservices.Hls{ - FragmentsPerTsSegment: to.Ptr[int32](5), - }, - ManifestName: to.Ptr("testmanifest"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/liveoutput-delete.json -func ExampleLiveOutputsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "mediaresources", - "slitestmedia10", - "myLiveEvent1", - "myLiveOutput1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/locations_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/locations_client_example_test.go deleted file mode 100644 index 4b1cd37511d0..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/locations_client_example_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-check-name-availability.json -func ExampleLocationsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLocationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - "japanwest", - armmediaservices.CheckNameAvailabilityInput{ - Name: to.Ptr("contosotv"), - Type: to.Ptr("videoAnalyzers"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/mediaservices_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/mediaservices_client_example_test.go deleted file mode 100644 index e10835631ee6..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/mediaservices_client_example_test.go +++ /dev/null @@ -1,251 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-all-accounts.json -func ExampleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-get-by-name.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosotv", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-create.json -func ExampleClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "contoso", - "contososports", - armmediaservices.MediaService{ - Location: to.Ptr("South Central US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - Identity: &armmediaservices.MediaServiceIdentity{ - Type: to.Ptr("UserAssigned"), - UserAssignedIdentities: map[string]*armmediaservices.UserAssignedManagedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {}, - }, - }, - Properties: &armmediaservices.MediaServiceProperties{ - Encryption: &armmediaservices.AccountEncryption{ - Type: to.Ptr(armmediaservices.AccountEncryptionKeyTypeCustomerKey), - Identity: &armmediaservices.ResourceIdentity{ - UseSystemAssignedIdentity: to.Ptr(false), - UserAssignedIdentity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), - }, - }, - KeyDelivery: &armmediaservices.KeyDelivery{ - AccessControl: &armmediaservices.AccessControl{ - DefaultAction: to.Ptr(armmediaservices.DefaultActionAllow), - }, - }, - PublicNetworkAccess: to.Ptr(armmediaservices.PublicNetworkAccessEnabled), - StorageAccounts: []*armmediaservices.StorageAccount{ - { - Type: to.Ptr(armmediaservices.StorageAccountTypePrimary), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Storage/storageAccounts/contososportsstore"), - Identity: &armmediaservices.ResourceIdentity{ - UseSystemAssignedIdentity: to.Ptr(false), - UserAssignedIdentity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), - }, - }}, - StorageAuthentication: to.Ptr(armmediaservices.StorageAuthenticationManagedIdentity), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-delete.json -func ExampleClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contoso", - "contososports", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-update.json -func ExampleClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "contoso", - "contososports", - armmediaservices.MediaServiceUpdate{ - Tags: map[string]*string{ - "key1": to.Ptr("value3"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-sync-storage-keys.json -func ExampleClient_SyncStorageKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.SyncStorageKeys(ctx, - "contoso", - "contososports", - armmediaservices.SyncStorageKeysInput{ - ID: to.Ptr("contososportsstore"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-media-edge-policies.json -func ExampleClient_ListEdgePolicies() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListEdgePolicies(ctx, - "contoso", - "contososports", - armmediaservices.ListEdgePoliciesInput{ - DeviceID: to.Ptr("contosiothubhost_contosoiotdevice"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json -func ExampleClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/mediaservicesoperationresults_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/mediaservicesoperationresults_client_example_test.go deleted file mode 100644 index d816f77a3774..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/mediaservicesoperationresults_client_example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-result-by-id.json -func ExampleOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "westus", - "6FBA62C4-99B5-4FF8-9826-FC4744A8864F", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/mediaservicesoperationstatuses_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/mediaservicesoperationstatuses_client_example_test.go deleted file mode 100644 index d9d3a5e0a88d..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/mediaservicesoperationstatuses_client_example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json -func ExampleOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "westus", - "D612C429-2526-49D5-961B-885AE11406FD", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/models.go b/sdk/resourcemanager/mediaservices/armmediaservices/models.go index 30060b6cfd8d..0df7cb2c2773 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/models.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/models.go @@ -462,6 +462,18 @@ type AssetsClientUpdateOptions struct { // placeholder for future optional parameters } +// AsyncOperationResult - The status of an async operation. +type AsyncOperationResult struct { + // The error object + Error *ErrorDetail `json:"error,omitempty"` + + // Operation Id of the async operation. + Name *string `json:"name,omitempty"` + + // Operation status of the async operation. + Status *AsyncOperationStatus `json:"status,omitempty"` +} + // AudioClassification provides polymorphic access to related types. // Call the interface's GetAudio() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -598,6 +610,27 @@ func (a *AudioOverlay) GetOverlay() *Overlay { type AudioTrack struct { // REQUIRED; The discriminator for derived types. ODataType *string `json:"@odata.type,omitempty"` + + // The DASH specific setting for the audio track. + DashSettings *DashSettings `json:"dashSettings,omitempty"` + + // The display name of the audio track on a video player. In HLS, this maps to the NAME attribute of EXT-X-MEDIA. + DisplayName *string `json:"displayName,omitempty"` + + // The file name to the source file. This file is located in the storage container of the asset. + FileName *string `json:"fileName,omitempty"` + + // The HLS specific setting for the audio track. + HlsSettings *HlsSettings `json:"hlsSettings,omitempty"` + + // The RFC5646 language code for the audio track. + LanguageCode *string `json:"languageCode,omitempty"` + + // The MPEG-4 audio track ID for the audio track. + Mpeg4TrackID *int32 `json:"mpeg4TrackId,omitempty"` + + // READ-ONLY; The stream bit rate for the audio track. + BitRate *int32 `json:"bitRate,omitempty" azure:"ro"` } // GetTrackBase implements the TrackBaseClassification interface for type AudioTrack. @@ -687,6 +720,16 @@ type CheckNameAvailabilityInput struct { Type *string `json:"type,omitempty"` } +// ClearKeyEncryptionConfiguration - Class to specify ClearKey configuration of common encryption schemes in Streaming Policy +type ClearKeyEncryptionConfiguration struct { + // Template for the URL of the custom service delivering content keys 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 value is {AlternativeMediaId}, + // which is replaced with the value of + // StreamingLocatorId.AlternativeMediaId. + CustomKeysAcquisitionURLTemplate *string `json:"customKeysAcquisitionUrlTemplate,omitempty"` +} + // ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. type ClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. @@ -770,6 +813,9 @@ func (c *Codec) GetCodec() *Codec { return c } // CommonEncryptionCbcs - Class for CommonEncryptionCbcs encryption scheme type CommonEncryptionCbcs struct { + // Optional configuration supporting ClearKey in CommonEncryptionCbcs encryption scheme. + ClearKeyEncryptionConfiguration *ClearKeyEncryptionConfiguration `json:"clearKeyEncryptionConfiguration,omitempty"` + // Representing which tracks should not be encrypted ClearTracks []*TrackSelection `json:"clearTracks,omitempty"` @@ -785,6 +831,9 @@ type CommonEncryptionCbcs struct { // CommonEncryptionCenc - Class for envelope encryption scheme type CommonEncryptionCenc struct { + // Optional configuration supporting ClearKey in CommonEncryptionCenc encryption scheme. + ClearKeyEncryptionConfiguration *ClearKeyEncryptionConfiguration `json:"clearKeyEncryptionConfiguration,omitempty"` + // Representing which tracks should not be encrypted ClearTracks []*TrackSelection `json:"clearTracks,omitempty"` @@ -1080,6 +1129,9 @@ type ContentKeyPolicyPlayReadyLicense struct { // The relative expiration date of license. RelativeExpirationDate *string `json:"relativeExpirationDate,omitempty"` + + // The security level. + SecurityLevel *SecurityLevel `json:"securityLevel,omitempty"` } // ContentKeyPolicyPlayReadyPlayRight - Configures the Play Right in the PlayReady license. @@ -1370,6 +1422,12 @@ type CrossSiteAccessPolicies struct { CrossDomainPolicy *string `json:"crossDomainPolicy,omitempty"` } +// DashSettings - The DASH setting for a track. +type DashSettings struct { + // The role for the DASH setting. + Role *string `json:"role,omitempty"` +} + // DefaultKey - Class to specify properties of default content key for each encryption scheme type DefaultKey struct { // Label can be used to specify Content Key when creating a Streaming Locator @@ -1930,7 +1988,7 @@ type Hls struct { FragmentsPerTsSegment *int32 `json:"fragmentsPerTsSegment,omitempty"` } -// HlsSettings - The HLS setting for a text track. +// HlsSettings - The HLS setting for a track. type HlsSettings struct { // The characteristics for the HLS setting. Characteristics *string `json:"characteristics,omitempty"` @@ -2968,6 +3026,11 @@ type LiveEventTranscription struct { OutputTranscriptionTrack *LiveEventOutputTranscriptionTrack `json:"outputTranscriptionTrack,omitempty"` } +// LiveEventsClientAsyncOperationOptions contains the optional parameters for the LiveEventsClient.AsyncOperation method. +type LiveEventsClientAsyncOperationOptions struct { + // placeholder for future optional parameters +} + // LiveEventsClientBeginAllocateOptions contains the optional parameters for the LiveEventsClient.BeginAllocate method. type LiveEventsClientBeginAllocateOptions struct { // Resumes the LRO from the provided token. @@ -3022,6 +3085,11 @@ type LiveEventsClientListOptions struct { // placeholder for future optional parameters } +// LiveEventsClientOperationLocationOptions contains the optional parameters for the LiveEventsClient.OperationLocation method. +type LiveEventsClientOperationLocationOptions struct { + // placeholder for future optional parameters +} + // LiveOutput - The Live Output. type LiveOutput struct { // Live output properties. @@ -3074,6 +3142,13 @@ type LiveOutputProperties struct { // The initial timestamp that the live output will start at, any content before this value will not be archived. OutputSnapTime *int64 `json:"outputSnapTime,omitempty"` + // ISO 8601 time between 1 minute to the duration of archiveWindowLength to control seek-able window length during Live. The + // service won't use this property once LiveOutput stops. The archived VOD will + // have full content with original ArchiveWindowLength. For example, use PT1H30M to indicate 1 hour and 30 minutes of rewind + // window length. Service will use implicit default value 30m only if Live Event + // enables LL. + RewindWindowLength *string `json:"rewindWindowLength,omitempty"` + // READ-ONLY; The creation time the live output. Created *time.Time `json:"created,omitempty" azure:"ro"` @@ -3087,6 +3162,11 @@ type LiveOutputProperties struct { ResourceState *LiveOutputResourceState `json:"resourceState,omitempty" azure:"ro"` } +// LiveOutputsClientAsyncOperationOptions contains the optional parameters for the LiveOutputsClient.AsyncOperation method. +type LiveOutputsClientAsyncOperationOptions struct { + // placeholder for future optional parameters +} + // LiveOutputsClientBeginCreateOptions contains the optional parameters for the LiveOutputsClient.BeginCreate method. type LiveOutputsClientBeginCreateOptions struct { // Resumes the LRO from the provided token. @@ -3109,6 +3189,12 @@ type LiveOutputsClientListOptions struct { // placeholder for future optional parameters } +// LiveOutputsClientOperationLocationOptions contains the optional parameters for the LiveOutputsClient.OperationLocation +// method. +type LiveOutputsClientOperationLocationOptions struct { + // placeholder for future optional parameters +} + // LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability // method. type LocationsClientCheckNameAvailabilityOptions struct { @@ -4159,6 +4245,12 @@ type StreamingEndpointSKUInfoListResult struct { Value []*ArmStreamingEndpointSKUInfo `json:"value,omitempty"` } +// StreamingEndpointsClientAsyncOperationOptions contains the optional parameters for the StreamingEndpointsClient.AsyncOperation +// method. +type StreamingEndpointsClientAsyncOperationOptions struct { + // placeholder for future optional parameters +} + // StreamingEndpointsClientBeginCreateOptions contains the optional parameters for the StreamingEndpointsClient.BeginCreate // method. type StreamingEndpointsClientBeginCreateOptions struct { @@ -4212,6 +4304,12 @@ type StreamingEndpointsClientListOptions struct { // placeholder for future optional parameters } +// StreamingEndpointsClientOperationLocationOptions contains the optional parameters for the StreamingEndpointsClient.OperationLocation +// method. +type StreamingEndpointsClientOperationLocationOptions struct { + // placeholder for future optional parameters +} + // StreamingEndpointsClientSKUsOptions contains the optional parameters for the StreamingEndpointsClient.SKUs method. type StreamingEndpointsClientSKUsOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go b/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go index 20f4377d9dc2..77870e2f35de 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go @@ -897,6 +897,41 @@ func (a *AssetTrackProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AsyncOperationResult. +func (a AsyncOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", a.Error) + populate(objectMap, "name", a.Name) + populate(objectMap, "status", a.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AsyncOperationResult. +func (a *AsyncOperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &a.Error) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Audio. func (a Audio) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1033,6 +1068,13 @@ func (a *AudioOverlay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AudioTrack. func (a AudioTrack) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "bitRate", a.BitRate) + populate(objectMap, "dashSettings", a.DashSettings) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "fileName", a.FileName) + populate(objectMap, "hlsSettings", a.HlsSettings) + populate(objectMap, "languageCode", a.LanguageCode) + populate(objectMap, "mpeg4TrackId", a.Mpeg4TrackID) objectMap["@odata.type"] = "#Microsoft.Media.AudioTrack" return json.Marshal(objectMap) } @@ -1046,6 +1088,27 @@ func (a *AudioTrack) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "bitRate": + err = unpopulate(val, "BitRate", &a.BitRate) + delete(rawMsg, key) + case "dashSettings": + err = unpopulate(val, "DashSettings", &a.DashSettings) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "fileName": + err = unpopulate(val, "FileName", &a.FileName) + delete(rawMsg, key) + case "hlsSettings": + err = unpopulate(val, "HlsSettings", &a.HlsSettings) + delete(rawMsg, key) + case "languageCode": + err = unpopulate(val, "LanguageCode", &a.LanguageCode) + delete(rawMsg, key) + case "mpeg4TrackId": + err = unpopulate(val, "Mpeg4TrackID", &a.Mpeg4TrackID) + delete(rawMsg, key) case "@odata.type": err = unpopulate(val, "ODataType", &a.ODataType) delete(rawMsg, key) @@ -1220,6 +1283,33 @@ func (c *CheckNameAvailabilityInput) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ClearKeyEncryptionConfiguration. +func (c ClearKeyEncryptionConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customKeysAcquisitionUrlTemplate", c.CustomKeysAcquisitionURLTemplate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClearKeyEncryptionConfiguration. +func (c *ClearKeyEncryptionConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customKeysAcquisitionUrlTemplate": + err = unpopulate(val, "CustomKeysAcquisitionURLTemplate", &c.CustomKeysAcquisitionURLTemplate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ClipTime. func (c ClipTime) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1281,6 +1371,7 @@ func (c *Codec) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CommonEncryptionCbcs. func (c CommonEncryptionCbcs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "clearKeyEncryptionConfiguration", c.ClearKeyEncryptionConfiguration) populate(objectMap, "clearTracks", c.ClearTracks) populate(objectMap, "contentKeys", c.ContentKeys) populate(objectMap, "drm", c.Drm) @@ -1297,6 +1388,9 @@ func (c *CommonEncryptionCbcs) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "clearKeyEncryptionConfiguration": + err = unpopulate(val, "ClearKeyEncryptionConfiguration", &c.ClearKeyEncryptionConfiguration) + delete(rawMsg, key) case "clearTracks": err = unpopulate(val, "ClearTracks", &c.ClearTracks) delete(rawMsg, key) @@ -1320,6 +1414,7 @@ func (c *CommonEncryptionCbcs) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CommonEncryptionCenc. func (c CommonEncryptionCenc) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "clearKeyEncryptionConfiguration", c.ClearKeyEncryptionConfiguration) populate(objectMap, "clearTracks", c.ClearTracks) populate(objectMap, "contentKeys", c.ContentKeys) populate(objectMap, "drm", c.Drm) @@ -1336,6 +1431,9 @@ func (c *CommonEncryptionCenc) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "clearKeyEncryptionConfiguration": + err = unpopulate(val, "ClearKeyEncryptionConfiguration", &c.ClearKeyEncryptionConfiguration) + delete(rawMsg, key) case "clearTracks": err = unpopulate(val, "ClearTracks", &c.ClearTracks) delete(rawMsg, key) @@ -1796,6 +1894,7 @@ func (c ContentKeyPolicyPlayReadyLicense) MarshalJSON() ([]byte, error) { populate(objectMap, "playRight", c.PlayRight) populate(objectMap, "relativeBeginDate", c.RelativeBeginDate) populate(objectMap, "relativeExpirationDate", c.RelativeExpirationDate) + populate(objectMap, "securityLevel", c.SecurityLevel) return json.Marshal(objectMap) } @@ -1838,6 +1937,9 @@ func (c *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(data []byte) error { case "relativeExpirationDate": err = unpopulate(val, "RelativeExpirationDate", &c.RelativeExpirationDate) delete(rawMsg, key) + case "securityLevel": + err = unpopulate(val, "SecurityLevel", &c.SecurityLevel) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2379,6 +2481,33 @@ func (c *CrossSiteAccessPolicies) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DashSettings. +func (d DashSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "role", d.Role) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DashSettings. +func (d *DashSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "role": + err = unpopulate(val, "Role", &d.Role) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DefaultKey. func (d DefaultKey) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -5149,6 +5278,7 @@ func (l LiveOutputProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "outputSnapTime", l.OutputSnapTime) populate(objectMap, "provisioningState", l.ProvisioningState) populate(objectMap, "resourceState", l.ResourceState) + populate(objectMap, "rewindWindowLength", l.RewindWindowLength) return json.Marshal(objectMap) } @@ -5191,6 +5321,9 @@ func (l *LiveOutputProperties) UnmarshalJSON(data []byte) error { case "resourceState": err = unpopulate(val, "ResourceState", &l.ResourceState) delete(rawMsg, key) + case "rewindWindowLength": + err = unpopulate(val, "RewindWindowLength", &l.RewindWindowLength) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operations_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/operations_client_example_test.go deleted file mode 100644 index 391b23de4f77..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operations_client_example_test.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/operations-list-all.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client_example_test.go deleted file mode 100644 index bc4e527b3e2b..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-list.json -func ExamplePrivateEndpointConnectionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "contoso", - "contososports", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contososports", - "connectionName1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-put.json -func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "contoso", - "contososports", - "connectionName1", - armmediaservices.PrivateEndpointConnection{ - Properties: &armmediaservices.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armmediaservices.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Test description."), - Status: to.Ptr(armmediaservices.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-delete.json -func ExamplePrivateEndpointConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contoso", - "contososports", - "connectionName1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client_example_test.go deleted file mode 100644 index 51a9f8940d00..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-list.json -func ExamplePrivateLinkResourcesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "contoso", - "contososports", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-get-by-name.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contososports", - "keydelivery", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go b/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go index 5e60c6127731..273d19f7ce2a 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go @@ -222,6 +222,11 @@ type LiveEventsClientAllocateResponse struct { // placeholder for future response values } +// LiveEventsClientAsyncOperationResponse contains the response from method LiveEventsClient.AsyncOperation. +type LiveEventsClientAsyncOperationResponse struct { + AsyncOperationResult +} + // LiveEventsClientCreateResponse contains the response from method LiveEventsClient.Create. type LiveEventsClientCreateResponse struct { LiveEvent @@ -242,6 +247,11 @@ type LiveEventsClientListResponse struct { LiveEventListResult } +// LiveEventsClientOperationLocationResponse contains the response from method LiveEventsClient.OperationLocation. +type LiveEventsClientOperationLocationResponse struct { + LiveEvent +} + // LiveEventsClientResetResponse contains the response from method LiveEventsClient.Reset. type LiveEventsClientResetResponse struct { // placeholder for future response values @@ -262,6 +272,11 @@ type LiveEventsClientUpdateResponse struct { LiveEvent } +// LiveOutputsClientAsyncOperationResponse contains the response from method LiveOutputsClient.AsyncOperation. +type LiveOutputsClientAsyncOperationResponse struct { + AsyncOperationResult +} + // LiveOutputsClientCreateResponse contains the response from method LiveOutputsClient.Create. type LiveOutputsClientCreateResponse struct { LiveOutput @@ -282,6 +297,11 @@ type LiveOutputsClientListResponse struct { LiveOutputListResult } +// LiveOutputsClientOperationLocationResponse contains the response from method LiveOutputsClient.OperationLocation. +type LiveOutputsClientOperationLocationResponse struct { + LiveOutput +} + // LocationsClientCheckNameAvailabilityResponse contains the response from method LocationsClient.CheckNameAvailability. type LocationsClientCheckNameAvailabilityResponse struct { EntityNameAvailabilityCheckOutput @@ -340,6 +360,11 @@ type PrivateLinkResourcesClientListResponse struct { PrivateLinkResourceListResult } +// StreamingEndpointsClientAsyncOperationResponse contains the response from method StreamingEndpointsClient.AsyncOperation. +type StreamingEndpointsClientAsyncOperationResponse struct { + AsyncOperationResult +} + // StreamingEndpointsClientCreateResponse contains the response from method StreamingEndpointsClient.Create. type StreamingEndpointsClientCreateResponse struct { StreamingEndpoint @@ -360,6 +385,11 @@ type StreamingEndpointsClientListResponse struct { StreamingEndpointListResult } +// StreamingEndpointsClientOperationLocationResponse contains the response from method StreamingEndpointsClient.OperationLocation. +type StreamingEndpointsClientOperationLocationResponse struct { + StreamingEndpoint +} + // StreamingEndpointsClientSKUsResponse contains the response from method StreamingEndpointsClient.SKUs. type StreamingEndpointsClientSKUsResponse struct { StreamingEndpointSKUInfoListResult diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go index d097ef13c023..6da520c28283 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go @@ -56,9 +56,71 @@ func NewStreamingEndpointsClient(subscriptionID string, credential azcore.TokenC return client, nil } +// AsyncOperation - Get a streaming endpoint operation status. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-08-01 +// resourceGroupName - The name of the resource group within the Azure subscription. +// accountName - The Media Services account name. +// operationID - The ID of an ongoing async operation. +// options - StreamingEndpointsClientAsyncOperationOptions contains the optional parameters for the StreamingEndpointsClient.AsyncOperation +// method. +func (client *StreamingEndpointsClient) AsyncOperation(ctx context.Context, resourceGroupName string, accountName string, operationID string, options *StreamingEndpointsClientAsyncOperationOptions) (StreamingEndpointsClientAsyncOperationResponse, error) { + req, err := client.asyncOperationCreateRequest(ctx, resourceGroupName, accountName, operationID, options) + if err != nil { + return StreamingEndpointsClientAsyncOperationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StreamingEndpointsClientAsyncOperationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StreamingEndpointsClientAsyncOperationResponse{}, runtime.NewResponseError(resp) + } + return client.asyncOperationHandleResponse(resp) +} + +// asyncOperationCreateRequest creates the AsyncOperation request. +func (client *StreamingEndpointsClient) asyncOperationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, operationID string, options *StreamingEndpointsClientAsyncOperationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpointOperations/{operationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// asyncOperationHandleResponse handles the AsyncOperation response. +func (client *StreamingEndpointsClient) asyncOperationHandleResponse(resp *http.Response) (StreamingEndpointsClientAsyncOperationResponse, error) { + result := StreamingEndpointsClientAsyncOperationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AsyncOperationResult); err != nil { + return StreamingEndpointsClientAsyncOperationResponse{}, err + } + return result, nil +} + // BeginCreate - Creates a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingEndpointName - The name of the streaming endpoint, maximum length is 24. @@ -79,7 +141,7 @@ func (client *StreamingEndpointsClient) BeginCreate(ctx context.Context, resourc // Create - Creates a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *StreamingEndpointsClient) create(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, options *StreamingEndpointsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) if err != nil { @@ -119,7 +181,7 @@ func (client *StreamingEndpointsClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AutoStart != nil { reqQP.Set("autoStart", strconv.FormatBool(*options.AutoStart)) } @@ -130,7 +192,7 @@ func (client *StreamingEndpointsClient) createCreateRequest(ctx context.Context, // BeginDelete - Deletes a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingEndpointName - The name of the streaming endpoint, maximum length is 24. @@ -150,7 +212,7 @@ func (client *StreamingEndpointsClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *StreamingEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -190,7 +252,7 @@ func (client *StreamingEndpointsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +260,7 @@ func (client *StreamingEndpointsClient) deleteCreateRequest(ctx context.Context, // Get - Gets a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingEndpointName - The name of the streaming endpoint, maximum length is 24. @@ -242,7 +304,7 @@ func (client *StreamingEndpointsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +321,7 @@ func (client *StreamingEndpointsClient) getHandleResponse(resp *http.Response) ( // NewListPager - Lists the streaming endpoints in the account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // options - StreamingEndpointsClientListOptions contains the optional parameters for the StreamingEndpointsClient.List method. @@ -311,7 +373,7 @@ func (client *StreamingEndpointsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,9 +388,76 @@ func (client *StreamingEndpointsClient) listHandleResponse(resp *http.Response) return result, nil } +// OperationLocation - Get a streaming endpoint operation status. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-08-01 +// resourceGroupName - The name of the resource group within the Azure subscription. +// accountName - The Media Services account name. +// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// operationID - The ID of an ongoing async operation. +// options - StreamingEndpointsClientOperationLocationOptions contains the optional parameters for the StreamingEndpointsClient.OperationLocation +// method. +func (client *StreamingEndpointsClient) OperationLocation(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, operationID string, options *StreamingEndpointsClientOperationLocationOptions) (StreamingEndpointsClientOperationLocationResponse, error) { + req, err := client.operationLocationCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, operationID, options) + if err != nil { + return StreamingEndpointsClientOperationLocationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StreamingEndpointsClientOperationLocationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return StreamingEndpointsClientOperationLocationResponse{}, runtime.NewResponseError(resp) + } + return client.operationLocationHandleResponse(resp) +} + +// operationLocationCreateRequest creates the OperationLocation request. +func (client *StreamingEndpointsClient) operationLocationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, operationID string, options *StreamingEndpointsClientOperationLocationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/streamingEndpoints/{streamingEndpointName}/operationLocations/{operationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if streamingEndpointName == "" { + return nil, errors.New("parameter streamingEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{streamingEndpointName}", url.PathEscape(streamingEndpointName)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// operationLocationHandleResponse handles the OperationLocation response. +func (client *StreamingEndpointsClient) operationLocationHandleResponse(resp *http.Response) (StreamingEndpointsClientOperationLocationResponse, error) { + result := StreamingEndpointsClientOperationLocationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StreamingEndpoint); err != nil { + return StreamingEndpointsClientOperationLocationResponse{}, err + } + return result, nil +} + // SKUs - List streaming endpoint supported skus. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingEndpointName - The name of the streaming endpoint, maximum length is 24. @@ -372,7 +501,7 @@ func (client *StreamingEndpointsClient) skUsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -389,7 +518,7 @@ func (client *StreamingEndpointsClient) skUsHandleResponse(resp *http.Response) // BeginScale - Scales an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingEndpointName - The name of the streaming endpoint, maximum length is 24. @@ -410,7 +539,7 @@ func (client *StreamingEndpointsClient) BeginScale(ctx context.Context, resource // Scale - Scales an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *StreamingEndpointsClient) scale(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEntityScaleUnit, options *StreamingEndpointsClientBeginScaleOptions) (*http.Response, error) { req, err := client.scaleCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) if err != nil { @@ -450,7 +579,7 @@ func (client *StreamingEndpointsClient) scaleCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -458,7 +587,7 @@ func (client *StreamingEndpointsClient) scaleCreateRequest(ctx context.Context, // BeginStart - Starts an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingEndpointName - The name of the streaming endpoint, maximum length is 24. @@ -478,7 +607,7 @@ func (client *StreamingEndpointsClient) BeginStart(ctx context.Context, resource // Start - Starts an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *StreamingEndpointsClient) start(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -518,7 +647,7 @@ func (client *StreamingEndpointsClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -526,7 +655,7 @@ func (client *StreamingEndpointsClient) startCreateRequest(ctx context.Context, // BeginStop - Stops an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingEndpointName - The name of the streaming endpoint, maximum length is 24. @@ -546,7 +675,7 @@ func (client *StreamingEndpointsClient) BeginStop(ctx context.Context, resourceG // Stop - Stops an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *StreamingEndpointsClient) stop(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -586,7 +715,7 @@ func (client *StreamingEndpointsClient) stopCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -594,7 +723,7 @@ func (client *StreamingEndpointsClient) stopCreateRequest(ctx context.Context, r // BeginUpdate - Updates a existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingEndpointName - The name of the streaming endpoint, maximum length is 24. @@ -615,7 +744,7 @@ func (client *StreamingEndpointsClient) BeginUpdate(ctx context.Context, resourc // Update - Updates a existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *StreamingEndpointsClient) update(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, options *StreamingEndpointsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) if err != nil { @@ -655,7 +784,7 @@ func (client *StreamingEndpointsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client_example_test.go deleted file mode 100644 index 19ccc0e747a1..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client_example_test.go +++ /dev/null @@ -1,273 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streamingendpoint-list-all.json -func ExampleStreamingEndpointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("mediaresources", - "slitestmedia10", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streamingendpoint-list-by-name.json -func ExampleStreamingEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "mediaresources", - "slitestmedia10", - "myStreamingEndpoint1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streamingendpoint-create.json -func ExampleStreamingEndpointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "mediaresources", - "slitestmedia10", - "myStreamingEndpoint1", - armmediaservices.StreamingEndpoint{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armmediaservices.StreamingEndpointProperties{ - Description: to.Ptr("test event 1"), - AccessControl: &armmediaservices.StreamingEndpointAccessControl{ - Akamai: &armmediaservices.AkamaiAccessControl{ - AkamaiSignatureHeaderAuthenticationKeyList: []*armmediaservices.AkamaiSignatureHeaderAuthenticationKey{ - { - Base64Key: to.Ptr("dGVzdGlkMQ=="), - Expiration: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2029-12-31T16:00:00-08:00"); return t }()), - Identifier: to.Ptr("id1"), - }, - { - Base64Key: to.Ptr("dGVzdGlkMQ=="), - Expiration: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2030-12-31T16:00:00-08:00"); return t }()), - Identifier: to.Ptr("id2"), - }}, - }, - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowedIp"), - Address: to.Ptr("192.168.1.1"), - }}, - }, - }, - AvailabilitySetName: to.Ptr("availableset"), - CdnEnabled: to.Ptr(false), - ScaleUnits: to.Ptr[int32](1), - }, - }, - &armmediaservices.StreamingEndpointsClientBeginCreateOptions{AutoStart: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streamingendpoint-update.json -func ExampleStreamingEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "mediaresources", - "slitestmedia10", - "myStreamingEndpoint1", - armmediaservices.StreamingEndpoint{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "tag3": to.Ptr("value3"), - "tag5": to.Ptr("value5"), - }, - Properties: &armmediaservices.StreamingEndpointProperties{ - Description: to.Ptr("test event 2"), - AvailabilitySetName: to.Ptr("availableset"), - ScaleUnits: to.Ptr[int32](5), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streamingendpoint-delete.json -func ExampleStreamingEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "mediaresources", - "slitestmedia10", - "myStreamingEndpoint1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streamingendpoint-start.json -func ExampleStreamingEndpointsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "mediaresources", - "slitestmedia10", - "myStreamingEndpoint1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streamingendpoint-stop.json -func ExampleStreamingEndpointsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "mediaresources", - "slitestmedia10", - "myStreamingEndpoint1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streamingendpoint-scale.json -func ExampleStreamingEndpointsClient_BeginScale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginScale(ctx, - "mediaresources", - "slitestmedia10", - "myStreamingEndpoint1", - armmediaservices.StreamingEntityScaleUnit{ - ScaleUnit: to.Ptr[int32](5), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go index 9bb4abbb8633..27705bd9fcfb 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go @@ -58,7 +58,7 @@ func NewStreamingLocatorsClient(subscriptionID string, credential azcore.TokenCr // Create - Create a Streaming Locator in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingLocatorName - The Streaming Locator name. @@ -104,7 +104,7 @@ func (client *StreamingLocatorsClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,7 @@ func (client *StreamingLocatorsClient) createHandleResponse(resp *http.Response) // Delete - Deletes a Streaming Locator in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingLocatorName - The Streaming Locator name. @@ -166,7 +166,7 @@ func (client *StreamingLocatorsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +174,7 @@ func (client *StreamingLocatorsClient) deleteCreateRequest(ctx context.Context, // Get - Get the details of a Streaming Locator in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingLocatorName - The Streaming Locator name. @@ -218,7 +218,7 @@ func (client *StreamingLocatorsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,7 @@ func (client *StreamingLocatorsClient) getHandleResponse(resp *http.Response) (S // NewListPager - Lists the Streaming Locators in the account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // options - StreamingLocatorsClientListOptions contains the optional parameters for the StreamingLocatorsClient.List method. @@ -287,7 +287,7 @@ func (client *StreamingLocatorsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -313,7 +313,7 @@ func (client *StreamingLocatorsClient) listHandleResponse(resp *http.Response) ( // ListContentKeys - List Content Keys used by this Streaming Locator // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingLocatorName - The Streaming Locator name. @@ -358,7 +358,7 @@ func (client *StreamingLocatorsClient) listContentKeysCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -375,7 +375,7 @@ func (client *StreamingLocatorsClient) listContentKeysHandleResponse(resp *http. // ListPaths - List Paths supported by this Streaming Locator // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingLocatorName - The Streaming Locator name. @@ -420,7 +420,7 @@ func (client *StreamingLocatorsClient) listPathsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client_example_test.go deleted file mode 100644 index 828af105ecba..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-locators-list.json -func ExampleStreamingLocatorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", - "contosomedia", - &armmediaservices.StreamingLocatorsClientListOptions{Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-locators-get-by-name.json -func ExampleStreamingLocatorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosomedia", - "clearStreamingLocator", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-locators-create-clear.json -func ExampleStreamingLocatorsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, - "contoso", - "contosomedia", - "UserCreatedClearStreamingLocator", - armmediaservices.StreamingLocator{ - Properties: &armmediaservices.StreamingLocatorProperties{ - AssetName: to.Ptr("ClimbingMountRainier"), - StreamingPolicyName: to.Ptr("clearStreamingPolicy"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-locators-delete.json -func ExampleStreamingLocatorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contoso", - "contosomedia", - "clearStreamingLocator", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-locators-list-content-keys.json -func ExampleStreamingLocatorsClient_ListContentKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListContentKeys(ctx, - "contoso", - "contosomedia", - "secureStreamingLocator", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-locators-list-paths-streaming-and-download.json -func ExampleStreamingLocatorsClient_ListPaths() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListPaths(ctx, - "contoso", - "contosomedia", - "clearStreamingLocator", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go index a0313bfefd44..7b5dabb412d4 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go @@ -58,7 +58,7 @@ func NewStreamingPoliciesClient(subscriptionID string, credential azcore.TokenCr // Create - Create a Streaming Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingPolicyName - The Streaming Policy name. @@ -104,7 +104,7 @@ func (client *StreamingPoliciesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,7 @@ func (client *StreamingPoliciesClient) createHandleResponse(resp *http.Response) // Delete - Deletes a Streaming Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingPolicyName - The Streaming Policy name. @@ -166,7 +166,7 @@ func (client *StreamingPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +174,7 @@ func (client *StreamingPoliciesClient) deleteCreateRequest(ctx context.Context, // Get - Get the details of a Streaming Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // streamingPolicyName - The Streaming Policy name. @@ -218,7 +218,7 @@ func (client *StreamingPoliciesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,7 @@ func (client *StreamingPoliciesClient) getHandleResponse(resp *http.Response) (S // NewListPager - Lists the Streaming Policies in the account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // options - StreamingPoliciesClientListOptions contains the optional parameters for the StreamingPoliciesClient.List method. @@ -287,7 +287,7 @@ func (client *StreamingPoliciesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client_example_test.go deleted file mode 100644 index 0c0c80e85034..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client_example_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-policies-list.json -func ExampleStreamingPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", - "contosomedia", - &armmediaservices.StreamingPoliciesClientListOptions{Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-policy-get-by-name.json -func ExampleStreamingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosomedia", - "clearStreamingPolicy", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-policies-create-clear.json -func ExampleStreamingPoliciesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, - "contoso", - "contosomedia", - "UserCreatedClearStreamingPolicy", - armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - NoEncryption: &armmediaservices.NoEncryption{ - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(true), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(true), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/streaming-policies-delete.json -func ExampleStreamingPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contoso", - "contosomedia", - "secureStreamingPolicyWithCommonEncryptionCbcsOnly", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go index bd7cf09e8396..b1b6cdc24765 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go @@ -57,7 +57,7 @@ func NewTracksClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Create or update a Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -79,7 +79,7 @@ func (client *TracksClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Create or update a Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *TracksClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack, options *TracksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, parameters, options) if err != nil { @@ -123,7 +123,7 @@ func (client *TracksClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -131,7 +131,7 @@ func (client *TracksClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deletes a Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -151,7 +151,7 @@ func (client *TracksClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes a Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *TracksClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, options) if err != nil { @@ -195,7 +195,7 @@ func (client *TracksClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +203,7 @@ func (client *TracksClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get the details of a Track in the Asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -252,7 +252,7 @@ func (client *TracksClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *TracksClient) getHandleResponse(resp *http.Response) (TracksClient // NewListPager - Lists the Tracks in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -320,7 +320,7 @@ func (client *TracksClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +337,7 @@ func (client *TracksClient) listHandleResponse(resp *http.Response) (TracksClien // BeginUpdate - Updates an existing Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -358,7 +358,7 @@ func (client *TracksClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates an existing Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *TracksClient) update(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack, options *TracksClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, parameters, options) if err != nil { @@ -402,7 +402,7 @@ func (client *TracksClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -414,7 +414,7 @@ func (client *TracksClient) updateCreateRequest(ctx context.Context, resourceGro // may not be reflected immediately. CDN cache may also need to be purged if // applicable. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. // assetName - The Asset name. @@ -439,7 +439,7 @@ func (client *TracksClient) BeginUpdateTrackData(ctx context.Context, resourceGr // may not be reflected immediately. CDN cache may also need to be purged if // applicable. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-08-01 func (client *TracksClient) updateTrackData(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientBeginUpdateTrackDataOptions) (*http.Response, error) { req, err := client.updateTrackDataCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, options) if err != nil { @@ -483,7 +483,7 @@ func (client *TracksClient) updateTrackDataCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client_example_test.go deleted file mode 100644 index b9cc4303b4da..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client_example_test.go +++ /dev/null @@ -1,193 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/asset-tracks-list-all.json -func ExampleTracksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", - "contosomedia", - "ClimbingMountRainer", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/asset-tracks-get-by-name.json -func ExampleTracksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "text1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/asset-tracks-create.json -func ExampleTracksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "text3", - armmediaservices.AssetTrack{ - Properties: &armmediaservices.AssetTrackProperties{ - Track: &armmediaservices.TextTrack{ - ODataType: to.Ptr("#Microsoft.Media.TextTrack"), - DisplayName: to.Ptr("A new track"), - FileName: to.Ptr("text3.ttml"), - PlayerVisibility: to.Ptr(armmediaservices.VisibilityVisible), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/asset-tracks-delete.json -func ExampleTracksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "text2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/asset-tracks-update.json -func ExampleTracksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "text1", - armmediaservices.AssetTrack{ - Properties: &armmediaservices.AssetTrackProperties{ - Track: &armmediaservices.TextTrack{ - ODataType: to.Ptr("#Microsoft.Media.TextTrack"), - DisplayName: to.Ptr("A new name"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/asset-tracks-update-data.json -func ExampleTracksClient_BeginUpdateTrackData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateTrackData(ctx, - "contoso", - "contosomedia", - "ClimbingMountRainer", - "text2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client_example_test.go deleted file mode 100644 index 32309843756a..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client_example_test.go +++ /dev/null @@ -1,161 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all.json -func ExampleTransformsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", - "contosomedia", - &armmediaservices.TransformsClientListOptions{Filter: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-get-by-name.json -func ExampleTransformsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contosoresources", - "contosomedia", - "sampleTransform", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-create.json -func ExampleTransformsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "contosoresources", - "contosomedia", - "createdTransform", - armmediaservices.Transform{ - Properties: &armmediaservices.TransformProperties{ - Description: to.Ptr("Example Transform to illustrate create and update."), - Outputs: []*armmediaservices.TransformOutput{ - { - Preset: &armmediaservices.BuiltInStandardEncoderPreset{ - ODataType: to.Ptr("#Microsoft.Media.BuiltInStandardEncoderPreset"), - PresetName: to.Ptr(armmediaservices.EncoderNamedPresetAdaptiveStreaming), - }, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-delete.json -func ExampleTransformsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contosoresources", - "contosomedia", - "sampleTransform", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-update.json -func ExampleTransformsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "contosoresources", - "contosomedia", - "transformToUpdate", - armmediaservices.Transform{ - Properties: &armmediaservices.TransformProperties{ - Description: to.Ptr("Example transform to illustrate update."), - Outputs: []*armmediaservices.TransformOutput{ - { - Preset: &armmediaservices.BuiltInStandardEncoderPreset{ - ODataType: to.Ptr("#Microsoft.Media.BuiltInStandardEncoderPreset"), - PresetName: to.Ptr(armmediaservices.EncoderNamedPresetH264MultipleBitrate720P), - }, - RelativePriority: to.Ptr(armmediaservices.PriorityHigh), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -}